Where do we start?

User avatar
bo_knows
Site Admin
Posts: 660
Joined: Fri Jun 28, 2013 4:33 pm

Re: Where do we start?

Postby bo_knows » Tue Dec 16, 2014 7:30 pm

britgamer wrote:I like the sound of all the data being in JSON. As well as simplifying the dev environment it may also allow the code base to be refactored into a library + a UI. That way it could be used as part of other projects.

Saving past simulations in cookies/localstorage also sounds like a neat solution. We may need to warn users of the limitations of saving this way so they don't think it's saved like the old site.

I do disagree about not using some kind of framework. I've seen forms far simpler than this become a mess without an MVVM library. Perhaps Angular is too heavy (but it was the quickest I have used to get 2 way binding to a form) but there are plenty of others out there


The only reason I would be against using Angular, is because I personally know nothing about it. If there is an angular wizard out there that wants to design a UI, and let me focus on getting the backend calculations working as intended, I'd be all for it.

For now, I'm personally going to work on that aspect, and hope that other things fall in place from other contributors :)
-Bo (Creator and Admin for cFIREsim)

britgamer
Posts: 7
Joined: Tue Dec 16, 2014 2:59 pm

Re: Where do we start?

Postby britgamer » Tue Dec 16, 2014 7:41 pm

bo_knows wrote:
britgamer wrote:I like the sound of all the data being in JSON. As well as simplifying the dev environment it may also allow the code base to be refactored into a library + a UI. That way it could be used as part of other projects.

Saving past simulations in cookies/localstorage also sounds like a neat solution. We may need to warn users of the limitations of saving this way so they don't think it's saved like the old site.

I do disagree about not using some kind of framework. I've seen forms far simpler than this become a mess without an MVVM library. Perhaps Angular is too heavy (but it was the quickest I have used to get 2 way binding to a form) but there are plenty of others out there


The only reason I would be against using Angular, is because I personally know nothing about it. If there is an angular wizard out there that wants to design a UI, and let me focus on getting the backend calculations working as intended, I'd be all for it.

For now, I'm personally going to work on that aspect, and hope that other things fall in place from other contributors :)


Well I'm no wizard myself but I've used it for simple 2 way binding before and it was very simple to get going.

I've actually started on the UI, replicating the old one in Angular. It's been going well so far and hopefully I'll have something to properly contribute by the end of the week.

User avatar
bo_knows
Site Admin
Posts: 660
Joined: Fri Jun 28, 2013 4:33 pm

Re: Where do we start?

Postby bo_knows » Tue Dec 16, 2014 7:44 pm

britgamer wrote:
bo_knows wrote:
britgamer wrote:I like the sound of all the data being in JSON. As well as simplifying the dev environment it may also allow the code base to be refactored into a library + a UI. That way it could be used as part of other projects.

Saving past simulations in cookies/localstorage also sounds like a neat solution. We may need to warn users of the limitations of saving this way so they don't think it's saved like the old site.

I do disagree about not using some kind of framework. I've seen forms far simpler than this become a mess without an MVVM library. Perhaps Angular is too heavy (but it was the quickest I have used to get 2 way binding to a form) but there are plenty of others out there


The only reason I would be against using Angular, is because I personally know nothing about it. If there is an angular wizard out there that wants to design a UI, and let me focus on getting the backend calculations working as intended, I'd be all for it.

For now, I'm personally going to work on that aspect, and hope that other things fall in place from other contributors :)


Well I'm no wizard myself but I've used it for simple 2 way binding before and it was very simple to get going.

I've actually started on the UI, replicating the old one in Angular. It's been going well so far and hopefully I'll have something to properly contribute by the end of the week.


That's awesome. As I said, the UI gave me the most headaches... and as you mentioned above with large forms without a framework... it IS a giant mess. Especially for all the rules for when things are shown based on dropdowns/etc.
-Bo (Creator and Admin for cFIREsim)

britgamer
Posts: 7
Joined: Tue Dec 16, 2014 2:59 pm

Re: Where do we start?

Postby britgamer » Tue Dec 16, 2014 7:51 pm

Well I haven't started on the Spending Plan panel yet. That one may be interesting ;)

pmallory
Posts: 4
Joined: Fri Dec 19, 2014 4:41 am

Re: Where do we start?

Postby pmallory » Fri Dec 19, 2014 5:05 am

Maybe I should have read this thread before diving in... Anyhow I just submitted a pull request that simplifies Jeff's JSONinifcation (imho), details are in the pull request.

What's the plan going forward? Since there's a crowd of us I think it'd be worth it to write a design document that includes all the features we want and the formulas involved so that we can divvy up the work.

User avatar
bo_knows
Site Admin
Posts: 660
Joined: Fri Jun 28, 2013 4:33 pm

Re: Where do we start?

Postby bo_knows » Mon Dec 22, 2014 1:56 pm

pmallory wrote:Maybe I should have read this thread before diving in... Anyhow I just submitted a pull request that simplifies Jeff's JSONinifcation (imho), details are in the pull request.

What's the plan going forward? Since there's a crowd of us I think it'd be worth it to write a design document that includes all the features we want and the formulas involved so that we can divvy up the work.


I agree. I'll work up a SDD. This was probably a poor choice of the time of year to start a project like this. I know that I'm going to have very limited time to work on this for the rest of the year due to holidays and travel.

I think the general order that things need to be accomplished is:

- Basic iteration - Show that you can divide the total years of data into X "cycles" based on the length of retirement stated in the form data.
- Basic yearly calculations - Show that for each cycle you can:
  • Calculate inflation-adjusted spending
  • Subtract inflation-adjusted spending from portfolio amount
  • Calculate Market gains for the year, based on asset allocation and portfolio amount
  • Calculate fees based on total portfolio and fees amount listed in form data
  • Sum up Market Gains, Spending, and fees
  • Record results into the simulation object
- Add in the capability for the basic yearly calculations to take into consideration any "Extra Savings/Income" objects (Pensions, SS, savings, income) from the form data. Be sure that these are recorded separately in the results.
- Add in the capability for the basic yearly calculations to take into consideration any "Extra Spending" objects from the form data. Be sure that these are recorded separately in the results.
- Add in spending plans/methods (this will absolutely need to be split up, and I will release the crappy PHP code that I have that currently runs this, for reference)
-Bo (Creator and Admin for cFIREsim)

britgamer
Posts: 7
Joined: Tue Dec 16, 2014 2:59 pm

Re: Where do we start?

Postby britgamer » Tue Dec 23, 2014 7:31 pm

I've just made a pull request for the initial Angular UI I've been working on.

It all seems to bind OK and the inputs which should only be enabled at certain points are hidden/disabled/cleared at the right time.

I did have to make assumptions about the names of the properties some of the inputs should bind to. If they need changing most should just be in the HTML and the initial object. Some in the grids made need altering in the JavaScript as well but there isn't too much of it.

Short term the HTML needs tweaking so it looks better on very small or very large screens (I've been working at 1080P) and some styling could be done beyond the default bootstrap styles.

I think validation would be nice to add later, once the backend has been done and the requirements for it are known.

I think it may also suit a more wizard style of UI. Most of the HTML should be reusable for that. The panels should just need tweaking and then shown/hidden at the right points.

pmallory
Posts: 4
Joined: Fri Dec 19, 2014 4:41 am

Re: Where do we start?

Postby pmallory » Wed Dec 24, 2014 1:34 am

Nifty! I don't know much about Angular but this seems easy to work with. For fellow Angular novices, skip to line 992, that looks like he obvious place to tie this into the stuff we've got going on in cFIREsimOpen.js
britgamer wrote:I did have to make assumptions about the names of the properties some of the inputs should bind to.

Looks good to me, it corresponds to the existing data structure. For reference this is what Angular form makes: https://gist.github.com/pmallory/cbb7a2d89aa00f0072f4

Other UI ideas:
-It'd be bad ass if the chart was on the same page as the form and was bound to it so that the chart could redraw itself as the user changed their inputs around. The simulation might run fast enough for that to be possible. I guess we should just get it working first :P
-Save/Load settings widget

britgamer
Posts: 7
Joined: Tue Dec 16, 2014 2:59 pm

Re: Where do we start?

Postby britgamer » Wed Dec 24, 2014 9:07 am

pmallory wrote:Other UI ideas:
-It'd be bad ass if the chart was on the same page as the form and was bound to it so that the chart could redraw itself as the user changed their inputs around. The simulation might run fast enough for that to be possible. I guess we should just get it working first :P
-Save/Load settings widget


I like both of those ideas. I've heard D3 is very good for creating charts in JavaScript but I don't know what creates the current chart which looks very nice.

Does anyone have any experience with testing in JavaScript? On the pull request kevcenteno rightly pointed out that the UI should have tests. I've heard of Jasmine but have never used it and I don't know if there is anything else out there.

jeff
Posts: 22
Joined: Sun Nov 03, 2013 9:57 pm

Re: Where do we start?

Postby jeff » Wed Dec 24, 2014 2:01 pm

I don't have any experience with JS testing specifically, but I looked into Jasmine after Bo mentioned it in his first post and it looks reasonable to me. I don't know if we have any Ruby programmers on here but its big selling point is its similarity to RSpec. It's also client-side rather than server-side so new devs won't have to worry about setting up node.js just to contribute a patch.

See here for a comparison of some JS testing frameworks, and here for an intro to Jasmine. It looks like some of the other frameworks (Karma) can even use the Jasmine syntax if we want to switch over later.

If nobody has any deep JS testing experience, I'd vote that we start using Jasmine.


Return to “cFIREsim Open Source Project”

Who is online

Users browsing this forum: No registered users and 1 guest