plotly / plotly/plotly.js

Ternary plot missing `automargin` option in `layout.ternary`

Open
#7,333 0 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 the Ternary plot: https://plotly.com/javascript/ternary-plots/
doesn't have automargin option in each axis in the layout.ternary: https://plotly.com/javascript/reference/layout/ternary/

Therefore, it may happen that the title of the axis is cropped, not only in the case of long titles, but more often due to smaller screen sizes (or figure sizes).

This is more likely for the title text in axes B and C located in the bottom being cropped, e.g.:

Image

Image

Titles are being cropped!

Demo example: https://codepen.io/Lexachoc/pen/MYgVGoW

Image
The title in axis B has no margin to adjust the position and is therefore cropped.

It would be very helpful to add this option (or a similar one to achieve the same thing, avoiding the title text being cropped) to the ternary plot.

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

Start with the layout.ternary reference and the linked ternary plot examples, then trace how axis titles and margins are handled. The work is done when ternary axes expose an automargin option or equivalent behavior and titles, especially on axes B and C, are no longer cropped in small figures.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
data-visualization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.