Skip to content

Commit

Permalink
hide and export
Browse files Browse the repository at this point in the history
  • Loading branch information
interrogator committed Dec 4, 2019
1 parent 4209a47 commit 021f515
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions explorer/parts/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ def _update_frequencies(df, deletable):
"name": i.lstrip("_"),
"id": i,
"deletable": deletable and "_" + i not in names,
"hideable": True,
}
for i in df.columns
]
Expand All @@ -134,6 +135,7 @@ def _update_frequencies(df, deletable):
"name": [x.strip('_') for x in i],
"id": "-".join(i),
"deletable": ['_' + x in names for x in i],
"hideable": True,
}
for i in df.columns
]
Expand All @@ -158,6 +160,7 @@ def _update_concordance(df, deletable):
"name": _capitalize_first(SHORT_TO_COL_NAME.get(i, i)),
"id": i,
"deletable": i not in cannot_delete and deletable,
"hideable": True,
}
for i in df.columns
]
Expand All @@ -178,6 +181,7 @@ def _update_conll(df, deletable, drop_govs):
"name": _capitalize_first(SHORT_TO_COL_NAME.get(i, i)),
"id": i,
"deletable": i not in cannot_delete and deletable,
"hideable": True,
}
for i in df.columns
]
Expand Down
10 changes: 10 additions & 0 deletions explorer/parts/tabs.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ def _build_dataset_space(df, config):
"name": _capitalize_first(SHORT_TO_COL_NAME.get(i, i)).replace("_", " "),
"id": i,
"deletable": False,
"hideable": True,
}
for i in df.columns
]
Expand All @@ -122,6 +123,9 @@ def _build_dataset_space(df, config):
style_header=style.BOLD_DARK,
style_cell_conditional=style.LEFT_ALIGN,
style_data_conditional=style.INDEX + style.STRIPES,
merge_duplicate_headers=True,
export_format='xlsx',
export_headers='display',
)
# add loading
conll_table = dcc.Loading(
Expand Down Expand Up @@ -212,6 +216,8 @@ def _build_frequencies_space(corpus, table, config):
style_cell_conditional=style.LEFT_ALIGN,
style_data_conditional=[style_index] + style.STRIPES,
merge_duplicate_headers=True,
export_format='xlsx',
export_headers='display',
)

sty = {"width": "20%", **style.CELL_MIDDLE_35, **style.MARGIN_5_MONO}
Expand Down Expand Up @@ -278,6 +284,7 @@ def _build_concordance_space(df, config):
"name": SHORT_TO_COL_NAME.get(i, i),
"id": i,
"deletable": i not in ["left", "match", "right"],
"hideable": True,
}
for i in df.columns
]
Expand Down Expand Up @@ -308,6 +315,9 @@ def _build_concordance_space(df, config):
style_header=style.BOLD_DARK,
style_cell_conditional=style.LEFT_ALIGN_CONC,
style_data_conditional=style_data,
merge_duplicate_headers=True,
export_format='xlsx',
export_headers='display',
)
],
)
Expand Down

0 comments on commit 021f515

Please sign in to comment.