Vixen
02b45cc4
csharp
public sealed class NodeMinimap

The whole graph, small, in the corner of the canvas.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

Drawn rather than built. A minimap of ten thousand nodes is ten thousand rectangles, and as elements that would be ten thousand style nodes and layout boxes for a picture nobody clicks on individually — the one control in this assembly where custom drawing is cheaper than the cascade by three orders of magnitude rather than by a constant.

⚠ The scale is the graph's extent, not a fixed zoom. A minimap at a fixed fraction of the canvas's zoom shows nothing at all once the user has zoomed in, which is when they need it. It also means the picture moves when a node is dragged past the old edge, which is correct and looks like a bug until you know why.

Fields and properties (5)

  • protected override string TagName

    The element name this type answers to when a caller does not choose one.

  • protected override bool AcceptsFocus

    Whether the focus can rest on this kind of control at all.

  • public NodeCanvas? Canvas

    The canvas it is an overview of.

  • public Rectangle Extent

    What the whole picture covers, in graph units.

  • public float Scale

    How many minimap pixels one graph unit is.

Methods (4)

  • protected override void OnCreated()

    Builds whatever this element is made of, once, as it joins a document.

  • public Vector2 ToScreen(Vector2 point)

    Where a graph point lands on the map, in document space.

  • public Vector2 ToGraph(float x, float y)

    Where a point on the map is, in graph units.

  • protected override void OnDraw(DrawContext context)

    Draws whatever this element is, beyond what a stylesheet can describe.

Used by (3)

  • NodeCanvasVixen.Ui.Controls.Advanced
  • NodeCanvasTestsVixen.Ui.Controls.Advanced.Tests
  • NodeGraphViewVixen.Editor.NodeGraph