Pin a legend or shape group to the editor viewport

Open
#5,847 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
javascript
Domain
design, frontend

Research direction

Start by locating the editor’s viewport and selection handling, then trace how shapes and groups are positioned and scaled during pan and zoom. The issue names no files or tests, so first identify the relevant entry points and existing ways to keep content visible. Done means a selected shape or group can be pinned at a chosen viewport position and fixed screen size, then unpinned.

Written by the indexing model from the issue text.

Description

enhancement

Problem
When navigating a large diagram, the legend moves off-screen as I pan or zoom. I have to return to the legend to check what a color or symbol means, then find my place again.

Requested enhancement
Add a “Pin to viewport” option for a selected shape or group. For example, I could pin a legend to the upper-right corner of the editor and keep it readable at a fixed on-screen size while I pan or zoom. An Unpin action would dismiss the view.

Alternatives considered
Locking the legend prevents accidental edits, but the legend still moves with the canvas. A Scratchpad copy can stay in the sidebar, but the preview may be too small to read.

I searched the issue tracker for matching feature requests and found no duplicate.

Dominant language
JavaScript
Stars
9.4k
Forks
1.4k
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from jgraph/drawio

All issues in jgraph/drawio

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.