dm icon indicating copy to clipboard operation
dm copied to clipboard

dm_shine()

Open krlmlr opened this issue 3 years ago • 3 comments

A Shiny app/module that displays the contents of all tables of a dm object.

  • Sidebar: choose tables
  • Main part: a reactable, shows at most N rows/cells of one of the tables in the dm (10000 cells or 1000 rows?)
  • Search in the reactable: filter records
  • Foreign keys: are clickable, navigate to the parent record
  • Child tables: if a table has child tables, the number of child records is shown in a "virtual" column; when clicked, the child table is opened with these records
  • Reset button
  • CRUD support?

krlmlr avatar Nov 05 '21 19:11 krlmlr

Hi Team - I am a big fan of {dm}. Thank you for all of your hard work on this. I extended {dm} for use in my current job function, namely introducing the idea of "templates" which essentially save all of the metadata of a dm, leaving out the data content itself. In support of that effort, I wanted a way for team members to create dm templates without needing a lot of knowledge about {dm} and its syntax. I came up with this Shiny Widget that we are currently testing, which I thought fit well with this issue. In the gif below, I illustrate modifying PK and FK relationships. There is also the capability for users to include tables and columns into a dm template. The 'columns' portion I don't think is relevant to core {dm} now but it useful for me since our data frames usually contain lots of unnecessary auxiliary columns. I plan on extending this out to a larger Shiny application that incorporates other aspects of our workflow. dm_gui_demo_gif_v2

michaelbgarcia avatar Jul 19 '22 16:07 michaelbgarcia

Thanks, this does look useful. We should see how to integrate this with our own approach to a dm user interface.

Are you aware of dm_ptype() and dm_paste() ?

krlmlr avatar Jul 19 '22 16:07 krlmlr

Thank you, indeed I am aware of dm_paste() but it did not work fully with my use case as the source of the data (list of data.tables) did not allow for me to "apply" the dm model to a different list of tables. dm_ptype seems to be what I was after but at the time of researching this it was still experimental and my initial attempts failed as output needed be in JSON format so it can ingested into systems outside of R. jsonlite::toJSON does not have a method for class "dm" which prompted to explore the "templates". However I will continue to monitor the evolution of dm_ptype() and the package overall!

michaelbgarcia avatar Jul 19 '22 17:07 michaelbgarcia