-
-
Notifications
You must be signed in to change notification settings - Fork 429
Data Visualization #3603
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Data Visualization #3603
Conversation
Hi @MarcReniu - The description of this PR is a copy of the epic you're referring to. Please update it so we can get the goal and scope of this PR and potentially help you in the process. |
…s (ONLY USERS AVAILABLE [ci skip]
@decidim/lot-core All checks have passed. This PR is ready again. |
Conflicts again @decidim/lot-core @decidim/product, we have been 20 days without any feedback and we are having to resolve conflicts every once and again. Is there anything that prevent you to merge? |
@tramuntanal we're re-reviewing the code 😄 Meanwhile, there's a CI job that seems to fail, can you check it please? |
end | ||
|
||
def quantity | ||
@quantity ||= cumulative |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why quantity
and cumulative
are the same?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a base method. Each manager overwrites it as needed. like query
method
@metric_name = "" | ||
end | ||
|
||
def clean |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method is never used (delete it?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
raise "Not implemented" | ||
end | ||
|
||
def cumulative |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this use query
instead of @query
?
@day.present? | ||
end | ||
|
||
def registry |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The value of registry
is never used. Maybe it would be easier to understand if we rename it to save
and also get rid of registry!
?
def save
return if cumulative.zero?
metric = Decidim::Metric.find_or_initialize_by(day: @day.to_s, metric_type: @metric_name, organization: @organization)
metric.assign_attributes(cumulative: cumulative, quantity: quantity)
metric.save!
end
@decidim/lot-core Ready to merge! |
@MarcReniu can you please fix the |
🎉🎉🎉 |
Wohoooooooo! 🎉 🎊 💪 |
* Working on SQL Views, not functional * First approach with GraphicQL. Erased SQL Views * Beautify code * Refactor for DataVizz types to custom for each metric * Proposals metric, all and accepted. W/o organization scope * Added votes metric w/o organization scope. Home show JSON data * Base helper module for Proposals metrics * Added Assemblies metric. Created MetricObjectPresenter * Added ParticipatoryProcess metric. Added Area to AssemblyMetric [ci skip] * Added Meetings metric. Added title to Metric objects [ci skip] * Added Results metric. Added includes in Metrics to speed up queries [ci skip] * Added Comments metric [ci skip] * Added metric structure (working on grouping) * Removed useless code [ci skip] * Show metrics data in home w/o graphics [ci skip] * Cached all queries w/o context. Pluralized metric names * Corrected GraphQL parameters. Add metric tests * Rubocopped * Created new metrics table, use of queries for filtering, updated tests (ONLY USERS AVAILABLE [ci skip] * Querify metrics, erase MetricObject structure, updated tests [ci skip] * Rubocopped, again * Metric management for Users and Proposals+Votes * Show charts in Home page, w/o correct labels [ci skip] * Rubocop after master update * Added translations to charts * Normalized Proposals metrics translations * Lintered [ci skip] * Modified metrics CSS to be more dynamic * Corrected SCSS file * MetricCount and MetricManage testing * Correction DataVizz JS * Working in reviews changes * Refactor metric interfaces [in progress] * UsersMetrics tests corrected * Refactor of proposals GraphQL * Refactored rest of metrics * Working in reviews [ci skip] * Minor reviews * mend * More reviews to go * Improved JS execution, and more corrections * MetricManage test corrected * Added metrics as a content block * Added CHANGELOG ENTRY. Some corrections for JS * Refactored metrics rake tasks to use registries and ActiveJobs * Created metrics registry. Improved metric types * Remove MetricEntity dependency * Refactor of MetricType * Refactor metrics.js for new query structure * Added more tests in DataVizz: task, job, and home cells * Refactor MetricManage and all dependant classes. Tests and taks updated too * Rubocopped * Updated Engine with correct cells configuration for DataVizz * Corrected MetricManage tests * Changed title of Metrics block * Update MetricRegistry methods and herencies * Locales normalized * Corrected UserMetricManage test * Corrected CHANGELOG
* Working on SQL Views, not functional * First approach with GraphicQL. Erased SQL Views * Beautify code * Refactor for DataVizz types to custom for each metric * Proposals metric, all and accepted. W/o organization scope * Added votes metric w/o organization scope. Home show JSON data * Base helper module for Proposals metrics * Added Assemblies metric. Created MetricObjectPresenter * Added ParticipatoryProcess metric. Added Area to AssemblyMetric [ci skip] * Added Meetings metric. Added title to Metric objects [ci skip] * Added Results metric. Added includes in Metrics to speed up queries [ci skip] * Added Comments metric [ci skip] * Added metric structure (working on grouping) * Removed useless code [ci skip] * Show metrics data in home w/o graphics [ci skip] * Cached all queries w/o context. Pluralized metric names * Corrected GraphQL parameters. Add metric tests * Rubocopped * Created new metrics table, use of queries for filtering, updated tests (ONLY USERS AVAILABLE [ci skip] * Querify metrics, erase MetricObject structure, updated tests [ci skip] * Rubocopped, again * Metric management for Users and Proposals+Votes * Show charts in Home page, w/o correct labels [ci skip] * Rubocop after master update * Added translations to charts * Normalized Proposals metrics translations * Lintered [ci skip] * Modified metrics CSS to be more dynamic * Corrected SCSS file * MetricCount and MetricManage testing * Correction DataVizz JS * Working in reviews changes * Refactor metric interfaces [in progress] * UsersMetrics tests corrected * Refactor of proposals GraphQL * Refactored rest of metrics * Working in reviews [ci skip] * Minor reviews * mend * More reviews to go * Improved JS execution, and more corrections * MetricManage test corrected * Added metrics as a content block * Added CHANGELOG ENTRY. Some corrections for JS * Refactored metrics rake tasks to use registries and ActiveJobs * Created metrics registry. Improved metric types * Remove MetricEntity dependency * Refactor of MetricType * Refactor metrics.js for new query structure * Added more tests in DataVizz: task, job, and home cells * Refactor MetricManage and all dependant classes. Tests and taks updated too * Rubocopped * Updated Engine with correct cells configuration for DataVizz * Corrected MetricManage tests * Changed title of Metrics block * Update MetricRegistry methods and herencies * Locales normalized * Corrected UserMetricManage test * Corrected CHANGELOG
🎩 What? Why?
This epic describes a new module that enables generic data visualizations across the entire platform (decidim-dataviz).
For an initial MVP, we are going to show acumulative lineal graphs on Home page, related to user, votes, proposals, assemblies, results, processes, comments and meetings.
The idea is to use the GraphQL API to return statistics, and then with D3 graphs libraries show it up.
📌 Related Issues
📋 Subtasks
CHANGELOG
entry