Skip to content

Commit 9d6d805

Browse files
committed
moved style button to selection panel, added close buttons to bottm and sidebar
1 parent 1b20631 commit 9d6d805

4 files changed

Lines changed: 41 additions & 1 deletion

File tree

src/graph/core.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -911,6 +911,9 @@ class GraphCoreManager {
911911
case "y":
912912
this.cache.ui.toggleStylingPanel();
913913
break;
914+
case "l":
915+
await this.cache.ui.toggleLassoSelection();
916+
break;
914917
default:
915918
break;
916919
}

src/graph_lens_lite.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ <h3>Graph Lens Lite</h3>
3232
<button id="metricsToggleBtn" class="showOnLoad medium-btn" title="Toggle network metrics panel (M)" onclick="cache.metrics.toggleUI()">📊</button>
3333
<button id="dataToggleBtn" class="showOnLoad medium-btn" title="Toggle data editor (D)" onclick="cache.ui.toggleDataEditor()">🔢</button>
3434
<button id="queryToggleBtn" class="showOnLoad medium-btn" title="Toggle query editor (Q)" onclick="cache.ui.toggleQueryEditor()">📝</button>
35-
<button id="styleToggleBtn" class="showOnLoad medium-btn" title="Open styling panel (Y)" onclick="cache.ui.toggleStylingPanel()">🎨</button>
3635
<button id="editBtn" class="showOnLoad medium-btn" title="Toggle Edit mode (E)" onclick="cache.ui.toggleEditMode()">⚙️</button>
3736
</div>
3837
</div>
@@ -81,6 +80,7 @@ <h5 class="purple">Shown:
8180
<button id="deselectEdgesBtn" class="tiny-btn red disabled" title="Clear edge selection"
8281
onclick="cache.sm.toggleSelectionForAllEdges(false)">×</button>
8382
<hr>
83+
<button id="styleToggleBtn" class="small-btn showOnLoad" title="Open styling panel (Y)" onclick="cache.ui.toggleStylingPanel()">🎨</button>
8484
<div id="lassoWrapper" class="showOnLoad small-btn"><button id="lassoToggleBtn" class="lasso-icon" title="Toggle lasso selection (L)" onclick="cache.ui.toggleLassoSelection()"></button></div>
8585
<div class="button-separator"></div>
8686
<button class="small-btn disabled" title="Reset style for selected elements" id="resetSelectedElementsStyleBtn"
@@ -102,6 +102,8 @@ <h5 class="purple">Shown:
102102
<div id="innerGraphContainer"></div>
103103
</div>
104104
<div id="rightSidebar">
105+
<button id="rightSidebarCloseBtn" class="small-btn red panel-close-btn" title="Close styling panel"
106+
onclick="cache.ui.toggleStylingPanel()">×</button>
105107
<div id="rightSidebarContentContainer">
106108
<!-- <div class="header-row">-->
107109
<!-- <h3>Styling Panel</h3>-->
@@ -115,6 +117,8 @@ <h5 class="purple">Shown:
115117
</div>
116118
</div>
117119
<div id="bottomBar">
120+
<button id="bottomBarCloseBtn" class="small-btn red panel-close-btn" title="Close bottom panel"
121+
onclick="cache.ui.closeBottomBar()">×</button>
118122
<div class="resize-handle"></div>
119123
<div id="queryEditor" class="editor-panel">
120124
<div id="queryOverlay" aria-hidden="true"></div>

src/managers/ui.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,31 @@ class UIManager {
180180
}, 300);
181181
}
182182

183+
async closeBottomBar() {
184+
const queryBtn = document.getElementById("queryToggleBtn");
185+
const dataBtn = document.getElementById("dataToggleBtn");
186+
187+
if (dataBtn.classList.contains("highlight")) {
188+
await this.toggleDataEditor();
189+
return;
190+
}
191+
192+
if (queryBtn.classList.contains("highlight")) {
193+
this.toggleQueryEditor();
194+
return;
195+
}
196+
197+
const bottomBar = document.getElementById("bottomBar");
198+
if (bottomBar.classList.contains("active")) {
199+
this.hideBottomBar();
200+
setTimeout(() => {
201+
if (this.cache.graph) {
202+
this.cache.graph.resize();
203+
}
204+
}, 300);
205+
}
206+
}
207+
183208
async toggleDataEditor() {
184209
const queryBtn = document.getElementById("queryToggleBtn");
185210
const dataBtn = document.getElementById("dataToggleBtn");

src/style.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ body, html {
4343
flex-direction: column;
4444
flex-shrink: 0;
4545
border-left: 0 solid #ccc;
46+
position: relative;
4647
}
4748

4849
#rightSidebar.active {
@@ -119,6 +120,13 @@ body, html {
119120
position: relative;
120121
}
121122

123+
.panel-close-btn {
124+
position: absolute;
125+
top: 8px;
126+
right: 8px;
127+
z-index: 1002;
128+
}
129+
122130
.resize-shadow-bar {
123131
position: fixed;
124132
left: 0;

0 commit comments

Comments
 (0)