Skip to content

Commit 4f0c672

Browse files
committed
update things
1 parent 2042193 commit 4f0c672

File tree

8 files changed

+365
-186
lines changed

8 files changed

+365
-186
lines changed

dev/bundle.js

Lines changed: 304 additions & 160 deletions
Large diffs are not rendered by default.

dev/bundle.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/xaiflow/mlflow_plugin.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,6 @@ def _generate_html_content(
302302
with open(output_path, 'w', encoding='utf-8') as f:
303303
f.write(html_content)
304304

305-
import pdb; pdb.set_trace()
306305
with open('test_report.html', 'w', encoding='utf-8') as f:
307306
f.write(html_content)
308307

src/xaiflow/templates/assets/bundle.js

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/xaiflow/templates/assets/bundle.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/xaiflow/templates/components/DeepDiveManager.svelte

Lines changed: 45 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
let currentPage = $state(0);
3535
let totalObservations = shapValues.length;
3636
let totalPages = Math.ceil(totalObservations / maxDisplayedValues);
37+
let filterText = $state("");
38+
let dropdownOpen = $state(false);
3739
3840
console.log('DeepDiveManager: 1/3 command in file');
3941
let pagedObservations = $derived(
@@ -60,6 +62,17 @@
6062
currentPage -= 1;
6163
}
6264
}
65+
function handleInputFocus() {
66+
dropdownOpen = true;
67+
}
68+
function handleInputBlur(event: FocusEvent) {
69+
// Delay closing to allow click selection
70+
setTimeout(() => { dropdownOpen = false; }, 100);
71+
}
72+
function handleObservationClick(idx: number) {
73+
selectedObservationIndex = idx;
74+
dropdownOpen = false;
75+
}
6376
6477
$effect(() => {
6578
console.log('Selected observation index:', selectedObservationIndex);
@@ -74,18 +87,41 @@
7487
console.log('Current page:', currentPage);
7588
console.log('Total pages:', totalPages);
7689
});
90+
91+
let allObservations = $derived(
92+
Array.from({length: totalObservations}, (_, idx) => ({
93+
name: `Observation ${idx + 1}`,
94+
index: idx
95+
}))
96+
);
97+
98+
let filteredObservations = $derived(
99+
allObservations.filter(obs =>
100+
obs.name.toLowerCase().includes(filterText.toLowerCase()) ||
101+
obs.index.toString().includes(filterText)
102+
).slice(0, maxDisplayedValues)
103+
);
77104
</script>
78105

79106
<div>
80-
<div class="observation-dropdown">
81-
<label for="observation-select">Select Observation:</label>
82-
<select id="observation-select" bind:value={selectedObservationIndex}>
83-
{#each pagedObservations as obs}
84-
<option value={obs.index}>{obs.name}</option>
85-
{/each}
86-
</select>
87-
<button on:click={prevPage} disabled={currentPage === 0}>Prev</button>
88-
<button on:click={nextPage} disabled={currentPage === totalPages - 1}>Next</button>
107+
<div class="observation-dropdown" style="position:relative;max-width:300px;">
108+
<label for="observation-filter">Filter Observations:</label>
109+
<input id="observation-filter" type="text" bind:value={filterText} placeholder="Type to filter..."
110+
on:focus={handleInputFocus} on:blur={handleInputBlur} autocomplete="off" />
111+
{#if dropdownOpen}
112+
<ul class="dropdown-list" style="position:absolute;z-index:10;top:40px;left:0;width:100%;background:white;border:1px solid #ccc;max-height:200px;overflow-y:auto;padding:0;margin:0;list-style:none;">
113+
{#each filteredObservations as obs}
114+
<li style="padding:8px;cursor:pointer;" on:mousedown={() => handleObservationClick(obs.index)}>{obs.name}</li>
115+
{/each}
116+
{#if filteredObservations.length === 0}
117+
<li style="padding:8px;color:#888;">No matches</li>
118+
{/if}
119+
</ul>
120+
{/if}
121+
<div style="margin-top:8px;">
122+
<button on:click={prevPage} disabled={currentPage === 0}>Prev</button>
123+
<button on:click={nextPage} disabled={currentPage === totalPages - 1}>Next</button>
124+
</div>
89125
</div>
90126
<DeepDiveChart
91127
shapValues={shapValues}

test_plugin_auto_mpg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def test_plugin():
5555
rfc.fit(X, y)
5656
ex = shap.TreeExplainer(rfc)
5757
shap_values = ex(X)
58-
import pdb; pdb.set_trace()
58+
5959
plugin = XaiflowPlugin()
6060
print("✅ Plugin initialized successfully")
6161

test_report.html

Lines changed: 8 additions & 8 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)