You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our objects representation of a features within a paper looks like the sample provided below. The challenge is to provide a table view for these with a filter on parents. The filter works based on which of the parents within this object are selected (expanded). Right now we are doing this if nested if statements which greatly limits our flexibility toward changing the structure of the response object.
This is an example of how we handle this object, we check for the expanded parents and set a list headers for them:
The code is in client/src/components/View/TableView/hooks/data-handler.ts
Acceptance criteria:
No hard column names for generating a row for our data table
Given the response object and list of parents like [{name: 'condition', expanded: false},{name: 'behavior', expanded: true}] we should be able to get an array of headers and an array of objects where the keys of the objects is the same to headers (data for a table essentially) so we can display them.
An example of data object:
papers_results = [
{
paper: [
{
name: "whiting-watts-2024-a-framework-for-quantifying-individual-and-collective-common-sense.pdf",paper_id: "doi/something",authors: ["Mark Whiting", "Duncan Watts"],experiment: [
{
adults: "adults",age_mean: "--",age_sd: "--",compensation: "Paid via Amazon Mechanical Turk",demographics_condition: "N",description:"This study investigates the properties and commonness of common sense knowledge by analyzing human agreement on a range of claims from various sources. It aims to quantify the extent to which individual claims are perceived as commonsensical and how much these perceptions are shared among people.",
name: "Quantifying Common Sense",female_perc: "--",gender_other: "--",language: "English",language_secondary: "NA",male_perc: "--",participant_source: "Amazon Mechanical Turk",participant_source_category: "online panel",population_other:"Participants are diverse in demographic and socioeconomic status.",
sample_size_analyzed: 4407,sample_size_notes:"Each of the 4407 claims was rated by an average of 23.44 individuals out of 2046 participants.",
sample_size_randomized: 2046,units_analyzed: "claims",units_randomized: "claims",condition: [
{
behavior: [
{
description:"Participants rate their agreement with the claim.",
focal: "focal",name: "Agreement with Claim",priority: "primary"
},
{
description: "None.",focal: "not",name: "I don't know",priority: "secondary"
}
],description:"Claims generated through direct human input based on specific prompts.",
message: "Yes",name: "Human-Generated Claims",type: "treatment"
},
{
behavior: [
{
description:"Participants rate their agreement with the claim.",
focal: "focal",name: "Agreement with Claim",priority: "primary"
}
],description:"Claims generated by artificial intelligence models such as ConceptNet and Atomic.",
message: "Yes",name: "AI-Generated Claims",type: "treatment"
},
{
behavior: [
{
description:"Participants rate their agreement with the claim.",
focal: "focal",name: "Agreement with Claim",priority: "primary"
}
],description:"Claims extracted from natural text sources such as news articles, political emails, and aphorisms.",
message: "Yes",name: "Claims in Natural Text",type: "treatment"
}
]
}
]
}
]
}
]
The text was updated successfully, but these errors were encountered:
Our objects representation of a features within a paper looks like the sample provided below. The challenge is to provide a table view for these with a filter on parents. The filter works based on which of the parents within this object are selected (expanded). Right now we are doing this if nested
if
statements which greatly limits our flexibility toward changing the structure of the response object.This is an example of how we handle this object, we check for the expanded parents and set a list headers for them:
Then show set the data for a row on table by looping through them:
The code is in
client/src/components/View/TableView/hooks/data-handler.ts
Acceptance criteria:
[{name: 'condition', expanded: false},{name: 'behavior', expanded: true}]
we should be able to get an array of headers and an array of objects where the keys of the objects is the same to headers (data for a table essentially) so we can display them.An example of data object:
The text was updated successfully, but these errors were encountered: