Skip to content

Commit

Permalink
pull warning up to analysis panel. TODO: conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
mccalluc committed Nov 8, 2024
1 parent 16463b4 commit 9cd991d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 14 deletions.
12 changes: 12 additions & 0 deletions dp_creator_ii/app/analysis_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from dp_creator_ii.utils.csv_helper import read_csv_ids_labels, read_csv_ids_names
from dp_creator_ii.app.components.outputs import output_code_sample, demo_tooltip
from dp_creator_ii.utils.templates import make_privacy_loss_block
from dp_creator_ii.app.components.column_module import col_widths


def analysis_ui():
Expand All @@ -24,6 +25,17 @@ def analysis_ui():
[],
),
ui.output_ui("columns_ui"),
ui.layout_columns(
[],
[
ui.markdown(
"This simulation assumes a normal distribution "
"between the specified lower and upper bounds. "
"Your data file has not been read except to determine the columns."
)
],
col_widths=col_widths,
),
ui.markdown(
"What is your privacy budget for this release? "
"Values above 1 will add less noise to the data, "
Expand Down
23 changes: 9 additions & 14 deletions dp_creator_ii/app/components/column_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@

default_weight = 2

col_widths = {
# Controls stay roughly a constant width;
# Graph expands to fill space.
"sm": (4, 8),
"md": (3, 9),
"lg": (2, 10),
}


@module.ui
def column_ui(): # pragma: no cover
Expand Down Expand Up @@ -38,24 +46,11 @@ def column_ui(): # pragma: no cover
),
],
[
# TODO: This doesn't need to be repeated: could just go once at the top.
# https://github.com/opendp/dp-creator-ii/issues/138
ui.markdown(
"This simulation assumes a normal distribution "
"between the specified lower and upper bounds. "
"Your data file has not been read except to determine the columns."
),
ui.output_plot("column_plot", height="300px"),
# Make plot smaller than default: about the same size as the other column.
output_code_sample("Column Definition", "column_code"),
],
col_widths={
# Controls stay roughly a constant width;
# Graph expands to fill space.
"sm": (4, 8),
"md": (3, 9),
"lg": (2, 10),
},
col_widths=col_widths,
)


Expand Down

0 comments on commit 9cd991d

Please sign in to comment.