-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCalculator_without_src.js
36 lines (32 loc) · 11.1 KB
/
Calculator_without_src.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
(function() {
var fn = function() {
Bokeh.safely(function() {
(function(root) {
function embed_document(root) {
var docs_json = '{"4a587686-cdad-4b08-b3d3-9fb85505286b":{"defs":[],"roots":{"references":[{"attributes":{"data":{"save":{"__ndarray__":"YGZmZmZm9j/AyqIhlKP2P8C+mfp54vY/8B6/uyYj9z9wlgSoqWX3P1DoeX4Sqvc/UBQIfnHw9z/QF0hp1zj4PzAQdopVg/g/kI6Bt/3P+D+Q6jtW4h75P8BtpWAWcPk/sDZaaa3D+T/Qsh+guxn6P7Cek9ZVcvo/0Hf9hJHN+j/gWkPPhCv7P+BIA4pGjPs/MNrRP+7v+z+gap82lFb8P/DQRHVRwPw/4Lw4yT8t/T8Q327MeZ39P8ADYusaEf4/wFNKaz+I/j/Q9oBwBAP/P7BZEgWIgf8/CDPAj/QBAEAgANvUI0UAQLiVFkRiigBAsJyk0MDRAEBoPnPyUBsBQGB7EKokZwFAgMOphE61AUCAmCig4QUCQOAJba/xWAJAWNum/pKuAkDIMs532gYDQKCqPKfdYQNAcK9nwLK/A0A4FL2icCAEQA==","dtype":"float64","order":"little","shape":[41]},"sw":{"__ndarray__":"mpmZmZmZMkCfXfjTosMyQHAdeE6t7jJAyCFIZ8EaM0C5GW7A50czQAxY0EEpdjNAuStPG4+lM0BIwO3GItYzQP31CgvuBzRAa6Sq/Po6NEDGvc8BVG80QPnL59MDpTRAPURIghXcNEA6Mb50lBQ1QCe3MG6MTjVAP/lWjwmKNUBB64FZGMc1QM6derHFBTZAOph14h5GNkBp1huhMYg2QIMFqg4MzDZAl54mvLwRN0BXgq+tUlk3QAi+313dojdA2SVOwWzuN0D8dSVKETw4QF2w1uvbizhABXLmHt7dOEBQANbkKTI5QCHTKMzRiDlAEmeH9OjhOUCuJwATgz06QMFHZ3a0mzpAnWPWC5L8OkAOz0xjMWA7QNV2cbSoxjtASUR34w4wPEBz9ySGe5w8QHZzAekGDD1AWn+lFMp+PUCZBDTT3vQ9QA==","dtype":"float64","order":"little","shape":[41]},"x":{"__ndarray__":"AAAAAAAAAAAAAAAAAADQPwAAAAAAAOA/AAAAAAAA6D8AAAAAAADwPwAAAAAAAPQ/AAAAAAAA+D8AAAAAAAD8PwAAAAAAAABAAAAAAAAAAkAAAAAAAAAEQAAAAAAAAAZAAAAAAAAACEAAAAAAAAAKQAAAAAAAAAxAAAAAAAAADkAAAAAAAAAQQAAAAAAAABFAAAAAAAAAEkAAAAAAAAATQAAAAAAAABRAAAAAAAAAFUAAAAAAAAAWQAAAAAAAABdAAAAAAAAAGEAAAAAAAAAZQAAAAAAAABpAAAAAAAAAG0AAAAAAAAAcQAAAAAAAAB1AAAAAAAAAHkAAAAAAAAAfQAAAAAAAACBAAAAAAACAIEAAAAAAAAAhQAAAAAAAgCFAAAAAAAAAIkAAAAAAAIAiQAAAAAAAACNAAAAAAACAI0AAAAAAAAAkQA==","dtype":"float64","order":"little","shape":[41]},"y":{"__ndarray__":"AAAAAAAAAACMAjI314/pP8gMAgejLfo/EMfJsm0bBEDc+X5qvHQLQMFh8vXjkhFAJuSUstmYFUDNFKXY3c0ZQKXfvg6cMx5AqVsWzeZlIUB3JrPjHMwjQBExySpbTSZAtquQ8pPqKEC/WMs0waQrQCA2TM/kfC5AzeQWYAS6MED9juGxn0UyQCvqJ9rR4TNAswHKxSyPNUA8fBzzRk43QJwklpS7HzlA94F7tCoEO0A0lo9ZOfw8QNUL0ayRCD9Ah6clkPGUQEBKoYFLcbBBQDu7A0cl10JATP9Vo20JRECHH/14rUdFQLqfru5KkkZAuahJUK/pR0B9CncmR05JQLIR9U6CwEpA1vWTFdRATEBmxudNs89NQJzftG2abU9AWgkO1IONUECq6MWEPmxRQKToPUpAU1JAi2F8L85CU0D87oJYLztUQA==","dtype":"float64","order":"little","shape":[41]},"z":{"__ndarray__":"AAAAAAAANEBLihIW3C00QFy5Ie7UXDRAtxME0/OMNEAgY+5aQr40QJH2t2nK8DRA/qwvM5YkNUDFQYI9sFk1QABXsmMjkDVAVL0i2PrHNUBvfDMnQgE2QNUi8jkFPDZAqOfdWFB4NkBnLMAuMLY2QBLxmcux9TZAvNCmp+I2N0DvIHam0Hk3QFzSGhqKvjdA3bVyxh0FOEATzYXkmk04QJJS/iURmDhAZSq6uJDkOEBIcHZKKjM5QETelQzvgzlAFcsCuPDWOUBphS2RQSw6QPjVJ2z0gzpAZnjesBzeOkBUYHFfzjo7QNilqxQemjtAqPqbDiH8O0B7j04x7WA8QC1XqQuZyDxADZxr3DszPUAe4lGX7aA9QBEYX+rGET5AtB9MQ+GFPkDMvR7VVv0+QMoI6Z1CeD9ASHWybMD2P0CQ08VzdjxAQA==","dtype":"float64","order":"little","shape":[41]}},"selected":{"id":"3557"},"selection_policy":{"id":"3556"}},"id":"3511","type":"ColumnDataSource"},{"attributes":{"data_source":{"id":"3511"},"glyph":{"id":"3544"},"hover_glyph":null,"muted_glyph":null,"nonselection_glyph":{"id":"3545"},"view":{"id":"3547"}},"id":"3546","type":"GlyphRenderer"},{"attributes":{"bottom_units":"screen","fill_alpha":0.5,"fill_color":"lightgrey","left_units":"screen","level":"overlay","line_alpha":1.0,"line_color":"black","line_dash":[4,4],"line_width":2,"right_units":"screen","syncable":false,"top_units":"screen"},"id":"3535","type":"BoxAnnotation"},{"attributes":{"data_source":{"id":"3511"},"glyph":{"id":"3562"},"hover_glyph":null,"muted_glyph":null,"nonselection_glyph":{"id":"3563"},"view":{"id":"3565"}},"id":"3564","type":"GlyphRenderer"},{"attributes":{"args":{"FTE_after":{"id":"3603"},"FTE_before":{"id":"3600"},"automation_CAPEX":{"id":"3601"},"capital_CAGR":{"id":"3602"},"labour_CAGR":{"id":"3599"},"labour_cost":{"id":"3598"},"source":{"id":"3511"}},"code":"\\n const data = source.data;\\n const l = labour_cost.value;\\n const a = labour_CAGR.value;\\n const FTEb = FTE_before.value;\\n const CAPEX = automation_CAPEX.value;\\n const b = capital_CAGR.value;\\n const FTEa = FTE_after.value;\\n \\n const x = data['x']\\n const y = data['y']\\n const z = data['z']\\n const sw = data['sw']\\n const save = data['save']\\n for (var i = 0; i < x.length; i++) {\\n y[i] = ((l*40*52*FTEb)*i*Math.pow(a, i)) / 1000000;\\n z[i] = ((l*40*52*FTEa)*i*Math.pow(a, i) + 1000000*CAPEX*Math.pow(b, i)) / 1000000;\\n sw[i] = (0.9*(l*40*52*FTEa)*i*Math.pow(a, i) + 0.93 * 1000000*CAPEX*Math.pow(b, i)) / 1000000; \\n save[i] = z[i] - sw[i]\\n }\\n source.change.emit();\\n"},"id":"3604","type":"CustomJS"},{"attributes":{"below":[{"id":"3521"}],"center":[{"id":"3524"},{"id":"3528"},{"id":"3559"}],"height":400,"left":[{"id":"3525"}],"renderers":[{"id":"3546"},{"id":"3564"},{"id":"3581"}],"title":{"id":"3548"},"toolbar":{"id":"3536"},"x_range":{"id":"3513"},"x_scale":{"id":"3517"},"y_range":{"id":"3515"},"y_scale":{"id":"3519"}},"id":"3512","subtype":"Figure","type":"Plot"},{"attributes":{"callback":null,"formatters":{"@date":"datetime","@{adj close}":"printf"},"mode":"vline","renderers":[{"id":"3581"}],"tooltips":[["year","@x{0.00 a}"],["syncware saves","@save{0.00 a} million USD"]]},"id":"3605","type":"HoverTool"},{"attributes":{"axis":{"id":"3521"},"ticker":null},"id":"3524","type":"Grid"},{"attributes":{},"id":"3517","type":"LinearScale"},{"attributes":{"line_alpha":0.1,"line_color":"#00ebff","line_width":3,"x":{"field":"x"},"y":{"field":"sw"}},"id":"3580","type":"Line"},{"attributes":{},"id":"3522","type":"BasicTicker"},{"attributes":{"axis":{"id":"3525"},"dimension":1,"ticker":null},"id":"3528","type":"Grid"},{"attributes":{"label":{"value":"automation with syncware"},"renderers":[{"id":"3581"}]},"id":"3594","type":"LegendItem"},{"attributes":{"end":5},"id":"3513","type":"Range1d"},{"attributes":{"children":[{"id":"3598"},{"id":"3599"},{"id":"3600"},{"id":"3601"},{"id":"3602"},{"id":"3603"}]},"id":"3607","type":"Column"},{"attributes":{"end":100},"id":"3515","type":"Range1d"},{"attributes":{"end":200,"js_property_callbacks":{"change:value":[{"id":"3604"}]},"start":0.1,"step":0.1,"title":"Automation CAPEX (Million USD)","value":20},"id":"3601","type":"Slider"},{"attributes":{"line_alpha":0.6,"line_color":"red","line_width":3,"x":{"field":"x"},"y":{"field":"y"}},"id":"3544","type":"Line"},{"attributes":{},"id":"3551","type":"AllLabels"},{"attributes":{"source":{"id":"3511"}},"id":"3547","type":"CDSView"},{"attributes":{},"id":"3519","type":"LinearScale"},{"attributes":{"line_alpha":0.6,"line_color":"#00ebff","line_width":3,"x":{"field":"x"},"y":{"field":"sw"}},"id":"3579","type":"Line"},{"attributes":{"axis_label":"Years","formatter":{"id":"3552"},"major_label_policy":{"id":"3551"},"ticker":{"id":"3522"}},"id":"3521","type":"LinearAxis"},{"attributes":{"source":{"id":"3511"}},"id":"3582","type":"CDSView"},{"attributes":{"end":1.2,"js_property_callbacks":{"change:value":[{"id":"3604"}]},"start":0.9,"step":0.001,"title":"Labour cost increase year-on-year","value":1.1},"id":"3599","type":"Slider"},{"attributes":{},"id":"3552","type":"BasicTickFormatter"},{"attributes":{},"id":"3534","type":"HelpTool"},{"attributes":{"axis_label":"Cost in Million USD","formatter":{"id":"3555"},"major_label_policy":{"id":"3554"},"ticker":{"id":"3526"}},"id":"3525","type":"LinearAxis"},{"attributes":{},"id":"3554","type":"AllLabels"},{"attributes":{"data_source":{"id":"3511"},"glyph":{"id":"3579"},"hover_glyph":null,"muted_glyph":null,"nonselection_glyph":{"id":"3580"},"view":{"id":"3582"}},"id":"3581","type":"GlyphRenderer"},{"attributes":{},"id":"3557","type":"Selection"},{"attributes":{},"id":"3526","type":"BasicTicker"},{"attributes":{},"id":"3555","type":"BasicTickFormatter"},{"attributes":{"label":{"value":"automation"},"renderers":[{"id":"3564"}]},"id":"3577","type":"LegendItem"},{"attributes":{"active_multi":null,"tools":[{"id":"3529"},{"id":"3530"},{"id":"3531"},{"id":"3532"},{"id":"3533"},{"id":"3534"},{"id":"3605"}]},"id":"3536","type":"Toolbar"},{"attributes":{},"id":"3530","type":"WheelZoomTool"},{"attributes":{},"id":"3529","type":"PanTool"},{"attributes":{"overlay":{"id":"3535"}},"id":"3531","type":"BoxZoomTool"},{"attributes":{"end":500,"js_property_callbacks":{"change:value":[{"id":"3604"}]},"start":0.1,"step":0.1,"title":"Manpower: Full Time Equivalent AFTER automation","value":10},"id":"3603","type":"Slider"},{"attributes":{"line_alpha":0.1,"line_color":"blue","line_width":3,"x":{"field":"x"},"y":{"field":"z"}},"id":"3563","type":"Line"},{"attributes":{},"id":"3532","type":"SaveTool"},{"attributes":{},"id":"3533","type":"ResetTool"},{"attributes":{"line_alpha":0.1,"line_color":"red","line_width":3,"x":{"field":"x"},"y":{"field":"y"}},"id":"3545","type":"Line"},{"attributes":{"line_alpha":0.6,"line_color":"blue","line_width":3,"x":{"field":"x"},"y":{"field":"z"}},"id":"3562","type":"Line"},{"attributes":{},"id":"3556","type":"UnionRenderers"},{"attributes":{"source":{"id":"3511"}},"id":"3565","type":"CDSView"},{"attributes":{"end":1.2,"js_property_callbacks":{"change:value":[{"id":"3604"}]},"start":0.8,"step":0.001,"title":"Cost of capital allocation","value":1.02},"id":"3602","type":"Slider"},{"attributes":{"children":[{"id":"3512"},{"id":"3607"}]},"id":"3608","type":"Row"},{"attributes":{"label":{"value":"status quo"},"renderers":[{"id":"3546"}]},"id":"3560","type":"LegendItem"},{"attributes":{"items":[{"id":"3560"},{"id":"3577"},{"id":"3594"}]},"id":"3559","type":"Legend"},{"attributes":{"end":500,"js_property_callbacks":{"change:value":[{"id":"3604"}]},"start":0.1,"step":0.1,"title":"Manpower: Full Time Equivalent BEFORE automation","value":100},"id":"3600","type":"Slider"},{"attributes":{"align":"center","text":"ROI calculator","text_font_size":"15px"},"id":"3548","type":"Title"},{"attributes":{"end":40,"js_property_callbacks":{"change:value":[{"id":"3604"}]},"start":0.1,"step":0.01,"title":"Labour cost per hour (USD)","value":15},"id":"3598","type":"Slider"}],"root_ids":["3608"]},"title":"Bokeh Application","version":"2.3.2"}}';
var render_items = [{"docid":"4a587686-cdad-4b08-b3d3-9fb85505286b","root_ids":["3608"],"roots":{"3608":"aa0d9506-d27a-4094-89e9-629b9e61e6fc"}}];
root.Bokeh.embed.embed_items(docs_json, render_items);
}
if (root.Bokeh !== undefined) {
embed_document(root);
} else {
var attempts = 0;
var timer = setInterval(function(root) {
if (root.Bokeh !== undefined) {
clearInterval(timer);
embed_document(root);
} else {
attempts++;
if (attempts > 100) {
clearInterval(timer);
console.log("Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing");
}
}
}, 10, root)
}
})(window);
});
};
if (document.readyState != "loading") fn();
else document.addEventListener("DOMContentLoaded", fn);
})();