Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7929517
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T20:06:21+00:00 2026-06-03T20:06:21+00:00

i am using this dot-Code for my Test: digraph G { edge [dir=none]; p1

  • 0

i am using this dot-Code for my Test:

digraph G { edge [dir=none];
p1 [shape=circle,style=filled,label="",height="0.01",width="0.01"];
q1 [shape=circle,style=filled,label="",height="0.01",width="0.01"];
q2 [shape=circle,style=filled,label="",height="0.01",width="0.01"];
q3 [shape=circle,style=filled,label="",height="0.01",width="0.01"];
{rank=same; father->p1; mother->p1};
{rank=same; q1->q2->q3};
{rank=same; son1; daughter1; daughter2};
p1->q2;
q1->son1;
q2->daughter1;
q3->daughter2;
}

My Java Code to create the Graph is the following:

Graph graph = null;

    graph = program.getGraph();

    JScrollPane jsp = new JScrollPane();
    jsp.getViewport().setBackingStoreEnabled(true);

    GrappaPanel gp = new GrappaPanel(graph);
    gp.addGrappaListener(new GrappaAdapter());
    gp.setScaleToFit(false);
    jsp.setViewportView(gp);

The Output is this: Link

Why is the Tree formatted so wrong? And is there an possibility to let the Tree display from left to right?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T20:06:23+00:00Added an answer on June 3, 2026 at 8:06 pm

    You have to “ask” graphviz (any of the tools, “dot”, “neato”…) to “format” the graph before you can display it (in an appealing way) in a GrappaPanel. Before you construct the GrappaPanel, you need to do the following:

    String [] processArgs = {"dot"}; // You can use "neato" or whatever formatter you want
    Process formatProcess = Runtime.getRuntime().exec(processArgs, null, null);
    GrappaSupport.filterGraph(graph, formatProcess);
    formatProcess.getOutputStream().close();
    

    Where “graph” in GrappaSupport.filterGraph is your graph. After that, your graph is formatted properly and you can use the GrappaPanel to view it. The result will be more pleasant than what you posted in the link.

    Hope that helps, regards.

    PS: In order for the above code to work, you have to have “dot” (or any other formatter you use) to be in the path, otherwise you need to give it the full path of the executable file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using this CSS code #main ul li { list-style-type: disc; list-style-position: inside; }
I used the code below to create a graphic using dot (graphviz). digraph {
Using series.add(180, 1); produces a perfectly valid chart like this (little red dot at
Using this code $.getJSON(http://mydomain.com/getcustomers?callback=?,function(data) { .... }).error(function(err){ .... }) I'm getting jQuery16103492487950357067_1336742910384 was not
Using this block of code to create an overlay and a box. problem: the
I'm trying to fetch this page (it's in Chinese, sorry for that): amazon(dot)cn/s?rh=n:663227051 using
I'm using this code to create a custom Event class: package evt { import
I am using an example program from this code http://sicktoolbox.sourceforge.net/ > http://sourceforge.net/projects/sicktoolbox/files/ . It's
So I am using this code to embed my .swf file. I am creating
Using this syntax I can add records in the fields but it always add

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.