From mn/ifi/inf5750
Revision as of 14:34, 19 November 2017 by (talk | contribs) (Requirements: Added "Cahnges to original requirements" section)

Jump to: navigation, search

Group members

Mikkel Bakken

Ingvild Larsen

Carl Petter Boehlke

Kristian Pedersen


Stock Level Visualisations



The application shall have two modes:

- Estimates, showing estimated months left of a selected stock, for chosen organization units.

- Time trend, showing time trend of stock for a single organization unit.

Functional requirements

The user can choose between the two modes described above.


- Default min/max boundaries can be set by an administrator (administrator view in mockup).

- The user can specify their own desired min/max boundaries as well (user view in mockups).

- If the administrator has not set a default min/max boundary, there is no default min/max boundary in the plot.

For "Estimates":

- The user can specify one stock type, and multiple organization units.

- Show current estimates as columns in a column diagram.

- Columns outside the specified min/max boundaries will be highlighted.

- Estimates are calculated based on average consumption over the last 3 months, and current stock levels ((current stock) / (average consumption) = estimated months left).

- Default min/max boundaries are shared by all organization units.

For "Time trend":

- The user can select an organization unit, and a stock type.

- Show time trend(months) of available stock as a graph.

- The min/max boundaries are shown as lines in the graph.

- The user can choose the time period they wish to see the time trend for (by default the last 6 months).

- Default min/max boundaries are associated with a specific organization unit and stock type.


Changes from the initial requirements:

- Administrator has two min/max inputs, one for each mode.

- The administrator can create and save queries.

- The user can pick queries created by an administrator to generate plots quickly.

- The query options used by the administrator is also accessible to the user, but hidden behind a "Show advanced options" button.

- "Stock usage" and "Stock availability" are selected separately through separate dropdown menus. "Stock usage" is not used for the "timetrend"-mode.

- The administrator can delete old query presets.

- The administrator can see a preview of the results of their query before saving it.

- The "estimates"-mode has a "from"-date. The average use is calculated based on the period from the chosen date up to the current date.

- Show a tutorial for how to use the app when it is started.


We have chosen React, because of the view focused framework. We also feel that the group as a whole has more experience with React.

- Highcharts


We want others to be able to freely use our code if they want to. Since none of the components we are using force us to use anything more restrictive we think a open MIT license seems like a good choice of license for this project.

This MIT license states that anyone is free to reuse our code, but that we are not liable for faults or required to support the code. It is not copyleft, meaning it does not force projects using the code to also be open source. For the full license look in out GitHub repository.


Milestone Goal Date Completed Comment
1 Wiki page ready November 1st October 27th Will be improved more as the project evolves
2 Start of coding October 31st October 27th
3 Prototype ready November 7th November 3rd
4 App ready for use November 20th

Division of labour


  • Mode selector component
  • Input min/max (user&admin) component
  • UserInput component
  • Availability/Used selector


  • Visualizer
  • AdminMode + namespace database calls
  • Communication between panels


  • Search org unit
  • Stock selector (and fetch from database)
  • API-calls


  • Select to/from
  • Stock selector
  • FrontEnd
  • Gather adminpanel input

See our Github page for more information about each task.


- Select mode (ModeSelector)

Estimates (Estimates):


- Search for organization units (MultipleOrgSearch)

- Search field (OrgSearch)

- Selected orgs list (OrgList)

- Input min/max boundary (UserBoundaryInput)

- Min (InputNumber)

- Max (InputNumber)

- Select stock (StockSelector)

- Showbutton (Showbutton)

- Admin box (AdminBox)

- Input min/max boundary (AdminBoundaryInput)

- OK button (OK)


- Diagram (EstimateDiagram)

Time trend (TimeTrend):


- Search for organization unit (SingleOrgSearch)

- Search field (OrgSearch)

- Input min/max boundary (UserBoundaryInput)

- Min (InputNumber)

- Max (InputNumber)

- Select stock (StockSelector)

- Select period (PeriodSelector)

- From (SelectDate)

- To (SelectDate)

- Showbutton (Showbutton)

- Admin box (AdminBox)

- Input min/max boundary (AdminBoundaryInput)

- OK button (OK)


- Time trend (TimeTrendGraph)


- Stock level retriever (StockFetcher)

- Estimate calculator (EstimateCalculator)