Skip to content

Instantly share code, notes, and snippets.

@jade-addin
jade-addin / code.js
Last active August 1, 2022 15:15
JET: Logistic Regression tool for the JADE Excel Add-in (using javascript)
//logistic regression in excel using javascript
let predictor_names
let select_values
//const form_data={}// takes the place of the from where users entered data on original webpage
let model_results={}
async function auto_exec(){
// set the tool css
Jade.set_css(gist_files('style.css'),"naive-bayes")
// place the tool html
@jade-addin
jade-addin / code.js
Last active May 6, 2022 12:15
JET: Logistic Regression tool for the JADE Excel Add-in
//logistic regression in excel using solver
let predictor_names
let select_values
let baseline_ll
async function auto_exec(){
// set the tool css
Jade.set_css(gist_files('style.css'),"naive-bayes")
// place the tool html
tag("tools-body").innerHTML=gist_files('tool.html')
@jade-addin
jade-addin / code.js
Last active May 12, 2022 16:21
JET: Alpha Vantage Data Import
//alpha vantage
const all_params=["symbol","outputsize","interval","adjusted","slice"]
const process_with={
INCOME_STATEMENT:{fn:fetch_json,on_success:place_json},
BALANCE_SHEET:{fn:fetch_json,on_success:place_json},
CASH_FLOW:{fn:fetch_json,on_success:place_json},
EARNINGS:{fn:fetch_json,on_success:place_earnings},
OVERVIEW:{fn:fetch_json,on_success:place_one_level_json},
}
const can_be_adjusted=["TIME_SERIES_DAILY","TIME_SERIES_WEEKLY","TIME_SERIES_MONTHLY"]
@jade-addin
jade-addin / code.js
Last active September 3, 2022 05:43
ATLAS: JADE Tools for Making ATLAS Assignments
async function auto_exec(){
const jet_engine_gist_id = "6e16e7521df65a93b17dd9b74c9161eb"
await jade.load_gist(jet_engine_gist_id)
Jade.set_css(gist_files('style.css'),"jet") // load css for these tools
jade_modules.jet_engine.launch(my_gist_id()) // run the jet engine on this gist
}
@jade-addin
jade-addin / code.js
Last active May 12, 2023 22:12
JET: Tools of general utility directly accessible in JADE
async function auto_exec(){
const jet_engine_gist_id = "6e16e7521df65a93b17dd9b74c9161eb"
await jade.load_gist(jet_engine_gist_id)
console.log("jet css",gist_files('style.css'))
Jade.set_css(gist_files('style.css'),"jet") // load css for these tools
jade_modules.jet_engine.launch(my_gist_id()) // run the jet engine on this gist
console.log("just loaded Jet Tools for general use (not in development mode)")
}
@jade-addin
jade-addin / dev_tools.js
Last active May 10, 2023 21:12
JET: Tool Development: develop a gist tool from local server
async function auto_exec(){
const jet_engine_gist_id = "6e16e7521df65a93b17dd9b74c9161eb"
await jade.load_gist(jet_engine_gist_id)
console.log("jet css",gist_files('style.css'))
Jade.set_css(gist_files('style.css'),"jet") // load css for these tools
jade_modules.jet_engine.launch(my_gist_id(),"https://localhost:3333/ee-atlas/s/local-gist-server") // run the jet engine on this gist
console.log("just loaded Jet Tool Development")
}
@jade-addin
jade-addin / jet_engine.js
Last active February 15, 2024 16:29
JET Engine: processor for JET tool sets
const version=3
function auto_exec(){
;console.log("==========================",version,"===========================")
//console.log("at jade_engine.autoexec -------------- 3 -------------",my_gist_id())
}
async function launch(gist_id, local_url){
// gist_id is the gist id of the tool set you are trying to launch
@jade-addin
jade-addin / code.js
Last active May 12, 2022 15:37
JET: Goal Seek for the JADE Excel Add-in
async function auto_exec(){
Jade.set_css(gist_files('style.css'))
tag("tools-body").innerHTML=gist_files('goal-seek.html')
const tool_data = await jade.read_object_from_workbook(window.active_tool)
console.log("tool_data",tool_data)
for(const[key,value] of Object.entries(tool_data)){
console.log(key, value)
tag(key).value=value
}
@jade-addin
jade-addin / code.js
Last active May 28, 2022 15:39
JET: data.world import to worksheet
//data.world
async function auto_exec(){
// set the tool css
Jade.set_css(gist_files('style.css'),"naive-bayes")
// place the tool html
tag("tools-body").innerHTML=gist_files('tool.html')
// fill in values from last tool use
jade_modules.jet_engine.restore_html_values()
}
@jade-addin
jade-addin / code.js
Last active May 20, 2022 21:31
JET: Naive Bayes tool for the JADE Excel Add-in
//Naive Bayes
let probabilities={}
let select_values=[]
async function auto_exec(){
// set the tool css
Jade.set_css(gist_files('style.css'),"naive-bayes")
// place the tool html
tag("tools-body").innerHTML=gist_files('tool.html')
// fill in values from last tool use