Skip to content
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

Generalize quanity reports #212

Closed
paul121 opened this issue Oct 26, 2019 · 5 comments
Closed

Generalize quanity reports #212

paul121 opened this issue Oct 26, 2019 · 5 comments

Comments

@paul121
Copy link
Member

paul121 commented Oct 26, 2019

Creating an issue to further track a feature we've talked about, and something I think is pretty feasible - further develop farm_quantity_report to save reports and graph values.

@mstenta already created the farm_quantity_report - it's a great start that I believe is providing some of the fundamental pieces required here. I'm curious what the next steps are to extend this to "persist" in a custom, user defined report under the reports tab. (Right now the livestock weight report is hard coded and lives under the report tab)

After a user creates a quantity reportvia the existing form, it would great to supply an option to "save" that report for future viewing (as additional quantity values are collected).

Ideas that come to mind:

  • Under the report tab, the saved report could include a table and graph of quantity values (similar to what livestock weight report currently does).
  • Provide a report_add_hook for modules to easily add simple reports to the view. (Could livestock_weight_report be replaced by simply providing a report with asset_type as animal, log_type as observation and measure as weight to this future report_add_hook ??
  • It would also be interesting if quantity reports could be "suggested" or even automatically generated once enough data points have been collected.
@paul121
Copy link
Member Author

paul121 commented Oct 26, 2019

Another use case was mentioned in the forum - charting rainfall weather observations

https://farmos.discourse.group/t/rainfall-charting-module/111/2

@mstenta
Copy link
Member

mstenta commented Oct 28, 2019

Great ideas!

We actually have an issue open for one of them already (adding graphing to the quantity report): https://www.drupal.org/project/farm/issues/2941620

I love the idea of "saving" reports. It's already sort of possible right now just by bookmarking, because the exposed filters are applied as query parameters to the URL. But having something baked into farmOS would be cool too.

Could livestock_weight_report be replaced by simply providing a report

Interesting question! I think ultimately use-cases will probably boil down into two types: "simple" and "complex".

The quantity reports are relatively "simple" right now, as they are just a single database query with filters applied ("select all quantity measurements from logs, and apply these filters") - so you just end up with a list of rows.

The weight report is a bit more "complex" in that it has to run multiple queries and then process the results of them in different ways.

I think the simple quantity reports (with graphs and the ability to save them) cover a big set of potential cases, and are super flexible (they can be used to measure anything!) - so maybe it's an 80/20% rule thing. The other 20% of "complex" cases require their own custom reports.

I like the idea of making the "saved quantity reports" appear on the same level as the "complex reports" though, if that's what you were suggesting. So ultimately you have all your reports in one place... some provided by modules, and others that you created yourself with the quantity report tool.

@paul121
Copy link
Member Author

paul121 commented Oct 29, 2019

Good idea about saving via bookmarking - that's great. For many people that is already fairly intuitive.

I like the idea of making the "saved quantity reports" appear on the same level as the "complex reports" though, if that's what you were suggesting.

Yep! I'm glad you pointed out that there are "simple" and "complex" reports. I might try and start thinking about generalizing the graphing of simple reports. Creating an API or just a standardized object to send to javascript graphing library.

@mstenta
Copy link
Member

mstenta commented Oct 29, 2019

Creating an API or just a standardized object to send to javascript graphing library.

That's a great idea! The Quantity Report is generated by the Views module, so my thought is we can make a Views plugin that adds a graph to the View automatically, pulling the data from the results. Some things to figure out with that... but perhaps we can look at it together. Either way, I think that could plug into a generalized object for graphing.

@mstenta
Copy link
Member

mstenta commented Apr 6, 2023

I'm going through and closing old/stale issues and discussions. Moving forward we are encouraging general discussions take place on the farmOS community forum. GitHub will be reserved for bug reports and pull requests.

@paul121 feel free to open a new forum topic (or use an existing one) and link to this if you want!

@mstenta mstenta closed this as not planned Won't fix, can't repro, duplicate, stale Apr 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants