Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let view (model:Model) dispatch =
- div []
- [ input [ unbox ("type", "file")
- unbox ("name", "files")
- OnChange (fun f -> (* Fable.Import.Browser.console.log f.target?files *)
- let reader = Fable.Import.Browser.FileReader.Create()
- reader?onload <- (fun e -> dispatch (OpenFile e?target?result;) )
- reader.readAsText (f.target?files?item 0.)
- )
- ]
- div [] [ str (string (List.length model.taggedExpenses) + ( string model.status ) ) ]
- model.tags |> List.map (fun t -> option [] [str t] ) |> select [ ]
- model.notes |> List.map (fun t -> option [] [str t] ) |> select [ ]
- div [ unbox ("id","mychart") ] []
- // Adding this match causes an error about the first input above (in addition of other similar errors):
- // The result of this expression has type 'Fable.Import.React.ReactElement' and is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'.
- match model.displayCharts with
- | true ->
- let notesExpenses = model.taggedExpenses
- |> List.groupBy (fun e -> e.Note)
- |> Expenses.computeExpensesSummaries
- (* retain only notes with required minimal occurences*)
- let notesDisplayed = notesExpenses
- |> List.filter (fun (_, {Count = count; }) -> count >= 3)
- |> List.sortBy (fun (_, {Total = v;}) -> -v)
- let barChart = Expenses.expensesGroupBarGraph notesDisplayed
- R.mountById "mychart" <| barChart()
- |false -> div [] []
- ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement