Terminal.Gui icon indicating copy to clipboard operation
Terminal.Gui copied to clipboard

`GraphView` assumes `Frame == Bounds`

Open tig opened this issue 2 years ago • 3 comments

Change any of the graph view samples in GraphViewExample.cs to have a border to repro:

e.g.

graphView.BorderStyle = LineStyle.Single;

image

In addition & related, GraphView has properties duplicative of v2's Frames. E.g.

/// <summary>
/// Amount of space to leave on left of control.  Graph content (<see cref="Series"/>)
/// will not be rendered in margins but axis labels may be
/// </summary>
public uint MarginLeft { get; set; }

/// <summary>
/// Amount of space to leave on bottom of control.  Graph content (<see cref="Series"/>)
/// will not be rendered in margins but axis labels may be
/// </summary>
public uint MarginBottom { get; set; }

I noticed this as I was reviewing #2981.

tig avatar Nov 14 '23 01:11 tig

If you want to use border in the legend annotations you have two choices:

  • Add a View to the GraphView and set the Border.
  • Draw a frame directly to the driver without using a View. Thus the obsolete method would be necessary.

Do you have ani idea for this?

BDisp avatar Nov 14 '23 16:11 BDisp

If you want to use border in the legend annotations you have two choices:

  • Add a View to the GraphView and set the Border.
  • Draw a frame directly to the driver without using a View. Thus the obsolete method would be necessary.

Do you have ani idea for this?

Since legend annotations are not a View, I have no issue with how you updated the code to use the new View.DrawFrame method you provided in #2982.

The fact that in your View.DraweFrame you defer rendering (via OnRenderLineCanvas) should make magic happen. I opened THIS issue because I was heading down the path of testing whether it would or not. What I mean by magic is:

"If the legend annotation is positioned such that its border touches either theGraphView border or if it's SuperView's border, line-auto-join does what one would expect."

But, until the bug I am reporting in THIS issue is addressed, it's not possible to prove the above will work or not.

tig avatar Nov 14 '23 18:11 tig

I added a view for the legend annotations. See #2982.

BDisp avatar Nov 14 '23 18:11 BDisp