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

data: new dashboard data model #4613

Merged
merged 3 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/central/src/components/SchemaCreateModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ export default {
"FAIR_DATA_POINT",
"BEACON_V2",
"ERN_DASHBOARD",
"UI_DASHBOARD",
"BIOBANK_DIRECTORY",
"BIOBANK_DIRECTORY_STAGING",
"SHARED_STAGING",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public Task getImportTask(Schema schema, boolean includeDemoData) {
public enum Regular {
DIRECTORY(DirectoryLoader::new),
ERN_DASHBOARD(DashboardLoader::new),
UI_DASHBOARD(UiDashboardLoader::new),
PROJECTMANAGER(ProjectManagerLoader::new),
BIOBANK_DIRECTORY(BiobankDirectoryLoader::new),
RD3_V2(RD3v2Loader::new),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package org.molgenis.emx2.datamodels;

import org.molgenis.emx2.MolgenisException;
import org.molgenis.emx2.Privileges;
import org.molgenis.emx2.Schema;
import org.molgenis.emx2.io.ImportDataModelTask;
import org.molgenis.emx2.io.MolgenisIO;
import org.molgenis.emx2.sql.SqlDatabase;

public class UiDashboardLoader extends ImportDataModelTask {

public UiDashboardLoader(Schema schema, Boolean includeDemoData) {
super(schema, includeDemoData);
}

@Override
public void run() {
this.start();
try {
createSchema(getSchema(), "ui_dashboards/molgenis.csv");
getSchema().addMember(SqlDatabase.ANONYMOUS, Privileges.VIEWER.toString());
MolgenisIO.fromClasspathDirectory("ui_dashboards/ontologies", getSchema(), false);

if (isIncludeDemoData()) {
MolgenisIO.fromClasspathDirectory("ui_dashboards/demodata", getSchema(), false);
}
this.complete();
} catch (Exception e) {
this.completeWithError(e.getMessage());
throw new MolgenisException("Create profile failed", e);
}
}
}
13 changes: 13 additions & 0 deletions data/ui_dashboards/demodata/Chart data.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
data point id,data point name,data point value,data point value label,data point series,data point primary category,data point secondary category,data point primary category label,data point secondary category label,data point time,data point time unit,data point color,data point description,data point order,included in chart
davidruvolo51 marked this conversation as resolved.
Show resolved Hide resolved
recruitment-count-control,Healthy Controls,30,,,,,,,,,,Number of Healthy Controls patients recruited,2,recruitment-count
recruitment-count-intervention,Intervention,30,,,,,,,,,,Number of Intervention patients recruited,0,recruitment-count
recruitment-count-placebo,Placebo,30,,,,,,,,,,Number of Placebo patients recruited,1,recruitment-count
recruitment-count-by-site-site-001-healthy controls,Healthy Controls,10,,,site_001,,University Hospital of AAA,,,,,Number of Healthy Controls patients recruited at University Hospital of AAA,0,recruitment-count-by-site
recruitment-count-by-site-site-001-intervention,Intervention,10,,,site_001,,University Hospital of AAA,,,,,Number of Intervention patients recruited at University Hospital of AAA,3,recruitment-count-by-site
recruitment-count-by-site-site-001-placebo,Placebo,15,,,site_001,,University Hospital of AAA,,,,,Number of Placebo patients recruited at University Hospital of AAA,6,recruitment-count-by-site
recruitment-count-by-site-site-002-healthy controls,Healthy Controls,10,,,site_002,,National insitute of BBB,,,,,Number of Healthy Controls patients recruited at National insitute of BBB,1,recruitment-count-by-site
recruitment-count-by-site-site-002-intervention,Intervention,5,,,site_002,,National insitute of BBB,,,,,Number of Intervention patients recruited at National insitute of BBB,4,recruitment-count-by-site
recruitment-count-by-site-site-002-placebo,Placebo,10,,,site_002,,National insitute of BBB,,,,,Number of Placebo patients recruited at National insitute of BBB,7,recruitment-count-by-site
recruitment-count-by-site-site-003-healthy controls,Healthy Controls,10,,,site_003,,University of CCC,,,,,Number of Healthy Controls patients recruited at University of CCC,2,recruitment-count-by-site
recruitment-count-by-site-site-003-intervention,Intervention,15,,,site_003,,University of CCC,,,,,Number of Intervention patients recruited at University of CCC,5,recruitment-count-by-site
recruitment-count-by-site-site-003-placebo,Placebo,5,,,site_003,,University of CCC,,,,,Number of Placebo patients recruited at University of CCC,8,recruitment-count-by-site
3 changes: 3 additions & 0 deletions data/ui_dashboards/demodata/Charts.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
chart id,chart type,chart title,chart subtitle,x axis label,x axis min value,x axis max value,x axis ticks,y axis label,y axis min value,y axis max value,y axis ticks,top margin,right margin,bottom margin,left margin,legend position,data points,dashboard page
recruitment-count,vertical bar chart,Patients recruited by group,Count of patients by study allocation since the start of the project (Jan 2025),Group,,,,Count,0,,,15,10,80,30,top,,Home
recruitment-count-by-site,vertical bar chart,Patient recruitment by site and group,Further breakdown of recruitment data by study site and group assignment,Site,,,,Count,0,,,15,10,80,30,top,,Home
2 changes: 2 additions & 0 deletions data/ui_dashboards/demodata/Dashboard pages.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name,description
Home,The default page that is displayed when the dashboard is loaded
69 changes: 69 additions & 0 deletions data/ui_dashboards/molgenis.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
tableName,tableExtends,tableType,columnName,columnType,key,required,refTable,refBack,defaultValue,validation,semantics,description
Dashboard pages,,,,,,,,,,,http://semanticscience.org/resource/SIO_000302,The user interfaces in the vue application and the charts are displayed in each view
Dashboard pages,,,name,string,1,TRUE,,,,,http://schema.org/name,Name of the page
Dashboard pages,,,description,text,,,,,,,http://schema.org/description,Text that describes the aim of the page
Dashboard pages,,,charts,refback,,,Charts,chart id,,,http://edamontology.org/topic_0092,One or more charts displayed on a page
Charts,,,,,,,,,,,http://semanticscience.org/resource/SIO_000904,Visualisations that are displayed on page
Charts,,,chart id,string,1,TRUE,,,,,http://semanticscience.org/resource/SIO_000115,"A unique value that identifies a visualisation, the associated settings and data points."
davidruvolo51 marked this conversation as resolved.
Show resolved Hide resolved
Charts,,,chart type,ontology,,,Chart types,,,,http://semanticscience.org/resource/SIO_000904,"The chart type (e.g., pie chart, table, bar, etc.)"
Charts,,,chart title,string,,,,,,,http://semanticscience.org/resource/SIO_000473,A title to be displayed above a chart
Charts,,,chart subtitle,string,,,,,,,http://semanticscience.org/resource/SIO_000474,A subtitle to be displayed below the title. This text provides additional context for the data points displayed in the chart.
Charts,,,x axis label,string,,,,,,,"http://semanticscience.org/resource/SIO_000452,http://semanticscience.org/resource/SIO_000179,http://semanticscience.org/resource/SIO_001316",Text to be displayed along the x-axis (horizontal axis)
Charts,,,x axis min value,int,,,,,,,"http://semanticscience.org/resource/SIO_000452,http://semanticscience.org/resource/SIO_001113",A value that indicates the minimum threshold to display on the x-axis (applies only to continuous variables)
Charts,,,x axis max value,int,,,,,,,"http://semanticscience.org/resource/SIO_000452,http://semanticscience.org/resource/SIO_001114",A value that indicates the minimum threshold to display on the x-axis (applies only to continuous variables)
Charts,,,x axis ticks,int_array,,,,,,,"http://semanticscience.org/resource/SIO_000452,http://semanticscience.org/resource/SIO_000915",An array of numbers that indicate the breakpoints on the x-axis
Charts,,,y axis label,string,,,,,,,"http://semanticscience.org/resource/SIO_000453,http://semanticscience.org/resource/SIO_000179",Text to be displayed along the y-axis (vertical axis)
Charts,,,y axis min value,int,,,,,,,"http://semanticscience.org/resource/SIO_000453,http://semanticscience.org/resource/SIO_001113",A value that indicates the minimum threshold to display on the y-axis (applies only to continuous variables)
Charts,,,y axis max value,int,,,,,,,"http://semanticscience.org/resource/SIO_000453,http://semanticscience.org/resource/SIO_001114",A value that indicates the minimum threshold to display on the y-axis (applies only to continuous variables)
Charts,,,y axis ticks,int_array,,,,,,,"http://semanticscience.org/resource/SIO_000453,http://semanticscience.org/resource/SIO_000915,http://semanticscience.org/resource/SIO_001316",An array of numbers that indicate the breakpoints on the y-axis
Charts,,,top margin,int,,,,,15,"(function () {
if (topMargin !== null && topMargin < 0) {
return ""The top margin cannot be less than 0""
}
if (topMargin !== null && topMargin > 250) {
return ""The top margin cannot be more than 250""
}
})();",http://purl.obolibrary.org/obo/NCIT_C69210,A number that indicates the amount of white space to add to the top of the chart
Charts,,,right margin,int,,,,,15,"(function () {
if (rightMargin !== null && rightMargin < 0) {
return ""The right margin cannot be less than 0""
}
if (rightMargin !== null && rightMargin > 250) {
return ""The right margin cannot be more than 250""
}
})();",http://purl.obolibrary.org/obo/NCIT_C69201,A number that indicates the amount of white space to add to the right of the chart
Charts,,,bottom margin,int,,,,,60,"(function () {
if (bottomMargin !== null && bottomMargin < 0) {
return ""The bottom margin cannot be less than 0""
}
if (bottomMargin !== null && bottomMargin > 250) {
return ""The bottom margin cannot be more than 250""
}
})();",http://purl.obolibrary.org/obo/NCIT_C69210,A number that indicates the amount of white space to add to the bottom of the chart
Charts,,,left margin,int,,,,,80,"(function () {
if (leftMargin !== null && leftMargin < 0) {
return ""The left margin cannot be less than 0""
}
if (leftMargin !== null && leftMargin > 250) {
return ""The left margin cannot be more than 250""
}
})();",http://purl.obolibrary.org/obo/NCIT_C69201,A number that indicates the amount of white space to add to the left of the chart
Charts,,,legend position,ontology,,,Legend positions,,top,,"http://semanticscience.org/resource/SIO_000468,http://semanticscience.org/resource/SIO_000056",The position of the legend around the chart.
Charts,,,data points,refback,,,Chart data,included in chart,,,http://semanticscience.org/resource/SIO_000546,Data that is prepared to be used in a chart
Charts,,,dashboard page,ref,,,Dashboard pages,,,,http://semanticscience.org/resource/SIO_000302,
Chart data,,,,,,,,,,,http://semanticscience.org/resource/SIO_000089,Data used in a visualisation
davidruvolo51 marked this conversation as resolved.
Show resolved Hide resolved
Chart data,,,data point id,string,1,TRUE,,,,,"http://semanticscience.org/resource/SIO_000465,http://semanticscience.org/resource/SIO_000115",A value that identifies this data point in a chart
Chart data,,,data point name,string,,,,,,,"http://semanticscience.org/resource/SIO_000465,http://semanticscience.org/resource/SIO_000116","A label to be displayed in the chart that visually identifies the data point. By default, all data points should have a name and value defined. If you would like to create a chart that displays number of participants by disease and research centre, then you would put the diseases in the ""name"" column and list the centres in the ""data point primary category"" column."
Chart data,,,data point value,decimal,,,,,,,http://semanticscience.org/resource/SIO_000465,"The calculated value of the data point. This is value that is described by the entry in the ""name"" column and further grouped by the primary and secondary categories."
Chart data,,,data point value label,string,,,,,,,"http://semanticscience.org/resource/SIO_000465,http://semanticscience.org/resource/SIO_000179","An alternative label that will be displayed in the chart in place of the actual value. This is useful if you would like to format the values in the specific format (e.g., ""10.05% increase"" instead of ""10.05"")"
Chart data,,,data point series,string,,,,,,,"http://semanticscience.org/resource/SIO_000465,http://semanticscience.org/resource/SIO_000464",A data series is a data set composed of related values displayed in a statistical graph. It is intended to use this column to link all points of a group to be displayed a line chart.
Chart data,,,data point primary category,string,,,,,,,"http://semanticscience.org/resource/SIO_000465,http://semanticscience.org/resource/SIO_000455,http://semanticscience.org/resource/SIO_000456","A primary category axis is a category axis that either defines the sole value range or holds the larger set of categorical values specified by the secondary category axis. For example, if you need to group the categories listed in the name column, then define the grouping levels here."
Chart data,,,data point secondary category,string,,,,,,,"http://semanticscience.org/resource/SIO_000465,http://semanticscience.org/resource/SIO_000455,http://semanticscience.org/resource/SIO_000457",A secondary category axis is a category axis that defines a finer granular part (or subset) of the value range of the primary category axis.
Chart data,,,data point primary category label,string,,,,,,,http://semanticscience.org/resource/SIO_000179,"An alternative label that will be displayed instead of the value in ""data point primary category"" column"
Chart data,,,data point secondary category label,string,,,,,,,http://semanticscience.org/resource/SIO_000179,"An alternative label that will be displayed instead of the value in ""data point secondary category"" column"
Chart data,,,data point time,string,,,,,,,"http://semanticscience.org/resource/SIO_000465,http://semanticscience.org/resource/SIO_000417","A time interval is a contiguous temporal region having some duration. E.g., ""2020,2021,2022,..."" or ""12, 13,14"" (years, months, etc.)"
Chart data,,,data point time unit,string,,,,,,,"http://semanticscience.org/resource/SIO_000465,http://semanticscience.org/resource/SIO_000074","A unit that provides context to the value in the column ""data point time"". E.g., ""months"", ""years"", etc."
Chart data,,,data point color,string,,,,,,,"http://semanticscience.org/resource/SIO_000465,http://schema.org/color","A colour value (RGB, HEX, HSL, etc.) used to style the data point"
Chart data,,,data point description,text,,,,,,,"http://semanticscience.org/resource/SIO_000465,http://semanticscience.org/resource/SIO_000136",A description is language entity in which elements of a language (formal or natural) are used to characterize an entity. This is useful if you are using tooltips in charts. Information placed in this column could be displayed in the charts.
Chart data,,,data point order,int,,,,,,,"http://semanticscience.org/resource/SIO_000465,http://semanticscience.org/resource/SIO_001316",A numerical value indicating the sorting method for data points
Chart data,,,included in chart,ref,,,Charts,,,,"http://semanticscience.org/resource/SIO_000465,http://edamontology.org/topic_0092",A value that links one or more data points to a visualisation
10 changes: 10 additions & 0 deletions data/ui_dashboards/ontologies/Chart types.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
order,name,label,tags,parent,codesystem,code,ontologyTermURI,definition
,data highlight,,,,,,,
davidruvolo51 marked this conversation as resolved.
Show resolved Hide resolved
,horizontal bar chart,,,,SIO,SIO:000444,http://semanticscience.org/resource/SIO_000444,
,line graph,,,,SIO,SIO:000442,http://semanticscience.org/resource/SIO_000442,
,map,,,,SIO,SIO:000906,http://semanticscience.org/resource/SIO_000906,
,pie chart,,,,SIO,SIO:000929,http://semanticscience.org/resource/SIO_000929,
,progress meter,,,,,,,
,scatterplot,,,,SIO,SIO:000423,http://semanticscience.org/resource/SIO_000423,
,table,,,,SIO,SIO:000419,http://semanticscience.org/resource/SIO_000419,
,vertical bar chart,,,,SIO,SIO:000445,http://semanticscience.org/resource/SIO_000445,
5 changes: 5 additions & 0 deletions data/ui_dashboards/ontologies/Legend positions.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
name,definition
top,"A vertical position that indicates a chart legend should be placed before (i.e., above) a chart."
right,A horizontal position that indicates a chart legend should be placed on the righthand side of a chart.
bottom,"A vertical position that indicates a chart legend should be placed after (i.e., below) a chart."
left,A horizontal position that indicates a chart legend should be placed on the lefthand side of a chart.