fixed for basic plots, filter active
This commit is contained in:
@@ -127,7 +127,7 @@ def _():
|
|||||||
@app.cell
|
@app.cell
|
||||||
def _(S, data_validated):
|
def _(S, data_validated):
|
||||||
demographics = S.get_demographics(data_validated)[0].collect()
|
demographics = S.get_demographics(data_validated)[0].collect()
|
||||||
demographics
|
# demographics
|
||||||
return (demographics,)
|
return (demographics,)
|
||||||
|
|
||||||
|
|
||||||
@@ -135,7 +135,7 @@ def _(S, data_validated):
|
|||||||
def _(demographics):
|
def _(demographics):
|
||||||
# Demographics where 'Consumer' is null
|
# Demographics where 'Consumer' is null
|
||||||
demographics_no_consumer = demographics.filter(pl.col('Consumer').is_null())['_recordId'].to_list()
|
demographics_no_consumer = demographics.filter(pl.col('Consumer').is_null())['_recordId'].to_list()
|
||||||
demographics_no_consumer
|
# demographics_no_consumer
|
||||||
return (demographics_no_consumer,)
|
return (demographics_no_consumer,)
|
||||||
|
|
||||||
|
|
||||||
@@ -184,7 +184,7 @@ def _(S):
|
|||||||
|
|
||||||
{filter_form}
|
{filter_form}
|
||||||
''')
|
''')
|
||||||
return
|
return (filter_form,)
|
||||||
|
|
||||||
|
|
||||||
@app.cell
|
@app.cell
|
||||||
@@ -194,15 +194,15 @@ def _():
|
|||||||
|
|
||||||
|
|
||||||
@app.cell
|
@app.cell
|
||||||
def _(data_validated):
|
def _(S, data_validated, filter_form):
|
||||||
# mo.stop(filter_form.value is None, mo.md("**Please submit filter above to proceed**"))
|
mo.stop(filter_form.value is None, mo.md("**Please submit filter above to proceed**"))
|
||||||
# _d = S.filter_data(data_validated, age=filter_form.value['age'], gender=filter_form.value['gender'], income=filter_form.value['income'], ethnicity=filter_form.value['ethnicity'], consumer=filter_form.value['consumer'])
|
_d = S.filter_data(data_validated, age=filter_form.value['age'], gender=filter_form.value['gender'], income=filter_form.value['income'], ethnicity=filter_form.value['ethnicity'], consumer=filter_form.value['consumer'])
|
||||||
|
|
||||||
# # Stop execution and prevent other cells from running if no data is selected
|
# Stop execution and prevent other cells from running if no data is selected
|
||||||
# mo.stop(len(_d.collect()) == 0, mo.md("**No Data available for current filter combination**"))
|
mo.stop(len(_d.collect()) == 0, mo.md("**No Data available for current filter combination**"))
|
||||||
# data = _d
|
data = _d
|
||||||
|
|
||||||
data = data_validated
|
# data = data_validated
|
||||||
data.collect()
|
data.collect()
|
||||||
return (data,)
|
return (data,)
|
||||||
|
|
||||||
@@ -769,7 +769,7 @@ def _(S, joined_scale):
|
|||||||
data=joined_scale,
|
data=joined_scale,
|
||||||
style_color=_style,
|
style_color=_style,
|
||||||
style_traits=_traits,
|
style_traits=_traits,
|
||||||
title=f"Correlation: Speaking Style {_style} and Voice Ranking Points",
|
title=f"Correlation: Speaking Style {_style} and Voice Scale 1-10",
|
||||||
)
|
)
|
||||||
_content += f"""
|
_content += f"""
|
||||||
#### Speaking Style **{_style}**:
|
#### Speaking Style **{_style}**:
|
||||||
|
|||||||
@@ -24,12 +24,16 @@ def _():
|
|||||||
TAG_SOURCE = Path('data/reports/Perception-Research-Report_2-2.pptx')
|
TAG_SOURCE = Path('data/reports/Perception-Research-Report_2-2.pptx')
|
||||||
TAG_TARGET = Path('data/reports/Perception-Research-Report_2-2_tagged.pptx')
|
TAG_TARGET = Path('data/reports/Perception-Research-Report_2-2_tagged.pptx')
|
||||||
TAG_IMAGE_DIR = Path('figures/2-2-26')
|
TAG_IMAGE_DIR = Path('figures/2-2-26')
|
||||||
return TAG_IMAGE_DIR, TAG_SOURCE, TAG_TARGET
|
return TAG_IMAGE_DIR, TAG_SOURCE
|
||||||
|
|
||||||
|
|
||||||
@app.cell
|
@app.cell
|
||||||
def _(TAG_IMAGE_DIR, TAG_SOURCE, TAG_TARGET):
|
def _(TAG_IMAGE_DIR, TAG_SOURCE):
|
||||||
utils.update_ppt_alt_text(ppt_path=TAG_SOURCE, image_source_dir=TAG_IMAGE_DIR, output_path=TAG_TARGET)
|
utils.update_ppt_alt_text(
|
||||||
|
ppt_path=TAG_SOURCE,
|
||||||
|
image_source_dir=TAG_IMAGE_DIR,
|
||||||
|
# output_path=TAG_TARGET
|
||||||
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
@@ -43,20 +47,20 @@ def _():
|
|||||||
|
|
||||||
@app.cell
|
@app.cell
|
||||||
def _():
|
def _():
|
||||||
REPLACE_SOURCE = Path('data/reports/Perception-Research-Report_2-2_tagged.pptx')
|
REPLACE_SOURCE = Path('data/reports/Perception-Research-Report_2-2.pptx')
|
||||||
REPLACE_TARGET = Path('data/reports/Perception-Research-Report_2-2.pptx')
|
REPLACE_TARGET = Path('data/reports/Perception-Research-Report_2-2_updated.pptx')
|
||||||
|
|
||||||
NEW_IMAGES_DIR = Path('figures/2-2-26')
|
NEW_IMAGES_DIR = Path('figures/2-2-26')
|
||||||
return NEW_IMAGES_DIR, REPLACE_SOURCE, REPLACE_TARGET
|
return NEW_IMAGES_DIR, REPLACE_SOURCE
|
||||||
|
|
||||||
|
|
||||||
@app.cell
|
@app.cell
|
||||||
def _(NEW_IMAGES_DIR, REPLACE_SOURCE, REPLACE_TARGET):
|
def _(NEW_IMAGES_DIR, REPLACE_SOURCE):
|
||||||
# get all files in the image source directory and subdirectories
|
# get all files in the image source directory and subdirectories
|
||||||
results = utils.pptx_replace_images_from_directory(
|
results = utils.pptx_replace_images_from_directory(
|
||||||
REPLACE_SOURCE, # Source presentation path,
|
REPLACE_SOURCE, # Source presentation path,
|
||||||
NEW_IMAGES_DIR, # Source directory with new images
|
NEW_IMAGES_DIR, # Source directory with new images
|
||||||
REPLACE_TARGET # Output path (optional, defaults to overwrite)
|
# REPLACE_TARGET # Output path (optional, defaults to overwrite)
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user