NCEAS / metacatui

MetacatUI: A client-side web interface for DataONE data repositories
https://nceas.github.io/metacatui
Apache License 2.0
42 stars 26 forks source link

Make place holder for the quality service graphic in the portal metrics view #1178

Closed robyngit closed 4 years ago

robyngit commented 4 years ago

Example graphic:

dataone-fair-scores-overall

Relates to issue #1116

gothub commented 4 years ago

Here is a first pass for the text:

Metadata Quality

This graph shows the quality scores for all metadata viewable by this portal, based on
the DataONE FAIR Quality Suite. The FAIR suite evaluates metadata based on these
criteria: Finable, Accessible, Interoperable, Reusable.
laurenwalker commented 4 years ago

We've talked about not using the word "Quality" anymore, since it has some negative connotations (e.g. if I have low scores, is my research of low quality?) So let's replace that with something like "Metadata Assessment" or "Metadata Completeness"

Also, with some minor wording changes:

Metadata Assessment

This graph shows the assessment score for all metadata in this portal, based on
the DataONE FAIR Suite. The FAIR suite evaluates metadata based on these
criteria: Findable, Accessible, Interoperable, Reusable.
robyngit commented 4 years ago

@gothub, this should be ready to go! Here's how I set it up...

Screen Shot 2019-11-19 at 17 19 01
gothub commented 4 years ago

@robyngit thanks - this is really helpful!

gothub commented 4 years ago

@robyngit Should I load the image with an xhr in Stats.js? How can I load the image with an XHR request? Should I use Image(), or something like LocalStorage? Or is there some other way to preload the image dynamically? @laurenwalker what would you recommend for preloading an image in Stats.js and then displaying in StatsView.js?

laurenwalker commented 4 years ago

@gothub - Does the auth token need to be sent with the request for the image?

laurenwalker commented 4 years ago

If an auth token doesn't need to be sent, you can just create an img HTML element and make the src the URL of the graph image. If you need to send an XHR in order to send the auth token, then here is an example I Googled that looks like it would work well:

https://gist.github.com/santisbon/a7c221780b528bd3ebb8

gothub commented 4 years ago

@laurenwalker thx for looking this up. My concern is that I assumed img.src should only be used for static content, as the image I'm loading is being returned from a service url, and could certainly return an error status, requiring an appropriate error msg or image to be displayed.

Regarding the REST endpoint, i.e. 'https://.../scores?collection=some pid&suite=FAIR.suite.1', what do you recommend for the requested media type: 'application/octet-stream' or 'image/jpeg'? A jpeg image will be returned in either case, I just couldn't google a recommendation for this.

laurenwalker commented 4 years ago

Ah ok, yeah a XHR makes the most sense in this case. If the response will be a jpeg image, I would think image/jpeg would be the most appropriate.

mbjones commented 4 years ago

@gothub Why are you returning jpeg rather than PNG? PNG is a far superior format for line drawings like our graphs.

gothub commented 4 years ago

@mbjones I'll update the R script that creates the graphic to use PNG.