Skip to content

Commit

Permalink
made rebase work, added visualization in script.py
Browse files Browse the repository at this point in the history
  • Loading branch information
trbKnl committed Aug 1, 2024
1 parent 6ee0e76 commit 640e978
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 12 deletions.
11 changes: 10 additions & 1 deletion src/framework/processing/py/port/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,16 @@ def generate_consent_prompt(*args: pd.DataFrame) -> props.PropsUIPromptConsentFo
"en": f"The contents of your zipfile contents (Table {index + 1}/{len(args)})",
"nl": "De inhoud van uw zip bestand"
})
tables.append(props.PropsUIPromptConsentFormTable(f"zip_contents_{index}", table_title, df))
wordcloud = {
"title": {
"en": "You can also add visualizations",
"nl": "You can also add visualizations"
},
"type": "wordcloud",
"textColumn": "File name",
"tokenize": True,
}
tables.append(props.PropsUIPromptConsentFormTable(f"zip_contents_{index}", table_title, df, visualizations=[wordcloud]))

return props.PropsUIPromptConsentForm(
tables,
Expand Down
13 changes: 7 additions & 6 deletions src/framework/types/elements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export type PropsUI =
| PropsUICheckBox
| PropsUIRadioItem
| PropsUISpinner
| PropsUIProgress
| PropsUIProgressBar
| PropsUIHeader
| PropsUITable
| PropsUISearchBar
Expand Down Expand Up @@ -323,14 +323,15 @@ export function isPropsUISpinner(arg: any): arg is PropsUISpinner {
return isInstanceOf<PropsUISpinner>(arg, "PropsUISpinner", ["color", "spinning"])
}

// PROGRESS

export interface PropsUIProgress {
__type__: "PropsUIProgress"
// PROGRESS BAR

export interface PropsUIProgressBar {
__type__: 'PropsUIProgressBar'
percentage: number
}
export function isPropsUIProgress(arg: any): arg is PropsUIProgress {
return isInstanceOf<PropsUIProgress>(arg, "PropsUIProgress", ["percentage"])
export function isPropsUIProgress (arg: any): arg is PropsUIProgressBar {
return isInstanceOf<PropsUIProgressBar>(arg, 'PropsUIProgressBar', ['percentage'])
}

// Header
Expand Down
10 changes: 5 additions & 5 deletions src/framework/visualisation/react/ui/prompts/consent_form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,26 +211,26 @@ function prepareCopy({ donateQuestion, donateButton, description, locale }: Prop
description: Translator.translate(description ?? defaultDescription, locale),
donateQuestion: Translator.translate(donateQuestion ?? defaultDonateQuestionLabel, locale),
donateButton: Translator.translate(donateButton ?? defaultDonateButtonLabel, locale),
cancelButton: Translator.translate(cancelButtonLabel, locale),
cancelButton: Translator.translate(defaultCancelButtonLabel, locale),
}
}

const donateQuestionLabel = new TextBundle()
const defaultDonateQuestionLabel = new TextBundle()
.add('en', 'Do you want to donate the above data?')
.add('de', 'Möchten Sie die oben genannten Daten spenden?')
.add('nl', 'Wilt u de bovenstaande gegevens doneren?')

const donateButtonLabel = new TextBundle()
const defaultDonateButtonLabel = new TextBundle()
.add('en', 'Yes, donate')
.add('de', 'Ja, spenden')
.add('nl', 'Ja, doneer')

const cancelButtonLabel = new TextBundle()
const defaultCancelButtonLabel = new TextBundle()
.add('en', 'No')
.add('de', 'Nein')
.add('nl', 'Nee')

const description = new TextBundle()
const defaultDescription = new TextBundle()
.add('en', 'Determine whether you would like to donate the data below. Carefully check the data and adjust when required. With your donation you contribute to the previously described research. Thank you in advance.')
.add('de', 'Legen Sie fest, ob Sie die untenstehenden Daten spenden möchten. Überprüfen Sie die Daten sorgfältig und passen Sie sie bei Bedarf an. Mit Ihrer Spende tragen Sie zur zuvor beschriebenen Forschung bei. Vielen Dank im Voraus.')
.add('nl', 'Bepaal of u de onderstaande gegevens wilt doneren. Bekijk de gegevens zorgvuldig en pas zo nodig aan. Met uw donatie draagt u bij aan het eerder beschreven onderzoek. Alvast hartelijk dank.')

0 comments on commit 640e978

Please sign in to comment.