IQSS / dataverse

Open source research data repository software
http://dataverse.org
Other
879 stars 492 forks source link

Display Make Data Count use and citation metrics #5253

Closed djbrooke closed 5 years ago

djbrooke commented 6 years ago

After the backend for Make Data Count support is implemented in #4821, we'll need to display the metrics on the appropriate pages.

djbrooke commented 5 years ago

When displaying metrics, we need to take into account:

TaniaSchlatter commented 5 years ago

Design doc with research, questions, mockups

mheppler commented 5 years ago

Front-end for the file and dataset pgs have been revamped based on recent 5.0 mockups, in order to make some room for expanded metrics from Make Data Count.

New branch 5253-metrics-block-ui is ready to be wired up. Static placeholder content has been added to the Metrics block, ready to be connected to the back-end.

Assorted UI changes include:

Screen Shot 2019-06-27 at 1 03 53 PM

Screen Shot 2019-06-27 at 1 04 53 PM

djbrooke commented 5 years ago
pdurbin commented 5 years ago

I started wiring up the Make Data Count back end to the front end.

First, to make it easier to work on the front end, I documented how to run an integration test to put some data in your database: 3760d31

Then I wired up downloads and views on the dataset page: bc5d512

While I was in there I noticed that the mockup above had downloads twice like this:

Screen Shot 2019-07-12 at 4 43 26 PM

I changed the second "Downloads" to "Views" and added a CSS class called "metrics-views-mdc" but I couldn't find where the classes for downloads and citations are defined.

I also notice that there's some help text that could probably be added by someone who wants to swarm on this issue. Right now the popup has placeholder text and I'm not sure why "Downloads" doesn't have a link or a question mark. Here's how it looks after my changes:

Screen Shot 2019-07-13 at 8 53 37 AM
pdurbin commented 5 years ago

Good meeting today with @mheppler @TaniaSchlatter @djbrooke and @jggautier about this UI.

@mheppler I think I'm ready for some more assistance. Specifically you could:

If you look at my recent commits, you'll see I added a new table where I try to explain the config options. Here's a screenshot:

Screen Shot 2019-07-15 at 4 57 08 PM

I'll try to explain below how I've currently implemented the render logic.

MDC with DOIs

curl -X PUT -d '/usr/local/glassfish4/glassfish/domains/domain1/logs' http://localhost:8080/api/admin/settings/:MDCLogPath

curl -X PUT -d 'doi' http://localhost:8080/api/admin/settings/:Protocol

You should see this. Note that I change the hover text a bit:

Screen Shot 2019-07-15 at 5 01 14 PM

MDC with Handles, no citations

curl -X PUT -d '/usr/local/glassfish4/glassfish/domains/domain1/logs' http://localhost:8080/api/admin/settings/:MDCLogPath

curl -X PUT -d 'hdl' http://localhost:8080/api/admin/settings/:Protocol

Screen Shot 2019-07-15 at 5 01 41 PM

Out of the box, classic downloads

curl http://localhost:8080/api/admin/settings/:MDCLogPath -X DELETE

Screen Shot 2019-07-15 at 5 02 09 PM

TaniaSchlatter commented 5 years ago

Here's a different view of the config options/states with formats for maximum/minimum number display.

Screen Shot 2019-07-16 at 12 24 07 PM
djbrooke commented 5 years ago

@pdurbin thanks for mentioning the table at standup today. It's helpful. We can roll with this initially and expand based on feedback.

mheppler commented 5 years ago

@pdurbin UI has been cleaned up, placeholder msg text moved to bundle, static popup for citations added. Let me know if you need my attention on anything else.

pdurbin commented 5 years ago

@mheppler thanks, the popup is looking good! I'll go wire it up to the backend. 😄

(I see you also removed the stray lines I mentioned above. Thanks!)

Here's a screenshot of the static popup:

Screen Shot 2019-07-17 at 1 18 18 PM

When I stopped by @djbrooke 's office to ask about https://github.com/IQSS/dataverse.harvard.edu/issues/3 we talked about the popup and the fact that there's a workaround if someone can't see the thousands of citations their dataset has within the little popup. That is, they can retrieve the citation URLs from the API: http://guides.dataverse.org/en/4.15.1/api/native-api.html#retrieving-citations-for-a-dataset . So for now we're fine with an unordered, non-paginated list of URLs. I also mentioned that we can anticipate users wanting to see the title, author, journal, etc from the citations but this is out of scope for the current effort, for this issue. (We would need to write code to retrieve this information from DataCite or Crossref or elsewhere, I guess.)

@TaniaSchlatter on a related note, while users might not care much whether their dataset has 2 or 4 views I think the different in their minds between 2 and 4 citations of their dataset is probably significant. This because citations are going to be more rare, I think. I wasn't considering this during our discussion of the "<5" logic yesterday. Here are my notes from that conversation:

pdurbin commented 5 years ago

@TaniaSchlatter I just re-wrote the tooltips as promised and deployed the code to the same test server we've been using. The server is currently configured for Make Data Count so you sound see something like the screenshot below if you go to http://ec2-3-86-35-164.compute-1.amazonaws.com/dataset.xhtml?persistentId=doi:10.5072/FK2/GB9MJQ&version=1.0

Screen Shot 2019-07-18 at 4 04 48 PM

You should see tooltips like the ones below while the server is in Make Data Count mode:

metrics.dataset.title=Dataset Metrics metrics.dataset.tip.makedatacount=Metrics collected using Make Data Count standards. metrics.dataset.views.tip=Dataset views are combined with aggregated file views. metrics.dataset.downloads.makedatacount.tip=Each file download (single or multiple files) increments the download count. metrics.dataset.citations.tip=Click for a list of citation URLs. metrics.citations.dialog.header=Dataset Citations metrics.citations.dialog.help=Citations for this dataset are retrieved from Crossref via DataCite a using Make Data Count standards.

metrics.file.title=File Metrics metrics.file.tip.makedatacount=Individual file downloads are tracked but this is not part of the Make Data Count standard. metrics.file.downloads.tip=Total downloads of this file.

To give you a preview of the tooltips you should expect to see when I reconfigure this server for "default" or "out of the box" mode (not Make Data Count), this is what you'll see.

metrics.dataset.tip.default=Aggregated metrics for this dataset. metrics.dataset.downloads.default.tip=Total aggregated downloads of files in this dataset. metrics.file.tip.default=Metrics for this individual file.

@mheppler if you're able to pull the latest and demo some of this on your laptop, this might be easier since I'm working remotely the rest of the week.

I also wired the citations pop up to the database so that the list is no longer hard coded.

Next I guess I'll look into the tasks I mentioned previously:

@TaniaSchlatter I'm not sure if you saw the note in my last comment about how I think people will be quite happy with 4 citations so I'm not sure if the "<5" is needed for citations.

I should also mention that I haven't yet figured out the backend problem I mentioned at standup yesterday about how I wasn't able to produce the JSON file of views and downloads based on logs created by Dataverse. @sekmiller and I talked about it but he didn't work on this part of the code. I'm not sure if it's not working or if the docs weren't easy enough for me to follow to install, configure, and run Counter Processor. If anyone wants to swarm on this task, https://github.com/IQSS/dataverse.harvard.edu/issues/3 is highly related.

mheppler commented 5 years ago

If we're voting on the metrics number formatting, I would say that it is unnecessary. It isn't saving very much space, and I can see all the support emails now... my dataset page says, "1.1M Downloads", where are my 99,999 other downloads?

pdurbin commented 5 years ago

@mheppler well, it would be an easy way to cut scope by not implementing the metrics formatting suggested above. (And I don't know how to do it. I've been Googling a bit just now.) You're right that space isn't much of a concern. Here's a fake "views" metric with over a billion:

Screen Shot 2019-07-18 at 4 38 53 PM

The above is also consistent with the "big number formatting" we have at the installation level:

Screen Shot 2019-07-18 at 4 41 47 PM

I dunno. If OmniFaces or JSF made this super easy to do (maybe @scolapasta knows how?) I would probably just throw it in there but maybe we should consider deferring this. I'm curious what @djbrooke thinks.

The other thing I'm thinking about is how when I was a kid I was a little sad when a McDonalds would switch over from "999,862 served" one week to "millions and millions served" the next. 😄 I guess I like the precision (which you can still get from the Dataverse API, by the way, regardless of what we do in the UI).

Whoops, I'm mis-remembering how these McDonalds signs worked, I think. I just found this:

mcdonalds-1

djbrooke commented 5 years ago

I believe using K and M was for internationalization purposes because it gives us extra space for those languages that have long words for "Downloads" and "Views"

pdurbin commented 5 years ago

@djbrooke right, right. Ok, I'll keep Googling. /me sings "Don't Wanna Be An American Idiot"

Oh, the other thing on my todo list is to switch from stuff like jsf:rendered="#{not empty settingsServiceBean.get(':MDCLogPath')}" which makes a lot of database calls to our settingsWrapper. I'll probably do that next.

If there are any JSF experts in the house that can advise on the K and M and <5, you know where to find me.

mheppler commented 5 years ago

Note: need to fix the CSS for the old metrics block that is still on the dataverse pg.

Screen Shot 2019-07-19 at 9 37 01 AM
pdurbin commented 5 years ago

I just made pull request #6040

In Slack @djbrooke @TaniaSchlatter @mheppler and I decided to defer the work on