Skip to content

Commit b0fecb6

Browse files
committed
moved styling elements to right side panel, adapted focus elements autocomplete to list elements from filtered graph only
1 parent 61acb7b commit b0fecb6

4 files changed

Lines changed: 257 additions & 143 deletions

File tree

src/graph_lens_lite.html

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,6 @@ <h5 class="purple">Shown:
6161
</h5>
6262
<hr>
6363
<div id="metricsContainer"></div>
64-
<div class="edit-container show-on-edit">
65-
<div id="staticStyleDiv"></div>
66-
<hr>
67-
</div>
6864
<div id="filterContainer"></div>
6965
</div>
7066
</div>
@@ -103,11 +99,11 @@ <h5 class="purple">Shown:
10399
</div>
104100
<div id="rightSidebar">
105101
<div id="rightSidebarContentContainer">
106-
<div class="header-row">
107-
<h3>Styling Panel</h3>
108-
<button id="closeStylingPanelBtn" class="small-btn red" title="Close styling panel" onclick="cache.ui.toggleStylingPanel()">×</button>
109-
</div>
110-
<hr>
102+
<!-- <div class="header-row">-->
103+
<!-- <h3>Styling Panel</h3>-->
104+
<!-- <button id="closeStylingPanelBtn" class="small-btn red" title="Close styling panel" onclick="cache.ui.toggleStylingPanel()">×</button>-->
105+
<!-- </div>-->
106+
<!-- <hr>-->
111107
<div id="stylingPanelContent">
112108
<!-- Styling controls will be populated here -->
113109
</div>

src/managers/ui.js

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,13 @@ class UIManager {
171171
this.hideBottomBar();
172172
queryBtn.classList.remove("highlight");
173173
}
174+
175+
// Wait for CSS transition to complete (300ms) before resizing graph canvas
176+
setTimeout(() => {
177+
if (this.cache.graph) {
178+
this.cache.graph.resize();
179+
}
180+
}, 300);
174181
}
175182

176183
async toggleDataEditor() {
@@ -190,6 +197,13 @@ class UIManager {
190197
}
191198

192199
await this.hideLoading();
200+
201+
// Wait for CSS transition to complete (300ms) before resizing graph canvas
202+
setTimeout(() => {
203+
if (this.cache.graph) {
204+
this.cache.graph.resize();
205+
}
206+
}, 300);
193207
}
194208

195209
showEditor(editorType) {
@@ -288,7 +302,7 @@ class UIManager {
288302
shadowBar.style.height = clampedHeight + 'px';
289303
}
290304

291-
function handleMouseUp(e) {
305+
const handleMouseUp = (e) => {
292306
if (!isResizing) return;
293307

294308
isResizing = false;
@@ -307,6 +321,11 @@ class UIManager {
307321

308322
bottomBar.style.height = finalHeight + 'px';
309323
mainContent.style.height = newMainHeight + 'px';
324+
325+
// Resize graph canvas after manual resize (no transition, resize immediately)
326+
if (this.cache.graph) {
327+
this.cache.graph.resize();
328+
}
310329
}
311330

312331
shadowBar.style.display = 'none';
@@ -332,17 +351,25 @@ class UIManager {
332351
toggleStylingPanel() {
333352
const rightSidebar = document.getElementById("rightSidebar");
334353
const styleBtn = document.getElementById("styleToggleBtn");
354+
const outerGraphContainer = document.getElementById("outerGraphContainer");
335355
const isActive = rightSidebar.classList.contains("active");
336356

337357
if (isActive) {
338358
rightSidebar.classList.remove("active");
339359
styleBtn.classList.remove("highlight");
340-
this.info("Styling panel closed");
360+
outerGraphContainer.classList.remove("styling-panel-active");
341361
} else {
342362
rightSidebar.classList.add("active");
343363
styleBtn.classList.add("highlight");
344-
this.info("Styling panel opened");
364+
outerGraphContainer.classList.add("styling-panel-active");
345365
}
366+
367+
// Wait for CSS transition to complete (300ms) before resizing graph canvas
368+
setTimeout(() => {
369+
if (this.cache.graph) {
370+
this.cache.graph.resize();
371+
}
372+
}, 300);
346373
}
347374

348375
async toggleLassoSelection() {
@@ -559,9 +586,7 @@ class UIManager {
559586
div.append(row);
560587
sliderOrDropdown.appendListeners();
561588
}
562-
const staticStyleDiv = document.getElementById("staticStyleDiv");
563-
staticStyleDiv.innerHTML = "";
564-
staticStyleDiv.appendChild(createStyleDiv(this.cache));
589+
565590
this.manageDynamicWidgets();
566591
this.handleEditModeUIChanges();
567592
this.cache.qm.updateQueryTextArea();
@@ -701,11 +726,7 @@ class UIManager {
701726
buildStylingPanelUI() {
702727
const content = document.getElementById("stylingPanelContent");
703728
content.innerHTML = "";
704-
705-
const placeholder = document.createElement("div");
706-
placeholder.className = "alert-info";
707-
placeholder.innerHTML = "<p>Styling controls will be added here.</p>";
708-
content.appendChild(placeholder);
729+
content.appendChild(createStyleDiv(this.cache));
709730
}
710731
}
711732

0 commit comments

Comments
 (0)