New Charts
This MR looks larger than it is!
What is this about?
This is prework and partial implementation for the new charts from figures.cc. New issues coming up ^^
I updated the widget mechanism and build a first dataViewWidget for a chart of figures.cc (YesNoChart)
How to test?
Import the example data (see below) and open /my-charts. The boolean questions should have a new chart.
Also run the figures.cc demo: npm run dev
in ./lib/figures.cc/rcc-dataviz
This should spawn a dev server and tell you a port to inspect the demo on in your browser.
What did I do?
figures.cc code
I added the github repo of figures.cc to ./lib/figures.cc/rcc-dataviz
I did this with git subtree add
, so this is not a submodule, but rather something like a one time pull.
And it is now part of our repo, as if I had copied the code.
Sadly I did not enforce our coding rules, so the new part does not align with our linting rules. I disabled linting for that part. Just leave things in that folder as they are, and treat them like a 3rd party package. We might have to pull updates in the future.
Example Data
I added Example data with ExampleChartStoresModule
from '@rcc/examples'. It added a few new questions and enough random example data for a year :)
Import that module in .../pat/features.ts to make use of it.
All of the new files from the figures.cc repo count as changes in this MR. No need to check them.
DataViewControl
I updated DataViewControl. It has three more properties now: startDate, endDate and scope, to accommodate for the new inputs in stacked-report-view.
ReportStackedViewComponent
I updated ReportStackedViewComponent
so things work properly with the new charts. But the main changes here are due to a racing condition:
Before the changes we used dummy data, now we wait for the real data (Example data, see above). For this I had to move (re)initialization into ngOnChanges (from ngOnInit) because .report
would start out as undefined
. Moving parts of the code creates quite the mess in the diffs (the plain file is quite readable though).
BooleanDataViewWidget
This one visualizes questions with boolean answers.