• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

visualizing hierarchy structure

 
Ranch Hand
Posts: 2108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a list of pair of strings (Parent - Child pair). A child can also be a parent of another child.

A,B
A,C
A,D
B,C
D,E
E,C
E,F
E,G
G,H

How do I visualize it? One way is to run a java program to output a delimited file and load it in ms excel, showing below:

A|B|C
_|C
_|D|E|F
_|_|_|C
_|_|_|G|H

Or xml. But I prefer the spreadsheet above.

Anyone know any software that allows visualizing hierarchy structure of pairs of values? Or any code that does it?
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Back in my Pascal days I made a very small program that read any list like the one you showed and populated a tree control. Then you could browse the tree just like Windows explorer. I used it to show organization charts, COBOL program structure, data relationships and all kinds of things. JTree would do the job nicely. Have you worked with Swing at all?
 
Jesus Angeles
Ranch Hand
Posts: 2108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I havent done js2e for a long time already. So I am thinking of just dumping to system.out and cutting into notepad, and opening it in excel.

like (output in system.out):

A;B;C
_;C
_;D;E;F
_;_;_;C
_;_;_;G;H

becomes below, when loaded to excel, using ';' as delimiter:

A|B|C
_|C
_|D|E|F
_|_|_|C
_|_|_|G|H


Technically, actually, these strings are indeed COBOL programs and VSAM files, calling other COBOL programs (both cics, via LINK or START; the VSAMs would be leaves in our tree). Basically, the requirement is: to visualize, all programs, calling what programs, and accessing what vsam files.

Actually, xml is pretty, but I preferred excel, as I may need to further process this tree.

I already figured a few hours ago how to do it:

1. Input:
1.1 2d array of these pairs of strings
1.2 list of programs i want to tree out

2. do:

2.1 produce 2d array of strings like below, using recursion, and indexes to the 2d array mentioned:

A;B;C
_;C
_;D;E;F
_;_;_;C
_;_;_;G;H

2.2 print the array, with delimiter to system.out

Not so detailed pseudocode, but if anyone needs the code, I can share after I complete it.

(Pascal...I dont think they teach that in new curriculums any more, do they?; It shows a little bit how old we are.)
 
Jesus Angeles
Ranch Hand
Posts: 2108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I will revise my #2, to use xml, instead of intermediate 2d array.

WSAD or other xml editors can make the text pretty. Then I can open it in excel, etc. and do lots of other possibilities.

Wahhh, xml actually saved me thinking, cpu memory and runtime cost. And its pretty too.
 
Stan James
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh, if you have a reasonable number of entries you could put your list into GraphViz / DOT pretty quickly, too. I use it for a dependency graph of about 20 packages. You might find organization chart or mind mapping software that can do something cool with pure hierarchies, too.

I'm pretty sure I have some recent REXX that did this kind of thing. When I get to my other PC I'll dig around for it. I found something from the 80s but it didn't really attempt a tree layout.
 
Jesus Angeles
Ranch Hand
Posts: 2108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have at least 100 pairs. Can be up to around 300.

I just realized, that due to the nature of the data (COBOL PROG-COBOL PROG, and, COBOL PROG-VSAM), a reversed inheritance diagram would be perfect fit.
[ January 07, 2007: Message edited by: Jesus Angeles ]
 
No one can make you feel inferior without your consent - Eleanor Roosevelt. tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic