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

Slot 0 plot children disallow right-clicking plot legend #2459

Open
puglet5 opened this issue Jan 6, 2025 · 0 comments
Open

Slot 0 plot children disallow right-clicking plot legend #2459

puglet5 opened this issue Jan 6, 2025 · 0 comments
Labels
state: pending not addressed yet type: bug bug

Comments

@puglet5
Copy link

puglet5 commented Jan 6, 2025

Version of Dear PyGui

Version: 2.0.0
Operating System: Linux (Arch, 6.12.8)
Python: 3.12.8

My Issue/Question

In 2.0.0 there seems to be an issue with plot legend right-click functionality. Specifically, if a plot has any of slot 0 children shown (annotation, drag line, drag point, except for legend of course), it seems to be impossible to access right-click menu for plotted series. When such children are not shown, there is no issue (see MRE).

It also seems that, unlike in <2.0.0, such children are counted as series (?), as when toggling the plot annotation in MRE, line series changes color.

Standalone, minimal, complete and verifiable example

Try right-clicking the "Line" line series in the legend with the "Show annotation" checkbox on and off. When the checkbox is on right-clicking the legend does nothing.

Swapping dpg.add_plot_annotation to any of [dpg.add_drag_point, dpg.add_drag_line or dpg.add_drag_rect] with appropriate args exhibits the same behavior.

import dearpygui.dearpygui as dpg

dpg.create_context()
dpg.create_viewport()
dpg.setup_dearpygui()

with dpg.window(tag="main"):
    dpg.add_checkbox(
        label="Show annotation",
        callback=lambda _, state: dpg.configure_item("annotation", show=state),
        default_value=False,
    )

    with dpg.plot(tag="plot", width=-1, height=-1):
        dpg.add_plot_axis(dpg.mvXAxis, tag="x_axis")
        dpg.add_plot_axis(dpg.mvYAxis, tag="y_axis")
        dpg.add_plot_legend(tag="legend")
        dpg.add_line_series(
            x=[0, 1, 2], y=[0, 1, 0], parent="y_axis", label="Line", tag="line_series"
        )

        dpg.add_text("Text", parent="line_series", tag="series_text")

        dpg.add_plot_annotation(
            default_value=(1, 1),
            tag="annotation",
            label="[1,1]",
            show=False,
        )

dpg.set_primary_window("main", True)

dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context()

Expected behavior

Right-clicking plot legend should show child widgets of any plot series regardless of plot's other children (as was the case in DPG <2.0.0)

@puglet5 puglet5 added state: pending not addressed yet type: bug bug labels Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state: pending not addressed yet type: bug bug
Projects
None yet
Development

No branches or pull requests

1 participant