Skip to content

Commit

Permalink
Merge pull request #8 from kendricktan/dev
Browse files Browse the repository at this point in the history
Bug fixes
  • Loading branch information
kendricktan authored Aug 30, 2018
2 parents d19b12d + d3904d9 commit b27485a
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 13 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ $ assets:stocks and not assets:crypto

# Releases

### 0.1.6a (2018/08/30)
- Fixed growth chart bug
- Asset is 0 if account is referenced recently (but was referenced some time ago)

### 0.1.5a (2018/08/30)
- Added ability to pass extra arguments to ledger-cli
- Timeline
Expand Down
4 changes: 2 additions & 2 deletions frontend/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"main.css": "static/css/main.bf047be6.css",
"main.css.map": "static/css/main.bf047be6.css.map",
"main.js": "static/js/main.b9992fe0.js",
"main.js.map": "static/js/main.b9992fe0.js.map"
"main.js": "static/js/main.df46533d.js",
"main.js.map": "static/js/main.df46533d.js.map"
}
2 changes: 1 addition & 1 deletion frontend/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><link rel="manifest" href="/manifest.json"><link rel="shortcut icon" href="/favicon.ico"><title>Ledger Analytics</title><link href="/static/css/main.bf047be6.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script type="text/javascript" src="/static/js/main.b9992fe0.js"></script></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><link rel="manifest" href="/manifest.json"><link rel="shortcut icon" href="/favicon.ico"><title>Ledger Analytics</title><link href="/static/css/main.bf047be6.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script type="text/javascript" src="/static/js/main.df46533d.js"></script></body></html>
2 changes: 1 addition & 1 deletion frontend/service-worker.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ledger-analytics",
"version": "0.1.5a",
"version": "0.1.6a",
"dependencies": {
"commander": "^2.17.1",
"cors": "^2.8.4",
Expand Down
19 changes: 15 additions & 4 deletions src/components/charts/stacked-area.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,25 +51,36 @@ export default class StackedArea extends Component {
// Need to fill in empty dates
// Start by finding all dates
const allDates = stackedAreaData.reduce((acc, x) => {
// In-place mutation. Ugh
Object.keys(x.growth).map(k => {
acc[k] = 0
return 0
})

return acc
}, {})
const dateSorted = Object.keys(allDates).sort()

// Fill in empty dates
const stackedDataFixed = stackedAreaData.map(x => {
return Object.keys(allDates).reduce((acc, k) => {
acc[k] = x.growth[k] || allDates[k]
return dateSorted.reduce((acc, k) => {
const kSplit = k.split('/')
let year = parseInt(kSplit[0], 10)
let month = parseInt(kSplit[1], 10)
let prevMonth = month - 1

if (prevMonth <= 0) {
prevMonth = 12
year = year - 1
}

const prevK = year + '/' + (prevMonth + '').padStart(2, '0')

acc[k] = x.growth[k] || x.growth[prevK] || allDates[k]
return acc
}, {})
})

// Convert to series data
const dateSorted = Object.keys(allDates).sort()
const stackedSeriesData = stackedDataFixed.map((x, idx) => {
return {
name: stackedAreaAccounts[idx],
Expand Down

0 comments on commit b27485a

Please sign in to comment.