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

Possible Inclusion of a Shiny Attribute Table Builder #243

Open
maier-m opened this issue Apr 20, 2018 · 10 comments
Open

Possible Inclusion of a Shiny Attribute Table Builder #243

maier-m opened this issue Apr 20, 2018 · 10 comments

Comments

@maier-m
Copy link

maier-m commented Apr 20, 2018

Hello, I built some tools for the Arctic Data Center at NCEAS to help build attribute tables in an R shiny environment. A demonstration of the tools is shown below. Essentially the tools use R shiny and handsontableJS to create an opinionated tabular environment for building attributes. Enumerated domain factors and custom units are also built simultaneously. Additionally there are tools built using the udunits2 library to help users with converting to EML units (e.g. inputting "m" will automatically correct to "meter"). I built these for the NCEAS ADC data support team but feel they may have utility to EML users at large. Please let me know if there is any interest including versions of these tools here.

create_attributes_table

@cboettig
Copy link
Member

@maier-m This looks really cool! Have you taken a look at https://github.com/cboettig/eml2 ? eml2 uses a JSON structure on the backend to represent EML (which can be rendered into schema-valid XML), which I think make it much easier to build upon than original EML. (e.g. you can get a light-weight version of this just by using the json editor from the listviewer package), and might be easier to work with from handsontable as well? (Since my development effort is now more on eml2 I'm also just trying to get more eyes on it and would love if you could take a look; I think it addresses some of the more frustrating aspects of working with the EML package, like getting rid of all the @[[1]] and as(... nonsense.)

But really like the interface and the integration with udunits2 to build and export the attributes table, and I think other users would find that valuable. I'd certainly welcome a PR here and/or at eml2.

@maier-m
Copy link
Author

maier-m commented Apr 20, 2018

Great. Yeah, these tools don't actually build any EML class objects. They just build data.frames which readily can be transformed into EML objects with existing EML, and from what it appears, eml2 tools. I will take a deeper look at eml2 and create a PR. Thanks.

@cboettig
Copy link
Member

Right, so it creates the attribute table in .csv format independent of any subsequent tooling that turns that table into an EML structure. That makes perfect sense. Incidentally, have you found the table format sufficient for the data the Arctic team encounters? Obviously it's not quite as flexible as the attribute definitions of native EML, but I hope it hits the most use cases. Looks like you are also highlighting which fields are required?

@maier-m
Copy link
Author

maier-m commented Apr 20, 2018

  • Correct (returns either csv format or just returns an R data.frame if you don't want/need to save externally).

  • Yes, table formats are very helpful as everyone is comfortable working in such an environment (but it can get confusing on complex EML structures such as attributes if not so familiar with the eml schema, this is the purpose of these tools).

  • Yes, the shiny app is opinionated and highlights which fields are required and also greys out fields not required (i.e. units are greyed out if measurementScale is dateTime but formatString then becomes highlighted.) The idea is to try to mimic the native EML structure as best as possible in a familiar tabular format (which you could also copy and paste from).

@cboettig
Copy link
Member

This was merged into cboettig/eml2#10 , which has now been merged back here.

@maier-m it would be wonderful if you might update / replace the current working-with-units vignette to reflect these tools (both the cli and shiny interface)? Or did we have that vignette and I misplace it in all the merging and moving?

@maier-m
Copy link
Author

maier-m commented Nov 27, 2018 via email

@cboettig
Copy link
Member

@maier-m Thanks Mitchell! A vignette, maybe with a screenshot of the shiny app, would be awesome.

Also, I had some trouble on the get_unit_id tests recently that really confused me, two tests seemed to expect additional behavior simplifying the unit notation. I couldn't reproduce the expected behavior so those tests are currently turned off: https://github.com/ropensci/EML/blob/master/tests/testthat/test_get_unit_id.R#L80-L106

maybe you can take a quick look at that as well? Thanks much.

@maier-m
Copy link
Author

maier-m commented Nov 27, 2018 via email

@trashbirdecology
Copy link

trashbirdecology commented Jun 11, 2020

It's not clear how to use the EML::shiny_attributes() to build the tables, as demonstrated by OP.

When I open EML::shiny_attributes(), I am left with a screen that allows only the following options:

  • quit app (which works as expected)
  • help (does nothing)
  • tab:attributes table (nothing to edit, just a download button)
  • tab:factor table (nothing to edit, just a download button)
  • tab:units table (nothing to edit, just a download button)

Here is a screenshot of what I see when I run EML::shiny_attributes()
image

This screenshot shows the app being "greyed" out, which reflects what I am seeing when running the app. Not sure what's going on there, either.

@jeanetteclark
Copy link
Contributor

Hi @trashbirdecology do you mind sharing your session info? when I run t <- shiny_attributes() I see this:
Screen Shot 2020-06-11 at 9 47 47 AM

Note that you can also run shiny_attributes assigning the data argument to a data.frame with your data, which will pre-fill some information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants