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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data Visualization #3603

Merged
merged 81 commits into from Sep 26, 2018

Conversation

@MarcReniu
Copy link
Collaborator

MarcReniu commented Jun 6, 2018

馃帺 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

  • Add CHANGELOG entry
  • Add documentation regarding the feature
  • Add/modify seeds
  • Add tests
  • Another subtask

MarcReniu added some commits Jun 4, 2018

@josepjaume

This comment has been minimized.

Copy link
Collaborator

josepjaume commented Jun 11, 2018

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.

@tramuntanal

This comment has been minimized.

Copy link
Member

tramuntanal commented Sep 18, 2018

@decidim/lot-core All checks have passed. This PR is ready again.

@tramuntanal

This comment has been minimized.

Copy link
Member

tramuntanal commented Sep 19, 2018

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?

@wafflebot wafflebot bot added the status: WIP label Sep 19, 2018

@mrcasals

This comment has been minimized.

Copy link
Collaborator

mrcasals commented Sep 19, 2018

@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

This comment has been minimized.

@oriolgual

oriolgual Sep 19, 2018

Collaborator

Why quantity and cumulative are the same?

This comment has been minimized.

@MarcReniu

MarcReniu Sep 24, 2018

Collaborator

This is a base method. Each manager overwrites it as needed. like query method

@metric_name = ""
end

def clean

This comment has been minimized.

@oriolgual

oriolgual Sep 19, 2018

Collaborator

This method is never used (delete it?)

This comment has been minimized.

@MarcReniu

MarcReniu Sep 24, 2018

Collaborator

Ok

raise "Not implemented"
end

def cumulative

This comment has been minimized.

@oriolgual

oriolgual Sep 19, 2018

Collaborator

Shouldn't this use query instead of @query?

@day.present?
end

def registry

This comment has been minimized.

@oriolgual

oriolgual Sep 19, 2018

Collaborator

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

@MarcReniu MarcReniu removed the status: WIP label Sep 25, 2018

@MarcReniu

This comment has been minimized.

Copy link
Collaborator

MarcReniu commented Sep 25, 2018

@decidim/lot-core Ready to merge!

@oriolgual

This comment has been minimized.

Copy link
Collaborator

oriolgual commented Sep 26, 2018

@MarcReniu can you please fix the CHANGELOG? Everything else looks OK 馃憤

@wafflebot wafflebot bot added the status: WIP label Sep 26, 2018

@MarcReniu MarcReniu removed the status: WIP label Sep 26, 2018

Issues fixed

@oriolgual oriolgual merged commit 0320ff3 into master Sep 26, 2018

3 of 4 checks passed

ci/circleci: main CircleCI is running your tests
Details
WIP ready for review
Details
ci/circleci: build_test_app Your tests passed on CircleCI!
Details
codeclimate All good!
Details

@oriolgual oriolgual deleted the feat/epic-data-vizz branch Sep 26, 2018

@oriolgual

This comment has been minimized.

Copy link
Collaborator

oriolgual commented Sep 26, 2018

馃帀馃帀馃帀

@mrcasals

This comment has been minimized.

Copy link
Collaborator

mrcasals commented Sep 26, 2018

Wohoooooooo! 馃帀 馃帄 馃挭

tramuntanal added a commit that referenced this pull request Oct 3, 2018

Data Visualization (#3603)
* 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

tramuntanal added a commit that referenced this pull request Oct 9, 2018

Data Visualization (#3603)
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment