Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. tree visualization

tree visualization

Scheduled Pinned Locked Moved C#
csharpdata-structurestutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pstsp911
    wrote on last edited by
    #1

    Any idea how to visualize a tree in C#? Like treeview but in graphical form, circles and links. Any libraries, controls maybe as I don't have much time? It seems correct visualization of any tree is not an easy thing :(

    A 1 Reply Last reply
    0
    • P pstsp911

      Any idea how to visualize a tree in C#? Like treeview but in graphical form, circles and links. Any libraries, controls maybe as I don't have much time? It seems correct visualization of any tree is not an easy thing :(

      A Offline
      A Offline
      Alan Balkany
      wrote on last edited by
      #2

      It's easy with the right approach: Position the leaves first. If each leaf has its own space in the Y dimension (i.e. no other nodes under it), you can easily assign Y coordinates for all the leaves. Just go through them from left to right, incrementing the Y coordinate according to each leaf's width and the gap between adjacent leaves. The X coordinates come from the leaves' depths. The next step is to assign coordinates to the interior nodes. One approach is to position each interior node in the middle above its leaves. Finally go through all the nodes, drawing them at their assigned coordinates, and drawing links from each interior node to its children.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups