IAnnotation.cs 1.1 KB

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