IAnnotation.cs 1.1 KB

1234567891011121314151617181920212223242526
  1. #nullable disable
  2. namespace Terminal.Gui.Views;
  3. /// <summary>
  4. /// <para>Describes an overlay element that is rendered either before or after a series.</para>
  5. /// <para>
  6. /// Annotations can be positioned either in screen space (e.g. a legend) or in graph space (e.g. a line showing
  7. /// high point)
  8. /// </para>
  9. /// <para>Unlike <see cref="ISeries"/>, annotations are allowed to draw into graph margins</para>
  10. /// </summary>
  11. public interface IAnnotation
  12. {
  13. /// <summary>
  14. /// True if annotation should be drawn before <see cref="ISeries"/>. This allows Series and later annotations to
  15. /// potentially draw over the top of this annotation.
  16. /// </summary>
  17. bool BeforeSeries { get; }
  18. /// <summary>
  19. /// Called once after series have been rendered (or before if <see cref="BeforeSeries"/> is true). Use
  20. /// methods like <see cref="View.AddStr(string)"/> and <see cref="View.AddRune(Rune)"/> to draw. Use <see cref="View.Viewport"/> to avoid drawing outside of graph.
  21. /// </summary>
  22. /// <param name="graph"></param>
  23. void Render (GraphView graph);
  24. }