Skip to content

Commit

Permalink
mds
Browse files Browse the repository at this point in the history
  • Loading branch information
zoometh committed Feb 8, 2024
1 parent f594a22 commit 376f322
Show file tree
Hide file tree
Showing 21 changed files with 17,458 additions and 2 deletions.
3 changes: 2 additions & 1 deletion dbs/database.eamena/data/reference_data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ It means that fields, and field and field values (`level3`) can be aggregated an
<em>A screenshot of the editable 'mds-template.xlsx'</em>
</p>


#### Interactivity

Check the MDS fields in this HTML circular plot ([here](https://eamena-project.github.io/eamena-arches-dev/dbs/database.eamena/data/reference_data/mds/mds_level.html))
Check the MDS fields in this HTML circular plot ([here](https://eamena-project.github.io/eamena-arches-dev/dbs/database.eamena/data/reference_data/mds/mds-reference.html))

<p align="center">
<img alt="img-name" src="https://github.com/eamena-project/eamena-arches-dev/blob/main/www/arches-v7-hp-data-mds-pie.png" width="500">
Expand Down
22 changes: 22 additions & 0 deletions dbs/database.eamena/data/reference_data/mds/field-description.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
library(readxl)
library(DT)
library(htmlwidgets)

## Generates a DT table of field names and field description from 'mds-template.xlsx'

mds.path <- "C:/Rprojects/eamena-arches-dev/dbs/database.eamena/data/reference_data/mds/"
mds.template <- paste0(mds.path, "mds-template.xlsx")
df <- read_excel(mds.template, sheet = 1)
df_filtered <- df[, c("level1", "level2", "level3", "description", "color")]
colnames(df_filtered)[colnames(df_filtered) == 'level3'] <- 'Heritage Place field'
# rm the transparency from colors (ie, mds)
df_filtered$color <- sub("^(.{7}).*", "\\1", df_filtered$color)
# df_filtered$color <- as.factor(df_filtered$color)
dt_widget <- datatable(df_filtered[ , c("Heritage Place field","description"), drop=FALSE],
rownames = FALSE,
options = list(pageLength = 25, autoWidth = TRUE)) %>%
formatStyle(
columns = c("Heritage Place field"),
backgroundColor = styleEqual(df_filtered[["Heritage Place field"]], df_filtered$color)
)
saveWidget(dt_widget, paste0(mds.path, '/fields-description.html'), selfcontained = TRUE)
Loading

0 comments on commit 376f322

Please sign in to comment.