forked from actualbudget/actual
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Customizeable Reports (actualbudget#1791)
* Reorganize and add graphs * Create Customizable Chart * Notes * Hide Menu update Donut * lint fixes * Organize Menus * Change Title * UI changes * UI updates * Add Data Table * Functionality additions and Privacy Filters * Date filters working and formatting changes * Fix default spreadsheet and add tableGraph * Integrate Summary Data and Split Legend * started adding functionality on charts * list fix * Enabling more graphs, fixing errors * Legend, interactions, Empty Rows Filter * fixes for EmptyRows/interactions/legends * formatting UI and filtering data * format date * fix errors * Fix Legend Order * lint fixes * Add tooltips * Feature Flag * fix overview card, fix offbudget checkbox * Revamped dataType, added scrollBars * data display adjustments * data spreadsheet updates/groups added to matrix * Add Category Selector * Add Labels Button * formatting fixes * Add Averages to dataTable * data bug fix * Added all type back in with exceptions * formatting * split assets/debts, add Uncategorized * bug fixes and UI updates * add scrollbars to table * formatting dataTable * tooltips, navigation and graph labels * Code clean-up and re-org * revert color change * Change labels name * organize files * code cleanup * Tooltip Colors * Descoping legend for future PR * descope legend & rename split * rename type variable to be more descriptive * adjustments for sankey and eslint merges * notes update * code review fixes * code fixes * fix date selections
- Loading branch information
Showing
46 changed files
with
4,069 additions
and
498 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
138 changes: 138 additions & 0 deletions
138
packages/desktop-client/src/components/reports/ChooseGraph.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
import React from 'react'; | ||
|
||
import View from '../common/View'; | ||
|
||
import AreaGraph from './graphs/AreaGraph'; | ||
import BarGraph from './graphs/BarGraph'; | ||
import BarLineGraph from './graphs/BarLineGraph'; | ||
import DonutGraph from './graphs/DonutGraph'; | ||
import LineGraph from './graphs/LineGraph'; | ||
import StackedBarGraph from './graphs/StackedBarGraph'; | ||
import { ReportOptions } from './ReportOptions'; | ||
import ReportTable from './ReportTable'; | ||
import ReportTableHeader from './ReportTableHeader'; | ||
import ReportTableList from './ReportTableList'; | ||
import ReportTableTotals from './ReportTableTotals'; | ||
|
||
export function ChooseGraph({ | ||
start, | ||
end, | ||
data, | ||
mode, | ||
graphType, | ||
balanceType, | ||
groupBy, | ||
empty, | ||
scrollWidth, | ||
setScrollWidth, | ||
months, | ||
}) { | ||
function saveScrollWidth(parent, child) { | ||
let width = parent > 0 && child > 0 && parent - child; | ||
|
||
setScrollWidth(!width ? 0 : width); | ||
} | ||
|
||
if (graphType === 'AreaGraph') { | ||
return ( | ||
<AreaGraph | ||
style={{ flexGrow: 1 }} | ||
start={start} | ||
end={end} | ||
data={data} | ||
balanceTypeOp={ReportOptions.balanceTypeMap.get(balanceType)} | ||
/> | ||
); | ||
} | ||
if (graphType === 'BarGraph') { | ||
return ( | ||
<BarGraph | ||
style={{ flexGrow: 1 }} | ||
start={start} | ||
end={end} | ||
data={data} | ||
groupBy={groupBy} | ||
empty={empty} | ||
balanceTypeOp={ReportOptions.balanceTypeMap.get(balanceType)} | ||
/> | ||
); | ||
} | ||
if (graphType === 'BarLineGraph') { | ||
return ( | ||
<BarLineGraph | ||
style={{ flexGrow: 1 }} | ||
start={start} | ||
end={end} | ||
graphData={data.graphData} | ||
/> | ||
); | ||
} | ||
if (graphType === 'DonutGraph') { | ||
return ( | ||
<DonutGraph | ||
style={{ flexGrow: 1 }} | ||
start={start} | ||
end={end} | ||
data={data} | ||
groupBy={groupBy} | ||
empty={empty} | ||
balanceTypeOp={ReportOptions.balanceTypeMap.get(balanceType)} | ||
/> | ||
); | ||
} | ||
if (graphType === 'LineGraph') { | ||
return ( | ||
<LineGraph | ||
style={{ flexGrow: 1 }} | ||
start={start} | ||
end={end} | ||
graphData={data.graphData} | ||
/> | ||
); | ||
} | ||
if (graphType === 'StackedBarGraph') { | ||
return ( | ||
<StackedBarGraph | ||
style={{ flexGrow: 1 }} | ||
start={start} | ||
end={end} | ||
data={data} | ||
balanceTypeOp={ReportOptions.balanceTypeMap.get(balanceType)} | ||
/> | ||
); | ||
} | ||
if (graphType === 'TableGraph') { | ||
return ( | ||
<View | ||
style={{ | ||
overflow: 'auto', | ||
}} | ||
> | ||
<ReportTableHeader | ||
interval={mode === 'time' && months} | ||
scrollWidth={scrollWidth} | ||
groupBy={groupBy} | ||
balanceType={balanceType} | ||
/> | ||
<ReportTable saveScrollWidth={saveScrollWidth}> | ||
<ReportTableList | ||
data={data} | ||
empty={empty} | ||
monthsCount={months.length} | ||
balanceTypeOp={ReportOptions.balanceTypeMap.get(balanceType)} | ||
mode={mode} | ||
groupBy={groupBy} | ||
/> | ||
<ReportTableTotals | ||
scrollWidth={scrollWidth} | ||
data={data} | ||
mode={mode} | ||
balanceTypeOp={ReportOptions.balanceTypeMap.get(balanceType)} | ||
monthsCount={months.length} | ||
balanceType={balanceType} | ||
/> | ||
</ReportTable> | ||
</View> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.