plotly / plotly/plotly.js

Use viewbox for svg elements

Open
#7,064 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature P3
Dominant language
JavaScript
Stars
18.3k
Forks
2k
Avg merge
2d 12h
Merged PRs (30d)
28

Description

Currently plotly uses a fixed width/height layout for the svg elements. Even when using a responsive layout, the svg gets sized to fixed width/height box according to the outer div. This means that any css styling, and in particular @media print do not get applied. Is there any reason not to use a layout that is actually use controllable / customizable by setting viewbox parameters instead of fixed pixel sizes for the plots containers?

Contributor guide

Open the contributing guide

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.

Research direction

The issue names no files, tests, or entry points; start by tracing how plotly.js sizes SVG elements and handles responsive layouts. Compare the current fixed width/height behavior with the requested viewBox-based customization, and define done as CSS, including @media print, being able to control plot sizing without breaking responsive plots.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
data-visualization, frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.