mortgage_calc.html 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822
  1. <html>
  2. <head>
  3. <meta charset="utf8">
  4. <link rel="stylesheet" type="text/css" href="http://cdnjs.cloudflare.com/ajax/libs/metrics-graphics/2.4.0/metricsgraphics.min.css" />
  5. <link rel="stylesheet" type="text/css" href="./bada55.css" />
  6. <link rel="stylesheet" type="text/css" href="./style.css" />
  7. <style>
  8. body {
  9. padding: 10px;
  10. margin: 0px;
  11. font-family: 'Sans Serif';
  12. /* width: 100% !important; */
  13. }
  14. th {
  15. color: #222222;
  16. background-color: #7a9a15;
  17. }
  18. td, th {
  19. border: 1px solid #7a9a15;
  20. padding-top: 5px;
  21. padding-bottom: 5px;
  22. padding-left: 10px;
  23. padding-right: 5px;
  24. white-space: nowrap;
  25. }
  26. table {
  27. border-collapse: collapse;
  28. }
  29. td > a {
  30. color: #bada55;
  31. }
  32. td > a:visited {
  33. color: #bada55;
  34. }
  35. li {
  36. padding-bottom: 2px;
  37. }
  38. .amort_table tbody tr:nth-child(3n) {
  39. background-color: #333333;
  40. }
  41. .amort_table tbody tr:nth-child(12n) td {
  42. border-bottom-width: 4px !important;
  43. }
  44. input[type=edit] {
  45. background-color: #444444;
  46. color: #dddddd;
  47. }
  48. .amort_table {
  49. text-align: right;
  50. }
  51. .kidleft > * {
  52. float: left;
  53. }
  54. .kidleft {
  55. overflow: auto;
  56. zoom: 1;
  57. }
  58. .item {
  59. margin-bottom: 10px;
  60. }
  61. .container {
  62. padding: 10px;
  63. border: 1px solid #bada55;
  64. width: 600px;
  65. }
  66. .container-box {
  67. width: 100%;
  68. overflow: auto;
  69. zoom: 1;
  70. }
  71. .left {
  72. float: left;
  73. display: block;
  74. }
  75. .go {
  76. margin: 20px;
  77. }
  78. /* chart */
  79. .mg-x-axis text, .mg-y-axis text, .mg-histogram .axis text {
  80. fill: #fff;
  81. }
  82. .mg-markers text {
  83. fill: #fff;
  84. }
  85. text {
  86. fill: #fff;
  87. }
  88. .mg-active-datapoint {
  89. fill: #fff;
  90. }
  91. .mg-line6-color, .mg-line6-legend-color, .mg-hover-line6-color, .mg-area6-color {
  92. stroke: purple;
  93. fill: purple;
  94. }
  95. .mg-line7-color, .mg-line7-legend-color, .mg-hover-line7-color, .mg-area7-color {
  96. stroke: cyan;
  97. fill: cyan;
  98. }
  99. .mg-line8-color, .mg-line8-legend-color, .mg-hover-line8-color, .mg-area8-color {
  100. stroke: pink;
  101. fill: pink;
  102. }
  103. .mg-line9-color, .mg-line9-legend-color, .mg-hover-line9-color, .mg-area9-color {
  104. stroke: lime;
  105. fill: lime;
  106. }
  107. </style>
  108. <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
  109. <script src="http://cdnjs.cloudflare.com/ajax/libs/floatthead/1.2.10/jquery.floatThead.min.js"></script>
  110. <script src="http://cdnjs.cloudflare.com/ajax/libs/moment.js/2.1.0/moment.min.js"></script>
  111. <script src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js"></script>
  112. <script src="http://cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.0.0/handlebars.min.js"></script>
  113. <script src="http://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script>
  114. <script src="http://cdnjs.cloudflare.com/ajax/libs/metrics-graphics/2.4.0/metricsgraphics.js"></script>
  115. <script src="lib.js"></script>
  116. <script src="calc.js"></script>
  117. <script src="footnotes.js"></script>
  118. <script>
  119. function min(a,b) { return a < b ? a : b };
  120. function max(a,b) { return a >= b ? a : b };
  121. var nextID = 1;
  122. var HB = {};
  123. Handlebars.registerHelper('df', function(d, fmtStr) {
  124. if(typeof d == 'undefined' || d == null) {
  125. return 'Unknown';
  126. }
  127. var fs = typeof fmtStr == "string" ? fmtStr : "YYYY-MM-DD";
  128. return moment(d).format(fs);
  129. });
  130. Handlebars.registerHelper('$', function(n) {
  131. return parseFloat(n).toMoney()
  132. });
  133. $(function() {
  134. $('script[type="x-application/handlebars"]').each(function() {
  135. HB[$(this).attr('name')] = Handlebars.compile($(this).html());
  136. });
  137. });
  138. $(function() {
  139. $('.editor [json]').val(''); // fuck you firefox
  140. $('.editor [json="date"]').val(moment().format('YYYY-MM-DD'));
  141. })
  142. Number.prototype.toMoney = function() {
  143. // return this;
  144. var str = (this.toFixed(2)+'').toString();
  145. var x = 3 - str.length;
  146. if(x > 0) {
  147. str = (x > 1 ? '00' : '0') + str ;
  148. }
  149. return str.replace(/\B(\d\d)$/, '.$1').replace(/\B(?=(\d{3})+(?!\d))/g, ",");
  150. };
  151. </script>
  152. <script>
  153. //var mon_interest = ARP / 12; // only works for /APR/, not "annual interest rate"
  154. function makeRow() {
  155. return $('<tr>' + Array.prototype.slice.apply(arguments).map(function(x) { return '<td>' + (x.toMoney && x.toMoney() || x) + '</td>' }).join(' ') + '</tr>');
  156. }
  157. function prettyPeriod(n) {
  158. var y = Math.floor(n / 12);
  159. var mons = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun','Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
  160. var m = mons[n % 12];
  161. return m + ', ' + y;
  162. }
  163. function whyIsntThisBuiltIn(qstr) {
  164. return _.object(qstr.split('&').map(function(c) {
  165. return c.split('=').map(decodeURIComponent);
  166. }));
  167. }
  168. // initialize any values given in the url
  169. $(function(){
  170. var d = _.mapObject(whyIsntThisBuiltIn(window.location.hash.replace(/^#/, '')), parseFloat);
  171. for(var k in d) {
  172. $('[data-json="'+k+'"]').val(d[k]);
  173. }
  174. });
  175. // 2015
  176. // var taxBrackets = {
  177. // single: {
  178. /*
  179. 9225: 10,
  180. 15 9226
  181. 25 37451
  182. 28 90751
  183. 33 189301
  184. 35 411501
  185. 39.6 413201
  186. 10% Up to $18,450
  187. 15% $18,451 to $74,900
  188. 25% $74,901 to $151,200
  189. 28% $151,201 to $230,450
  190. 33% $230,451 to $411,500
  191. 35% $411,501 to $464,850
  192. 39.6% $464,851 or more
  193. 10% Up to $9,225
  194. 15% 9,226 to $37,450
  195. 25% $37,451 to $75,600
  196. 28% $75,601 to $115,225
  197. 33% $115,226 to $205,750
  198. 35% $205,751 to $232,425
  199. 39.6% $232,426 or more
  200. 10% Up to $13,150
  201. 15% $13,151 to $50,200
  202. 25% $50,201 to $129,600
  203. 28% $129,601 to $209,850
  204. 33% $209,851 to $411,500
  205. 35% $411,501 to $439,000
  206. 39.6% $439,001 or more
  207. */
  208. /*
  209. ROIC
  210. income tax deductions
  211. price/sqft
  212. warning about roof replacement
  213. total liability
  214. total appreciation - total maintenance
  215. rental income
  216. "other" monthly/yearly costs
  217. */
  218. function calcTable(parentClass) {
  219. var pn = $('.' + parentClass + '-form');
  220. var d = grabData($('.' + parentClass + '-form'));
  221. console.log(d);
  222. window.location.hash = $.param(d);
  223. //
  224. // var app_rate = 0;
  225. // var app_or_resell = pn.find('[name="apporsales"]:checked').val();
  226. // if(app_or_resell == 'app') {
  227. // app_rate = parseFloat(pn.find('[data-json="app_rate"] input[type="edit"]').val()) * .01;
  228. // }
  229. // else {
  230. // var resell_price = parseFloat(pn.find('[data-json="resell_price"]').val());
  231. // var resell_months = parseFloat(pn.find('[data-json="resell_months"]').val());
  232. // var resell_closing_costs = parseFloat(pn.find('[data-json="resell_closing_costs"]').val());
  233. // var resell_profit = resell_price - sales_price - resell_closing_costs;
  234. // app_rate = .01 * (resell_profit / 12 / 12 / resell_months); // BUG: needs to be compound with respect to sales_price
  235. // }
  236. //
  237. var mc = mortgage_calc(d);
  238. var data = mc.time_series;
  239. // nominal dollars
  240. var table = $('.' + parentClass + '.amort_table.nominal tbody');
  241. table.html('');
  242. for(var i = 0; i < d.loan_term * 12; i++) {
  243. table.append(makeRow(
  244. prettyPeriod(data.period[i]),
  245. data.loan_balance[i],
  246. // ltv
  247. data.pmi[i],
  248. data.insurance[i],
  249. data.payment[i],
  250. data.interest[i],
  251. data.principle[i],
  252. data.house_value[i],
  253. data.appreciation[i],
  254. data.acc_appreciation[i],
  255. data.overhead[i],
  256. data.net_gain[i]
  257. ));
  258. }
  259. // real dollars
  260. table = $('.' + parentClass + '.amort_table.real tbody');
  261. table.html('');
  262. for(var i = 0; i < d.loan_term * 12; i++) {
  263. table.append(makeRow(
  264. prettyPeriod(data.period[i]),
  265. data.inf_loan_balance[i],
  266. // ltv
  267. data.inf_pmi[i],
  268. data.inf_insurance[i],
  269. data.inf_payment[i],
  270. data.inf_interest[i],
  271. data.inf_principle[i],
  272. data.inf_house_value[i],
  273. data.inf_appreciation[i],
  274. data.inf_acc_appreciation[i],
  275. data.inf_overhead[i],
  276. data.inf_net_gain[i]
  277. ));
  278. }
  279. $('.pie-chart').html('');
  280. mkChart('.pie-chart', "Monthly Cash Flow, Nominal Dollars", [
  281. ['Principle', data.principle],
  282. ['Interest', data.interest],
  283. ['Appreciation', data.appreciation],
  284. //['Direct Costs', data.direct_costs],
  285. //['Overhead', data.overhead],
  286. ['Total Costs', data.total_costs],
  287. ]);
  288. $('.infpie-chart').html('');
  289. mkChart('.infpie-chart', "Monthly Cash Flow, Inflation Adjusted", [
  290. ['Principle', data.inf_principle],
  291. ['Interest', data.inf_interest],
  292. ['Appreciation', data.inf_appreciation],
  293. //['Direct Costs', data.direct_costs],
  294. //['Overhead', data.overhead],
  295. ['Total Costs', data.inf_total_costs],
  296. ]);
  297. $('.loan-chart').html('');
  298. mkChart('.loan-chart', "Loan, Nominal Dollars", [
  299. ['House Value', data.house_value],
  300. //['Appreciation', data.acc_appreciation],
  301. ['Equity', data.equity],
  302. //['Direct Costs', data.acc_direct_costs],
  303. ['Loan Balance', data.loan_balance],
  304. ['Interest Paid', data.acc_interest],
  305. ]);
  306. $('.infloan-chart').html('');
  307. mkChart('.infloan-chart', "Loan, Inflation Adjusted", [
  308. ['House Value', data.inf_house_value],
  309. //['Appreciation', data.inf_acc_appreciation],
  310. ['Equity', data.inf_equity],
  311. //['Direct Costs', data.inf_acc_direct_costs],
  312. ['Loan Balance', data.inf_loan_balance],
  313. ['Interest Paid', data.inf_acc_interest],
  314. ]);
  315. $('.hae-chart').html('');
  316. mkChart('.hae-chart', "Capital, Nominal Dollars", [
  317. ['House Value', data.house_value],
  318. //['Appreciation', data.acc_appreciation],
  319. ['Equity', data.equity],
  320. //['Direct Costs', data.acc_direct_costs],
  321. ['Cash Outlay', data.cash_spent],
  322. //['Loan Balance', data.loan_balance],
  323. ['Net Gain', data.net_gain],
  324. //['Interest Paid', data.acc_interest],
  325. ['Ref @ ' + (d.reference_rate*100) + '%', data.reference_line],
  326. ]);
  327. $('.infcap-chart').html('');
  328. mkChart('.infcap-chart', "Capital, Inflation Adjusted", [
  329. //['Appreciation', data.inf_acc_appreciation],
  330. ['Equity', data.inf_equity],
  331. //['Direct Costs', data.inf_acc_direct_costs],
  332. ['Cash Outlay', data.inf_cash_spent],
  333. ['Net Gain', data.inf_net_gain],
  334. ['Gross Gain', data.inf_gross_gain],
  335. ['Ref @ ' + (d.reference_rate*100) + '%', data.inf_reference_line],
  336. ]);
  337. return;
  338. };
  339. $(function() {
  340. $('.go').click(function(e) {
  341. e.preventDefault();
  342. calcTable('mortgage');
  343. // calcAppartment('appartment');
  344. });
  345. $('[name="apporsales"]').click(function(e) {
  346. var app_or_resell = $('[name="apporsales"]:checked').val();
  347. if(app_or_resell == 'app') {
  348. $('[data-json="app_rate"] input[type="edit"]').removeAttr('disabled');
  349. $('[data-json="resell_price"]').attr('disabled','disabled');
  350. $('[data-json="resell_months"]').attr('disabled','disabled');
  351. $('[data-json="resell_closing_costs"]').attr('disabled','disabled');
  352. }
  353. else {
  354. $('[data-json="app_rate"] input[type="edit"]').attr('disabled','disabled');
  355. $('[data-json="resell_price"]').removeAttr('disabled');
  356. $('[data-json="resell_months"]').removeAttr('disabled');
  357. $('[data-json="resell_closing_costs"]').removeAttr('disabled');
  358. }
  359. });
  360. // fill in the chart options
  361. var chart_options = [
  362. {n: 'pmi', l: 'PMI', tt: 'Private Mortgage Insurance. Required for loans with less than 20% equity.' },
  363. {n: 'payment', l: 'Payment' },
  364. {n: 'interest', l: 'Interest' },
  365. {n: 'principle', l: 'Principle'},
  366. {n: 'insurance', l: 'Homeowner\'s Insurance'},
  367. {n: 'house_value', l: 'House Value'},
  368. {n: 'appreciation', l: 'Appreciation (monthly)'},
  369. {n: 'loan_balance', l: 'Loan Balance'},
  370. {n: 'equity', l: 'Equity'},
  371. {n: 'overhead', l: 'Overhead'},
  372. {n: 'cash_spent', l: 'Cash Spent'},
  373. {n: 'gross_gain', l: 'Gross Gain'},
  374. {n: 'net_gain', l: 'Net Gain'},
  375. {n: 'reference_line', l: 'Reference Line'},
  376. {n: 'total_costs', l: 'Total Costs'},
  377. {n: '', l: ''},
  378. ];
  379. /*
  380. $('.chart-options').html('').append(chart_options.map(function(co) {
  381. if(co.n == '') return '';
  382. return $('<div><input type="checkbox" name="'+co.n+'" /><label>'+co.l+'</label></div>');
  383. }));
  384. */
  385. //$('.amort_table').floatThead({useAbsolutePositioning: false});
  386. });
  387. </script>
  388. </head>
  389. <body>
  390. <h2>No data is sent to a server. All information is private to your browser and the url string.</h2>
  391. <div class="tab-group mortgage-form">
  392. <div title="Mortgage" class="container-box tab active">
  393. <scalar name="apr" default="4.99" type="percent">Loan APR</scalar>
  394. <scalar name="purchase_price" default="250000" type="dollars">Purchase Price</scalar>
  395. <scalar name="loan_amount" default="220000" type="dollars">Loan Amount</scalar>
  396. <scalar name="loan_term" default="30" type="time">Loan Term</scalar>
  397. <scalar name="closing_costs" default="15000" type="dollars">Closing Costs</scalar>
  398. <scalar name="pmi_rate" default="0.52" type="percent">Mortgage Insurance Rate</scalar>
  399. <radio name="appreciation_mode" title="Appreciation">
  400. <opt title="Estimate Rate" value="rate" default="true">
  401. <scalar name="app_rate" default="6" type="percent">Appreciation Rate</scalar>
  402. </opt>
  403. <opt title="Calculate Actual" value="actual">
  404. <scalar name="resell_price" default="280000" type="dollars">Resale Price</scalar>
  405. <scalar name="resell_months" default="24" type="time">Months After Purchase</scalar>
  406. <scalar name="resell_closing_costs" default="0" type="dollars">Resell Closing Costs</scalar>
  407. </opt>
  408. </radio>
  409. <scalar name="house_area" type="number" default="2000">Living Area, in Square Feet</scalar>
  410. <choose name="rooftype" type="roof_types">Roof Type</choose>
  411. <scalar name="roof_age" type="number" default="10">Roof Age, in Years</scalar>
  412. <scalar name="maint_yearly" default="1200" type="dollars">Yearly Maintenance Cost (Not including monthy costs)</scalar>
  413. <scalar name="maint_monthly" default="120" type="dollars">Monthly Maintenance Cost (Not including yearly costs)</scalar>
  414. <scalar name="bills_monthly" default="300" type="dollars">
  415. Monthly Electric and Utilities (All house-related bills, not including maintenance above)
  416. </scalar>
  417. <scalar name="other_fees_monthly" default="" type="dollars">
  418. Other Monthly Fees Not Included Above (HOA Fees, Clubhouse Membership, etc.)
  419. </scalar>
  420. <scalar name="commute_costs" default="200" type="dollars">
  421. Monthly Commute Cost (Gas or Transit Passes)
  422. </scalar>
  423. <scalar name="monthly_rental_income" default="" type="dollars">
  424. Net Rental Income, Monthly
  425. </scalar>
  426. <scalar name="reference_rate" default="11" type="percent">
  427. Reference Line APR
  428. <footnote>
  429. Investment of the <b>downpayment</b> at the specified rate
  430. over the same time period
  431. </footnote>
  432. </scalar>
  433. <scalar name="property_tax_rate" default="1.2" type="percent">
  434. Annual Property Tax Rate
  435. </scalar>
  436. <button class="next-tab">Next</button>
  437. </div>
  438. <div title="Apartment" class="container-box appartment-form tab" style="display:none;">
  439. <h3>The cheapest acceptable apartment as an alternative.</h3>
  440. <scalar name="monthly_rent" default="700" type="dollars">Monthly Rent</scalar>
  441. <scalar name="ref_deposit" default="700" type="dollars">Refundable Deposit</scalar>
  442. <scalar name="non_ref_fees" default="100" type="dollars">Non-refundable Deposit &amp; Fees</scalar>
  443. <scalar name="ri_amount" default="0" type="dollars">
  444. Monthly Renter's Insurance Amount
  445. </scalar>
  446. <scalar name="bills_monthly" default="150" type="dollars">
  447. Monthly Electric and Utilities
  448. </scalar>
  449. <scalar name="other_fees_monthly" default="" type="dollars">
  450. Other Monthly Fees Not Included Above (Parking, etc.)
  451. </scalar>
  452. <scalar name="commute_costs" default="100" type="dollars">
  453. Monthly Commute Cost (Gas or Transit Passes)
  454. </scalar>
  455. <button class="next-tab">Next</button>
  456. </div>
  457. <div title="General" class="container-box appartment-form tab" style="display:none;">
  458. <scalar name="inflation_rate" default="6" type="percent">
  459. Inflation Rate <footnote>In the long term on the grand scale, appreciation
  460. cannot be higher than inflation.</footnote>
  461. </scalar>
  462. <scalar name="monthly_savings" default="500" type="dollars">
  463. Net monthly income <b>except</b> housing costs
  464. <footnote>
  465. This is how much your bank account would grow every month, except housing
  466. related costs, if you didn't buy anything you didn't absolutely need.
  467. </footnote>
  468. </scalar>
  469. <button class="go">Calculate!</button>
  470. </div>
  471. </div>
  472. <br><br>
  473. <!--
  474. <fieldset>
  475. <legend>Roof</legend>
  476. <label>Age (years)</label>
  477. <input data-json="roof_age" type="edit" value="5" />
  478. <label>Type</label>
  479. <select data-json="roof_type">
  480. <option value="asphalt_shingle" selected>Asphalt Shingle</option>
  481. <option value="rolled_asphalt">Tar/Rolled Asphalt (flat roofs only)</option>
  482. <option value="metal">Metal</option>
  483. <option value="tile">Tile, Slate, or Clay</option>
  484. <option value="wood_shingle">Wood Shingle</option>
  485. </select>
  486. <label>Pitch</label>
  487. <select data-json="roof_pitch">
  488. <option value="flat">Flat</option>
  489. <option value="2_12">Not very steep at all</option>
  490. <option value="4_12" selected>Fairly average</option>
  491. <option value="6_10">Rather steep, about 45 degrees</option>
  492. <option value="8_12">Incredibly dangerous</option>
  493. </select>
  494. </fieldset>
  495. <fieldset>
  496. <legend>Taxes</legend>
  497. Annual Property Tax Rate
  498. <div class="item editable">
  499. <input data-json="property_tax_rate" type="edit" value="1.2" />
  500. </div>
  501. <!--
  502. Adjusted Gross Income (not including house/mortgage tax deductions): (taxable income after deductions)
  503. <div class="item editable">
  504. <input data-json="annual_taxes" type="edit" value="0" />
  505. </div>
  506. Filing Status:
  507. <div class="item editable">
  508. <select data-json="tax_filing_status">
  509. <option selected value="single">Single</option>
  510. <option value="married">Married, Filing Jointly</option>
  511. <option value="mfs">Married, Filing Separately</option>
  512. <option value="head">Head Of Household</option>
  513. </select>
  514. </div> - ->
  515. </fieldset>
  516. Monthly Income after taxes and bills, not including housing.
  517. <div class="item editable">
  518. <input data-json="monthly_income_before_housing" type="edit" value="" />
  519. </div>
  520. Cheapest monthly rent for acceptable unit in area.
  521. <div class="item editable">
  522. <input data-json="cheapest_rent" type="edit" value="" />
  523. </div>
  524. </div-->
  525. <!--div class="container appartment-form left">
  526. <h4>Appartment</h4>
  527. Monthly Rent, Including Parking, Storage and Pet Fees:
  528. <div class="item editable" data-json="rent">
  529. <input type="edit" value="1400" />
  530. </div>
  531. Refundable Deposit:
  532. <div class="item editable" data-json="ref_deposit">
  533. <input type="edit" value="600" />
  534. </div>
  535. Non-refundable Deposit / Fees:
  536. <div class="item editable" data-json="non_ref_fees">
  537. <input type="edit" value="300" />
  538. </div>
  539. Monthly Renter's Insurance Amount:
  540. <div class="item editable" data-json="ri_amount">
  541. <input type="edit" value="10" />
  542. </div>
  543. Monthly Electric and Utilities (All appartment-related bills, not including maintenance above):
  544. <div class="item editable" data-json="bills">
  545. <input type="edit" value="80" />
  546. </div>
  547. Monthly Commute Cost (Gas or Transit Passes):
  548. <div class="item editable" data-json="commute">
  549. <input type="edit" value="20" />
  550. </div>
  551. </div- ->
  552. </div-->
  553. <div class="chart-options"></div>
  554. <!-- <canvas class="pie-chart" width="600" height="300"></canvas> -->
  555. <div class="pie-chart" ></div>
  556. <hr>
  557. <div class="infpie-chart" ></div>
  558. <hr>
  559. <div class="loan-chart" ></div>
  560. <hr>
  561. <div class="infloan-chart" ></div>
  562. <hr>
  563. <div class="hae-chart" ></div>
  564. <hr>
  565. <div class="infcap-chart" ></div>
  566. <br>
  567. <br>
  568. <br>
  569. <script>
  570. $(function() { $('.table-dollar-select').change(function(e) {
  571. //console.log($(this).val())
  572. $('.amort_table.mortgage').hide();
  573. $('.amort_table.mortgage.'+$(this).val()).show();
  574. })});
  575. </script>
  576. <h2>Figures Below In <select class="table-dollar-select"><option value="nominal">Nominal</option><option value="real" selected>Inflation Adjusted</option></select> Dollars</h2>
  577. <div class="left">
  578. <table class="amort_table mortgage nominal" style="display:none;">
  579. <thead>
  580. <tr>
  581. <th>EOM</th>
  582. <th>Starting Balance</th>
  583. <th>PMI</th>
  584. <th>Insurance</th>
  585. <th>Payment</th>
  586. <th>Interest</th>
  587. <th>Principle</th>
  588. <th>House Value</th>
  589. <th>Appreciation</th>
  590. <th>Total Appr.</th>
  591. <th>Overhead</th>
  592. <th>Net Gain</th>
  593. <!--th>Total Insurance</th>
  594. <th>Appreciation</th>
  595. <th>House Value</th>
  596. <th>Equity</th>
  597. <th>Tax Savings</th>
  598. <th>Overhead</th>
  599. <th>Monthly Costs</th>
  600. <th>Accumulated Costs</th>
  601. <th>Net Gain If Sold Now</th-->
  602. </th>
  603. </thead>
  604. <tbody>
  605. </tbody>
  606. </table>
  607. <table class="amort_table mortgage real" >
  608. <thead>
  609. <tr>
  610. <th>EOM</th>
  611. <th>Starting Balance</th>
  612. <th>PMI</th>
  613. <th>Insurance</th>
  614. <th>Payment</th>
  615. <th>Interest</th>
  616. <th>Principle</th>
  617. <th>House Value</th>
  618. <th>Appreciation</th>
  619. <th>Total Appr.</th>
  620. <th>Overhead</th>
  621. <th>Net Gain</th>
  622. <!--th>Total Insurance</th>
  623. <th>Appreciation</th>
  624. <th>House Value</th>
  625. <th>Equity</th>
  626. <th>Tax Savings</th>
  627. <th>Overhead</th>
  628. <th>Monthly Costs</th>
  629. <th>Accumulated Costs</th>
  630. <th>Net Gain If Sold Now</th-->
  631. </th>
  632. </thead>
  633. <tbody>
  634. </tbody>
  635. </table>
  636. </div>
  637. <!--div class="left">
  638. <table class="amort_table appartment">
  639. <thead>
  640. <tr>
  641. <th>EOM</th>
  642. <th>Rent</th>
  643. <th>Bills</th>
  644. <th>Monthly Costs</th>
  645. <th>Total Loss</th>
  646. </tr>
  647. </thead>
  648. <tbody>
  649. </tbody>
  650. </table>
  651. </div-->
  652. </body>
  653. </html>