Plot 'toggle data series' callback

Open
#2,618 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp, python

Research direction

Start at the add_line_series() entry point and review how is_item_shown(), get_item_configuration(), and plot legend interactions expose series visibility. Determine how an optional callback would observe toggles and what callback data is needed, then verify that the y-axis use case can distinguish shown and hidden series.

Written by the indexing model from the issue text.

Description

state: pending type: improvement
Is your feature request related to a problem? Please describe.

I have a small app that reads data from 5 sensors, and a plot that reads the maximum and minimum outputs from said sensors to automatically updates the y-axis limits to fit all the data neatly.
This works, but I often only care about one of the sensors, so I toggle the other 4 off by clicking them on the plot legend.

The only issue I have here is that (as far as I could find looking through the properties of data series and plot legends) there is no real way of detecting if a data series is toggled on/off.

This means I can't have my y-axis limit controller ignore the series I have toggled off to focus on the sensor I care about.

Describe the solution you'd like

I would love an optional callback: Callable =None argument for add_line_series() that could allow me to specify behaviour when the series is toggled on or off through the legend.

Describe alternatives you've considered

I have tried is_item_shown() and get_item_configuration() but I have not found any property or callback I can read to check if the data series is toggled on/off.

For now I might add some checkboxes to hide the unwanted data but it would be nice to have it built in to the plot.

Additional context

Thanks!

Dominant language
C++
Stars
15.7k
Forks
790
PR merge metrics
No merged PRs in 30d

Getting set up

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 hoffstadt/DearPyGui

All issues in hoffstadt/DearPyGui

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.