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

Added ROI Set name to the ROI menu #1875

Merged
merged 4 commits into from
Aug 16, 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
3 changes: 2 additions & 1 deletion css/_igv-menu-popup.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ $igv-menu-popup-grey: #7F7F7F;

//min-width: 132px;
width: max-content;

max-width: 400px;

//z-index: 4096;
z-index: 512;

Expand Down
1 change: 1 addition & 0 deletions css/igv.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/embedCss.js

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions js/roi/ROIManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ class ROIManager {
if (features) {

for (let feature of features) {

const regionKey = createRegionKey(chr, feature.start, feature.end)

const {
Expand Down Expand Up @@ -243,8 +242,7 @@ class ROIManager {
event.stopPropagation()

const {x, y} = DOMUtils.translateMouseCoordinates(event, columnContainer)
const isUserDefined = roiSet.isUserDefined
this.roiMenu.present(feature, isUserDefined, event, this, columnContainer, regionElement)
this.roiMenu.present(feature, roiSet, event, this, columnContainer, regionElement)
})


Expand Down
15 changes: 8 additions & 7 deletions js/roi/ROIMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,17 @@ class ROIMenu {

}

async present(feature, isUserDefined, event, roiManager, columnContainer, regionElement) {
const menuItems = this.menuItems(feature, isUserDefined, event, roiManager, columnContainer, regionElement)
async present(feature, roiSet, event, roiManager, columnContainer, regionElement) {
const menuItems = this.menuItems(feature, roiSet, event, roiManager, columnContainer, regionElement)
this.browser.menuPopup.presentTrackContextMenu(event, menuItems)
}

menuItems(feature, isUserDefined, event, roiManager, columnContainer, regionElement) {
menuItems(feature, roiSet, event, roiManager, columnContainer, regionElement) {
const items = feature.name ? [`<b>${feature.name}</b><br/>`] : []
if ('name' in roiSet) items.push(`<b>ROI Set: ${roiSet.name}</b>`)
if (items.length > 0) items.push(`<hr/>`)

const items = [`<b>${feature.name || ''}</b>`,]

if (isUserDefined) {
if (roiSet.isUserDefined) {
items.push(
{
label: 'Set description ...',
Expand Down Expand Up @@ -103,7 +104,7 @@ class ROIMenu {
}


if (isUserDefined) {
if (roiSet.isUserDefined) {
items.push(
'<hr/>',
{
Expand Down
Loading