Skip to content

Commit

Permalink
Add tooltip to sample button
Browse files Browse the repository at this point in the history
  • Loading branch information
WarmCyan committed Aug 21, 2023
1 parent 5c26aa9 commit 4acdbd3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
7 changes: 5 additions & 2 deletions icat/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def __init__(
v_model="",
dense=True,
append_icon="mdi-magnify",
label="Search",
label="Search (use 'id:X' to search index)",
clearable=True,
clear_icon="mdi-close",
style_="padding-top: 7px",
Expand Down Expand Up @@ -525,7 +525,10 @@ def _search_box_filter(
column: str,
) -> pd.DataFrame:
"""This function searches for a given string in code:`pattern` and applies it to the code:`column` within the
code:`df`."""
code:`df`.
if the search is "id:" or "ID:", we directly search the index column instead
"""
# TODO: possibly move to a utils.py
if not pattern:
return df
Expand Down
11 changes: 8 additions & 3 deletions icat/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,14 @@ def _template(self):
<v-btn x-small class="purple darken-1" @click.stop="addToExampleAnchor(item.id)">
example
</v-btn>
<v-btn x-small v-if="!item.in_sample" @click.stop="addToSample(item.id)">
sample
</v-btn>
<v-tooltip bottom>
<template v-slot:activator="{ on, attrs }">
<v-btn x-small v-if="!item.in_sample" @click.stop="addToSample(item.id)" v-bind="attrs" v-on="on">
sample
</v-btn>
</template>
<span>Add this instance to the current sample set.</span>
</v-tooltip>
<div v-html="item.labeled" />
</td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion notebooks/archive/Example3-Model.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
},
"outputs": [],
"source": [
"model.data.active_data"
"model.data.table.options"
]
},
{
Expand Down

0 comments on commit 4acdbd3

Please sign in to comment.