Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/infopanel #18

Merged
merged 2 commits into from
Jul 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ All notable changes to this project will be documented in this file.

- Prevent last selected node's icon from showing when selecting an edge.
- Pass default layout paramters to cola and fcose layouts
- Disable infopanel from expanding when selecting multiple elements

## [0.1.0] - 2024-07-11

Expand Down
12 changes: 6 additions & 6 deletions st_link_analysis/frontend/src/components/infopanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ function _updateProps(data) {
function updateInfopanel() {
const infopanel = document.getElementById(INFOPANEL_ID);
const nodeActions = document.getElementById(NODEACTIONS_ID);
const el = State.getState("selection").lastSelected;
const { selected: eles } = State.getState("selection");
let color, data, label, expanded, icon;
if (el) {
color = el.style().backgroundColor;
data = el.data();
label = data["label"] || el.group().slice(0, -1).toUpperCase();
if (eles?.length === 1) {
color = eles.first().style().backgroundColor;
data = eles.first().data();
label = data["label"] || eles.group().slice(0, -1).toUpperCase();
expanded = true;
icon = el.style()["background-image"];
icon = eles.style()["background-image"];
} else {
color = "hsla(0, 0%, 0%, 0)";
data = {};
Expand Down
Loading