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 9024327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:58:47+00:00 2026-06-16T05:58:47+00:00

I am busy with an exercise to plot nodes on a pane. My first

  • 0

I am busy with an exercise to plot nodes on a pane. My first goal is to work with 1million nodes and then ramp it up to 15million.

I have a custom Object Graph and I can add edges and nodes to this object. Each node object has an ellipse that I can call and plot and same with the edge objects.
At the moment I have a function that generates a random position for the nodes.

I am using a scroll pane at the moment to enable panning around the pane and to view all the nodes.

What I thought was a good idea was to use a hashmap

Map<String, ArrayList<Node>> mapX = new HashMap<String, ArrayList<Node>>();
Map<String, ArrayList<Node>> mapY = new HashMap<String, ArrayList<Node>>();

I use the following code to add nodes to the hashmap:

int  tempXFloor = (int)Math.floor(tempX);
ArrayList<Node> tempList = mapX.get(tempXFloor+"");
if(tempList == null){
tempList = new ArrayList<>();
}
tempList.add(node); 
mapX.put(tempXFloor+"",tempList);

Then while I am panning I get the current position, floor it and check if an entry exist in the map. if an entry exist, I add all the nodes in the ArrayList to nodesOnScreen.
nodesOnScreen is an ArrayList type, and I will add the nodes to that list while I am panning and likewise the nodes that are off the screen are removed from the nodesOnScreen variable.

I only plot the nodes that is in the ArrayList nodesOnScreen.

I would appreciate some guidance in this matter, and how to handle such big data structures. Am I going in the right direction or am I missing an obvious “trick” to do it.

  • 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-16T05:58:49+00:00Added an answer on June 16, 2026 at 5:58 am

    There are several points to think about:

    1. How complex are your nodes? If they are just dots you may consider drawing them on an WritableImage and save a lot of memory. For more complex cases you may want to use Canvas. Either way you will save on event handlers, properties and other small things which counts in larger amounts.

    2. Another important matter is relevance of the data view. If you presents a map or something similar then user only care about visible part. The rest can be stored in disk cache and by Pareto principle only 20% of that data will be of much use. So you can plan accordingly and have real graphical nodes only for visible part (and maybe preload some adjusted parts for user experience sake).

    3. “Divide and conquer” conception. Even if you don’t want to restrict user view according to plan (2) you can’t be in constant need of 15 millions nodes. Not in UI library, there is no big enough monitors I’m afraid. So, split your data into segments and load one segment in a time. If you need to perform any kind of calculations on the whole set — do not work with nodes, use simplest implementation and perform calculations in some background process.

    4. Existing solutions are always a matter of investigations before doing big stuff. For example, there are a lot of caching libraries like PojoCache which seamlessly allow you to work with relevant data only once you splitted your billions of nodes into groups.

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

Sidebar

Related Questions

I have been busy with a exercise where I need to compare a winning
Busy building my first web application in CodeIgniter and wanted to work out the
Busy learning MVC 3 and EF ... I have an existing database, I then
I am busy writing an dynamic AND filter on a IQueryable Linq object, so
I'm busy working on a windows phone application that calls a servlet that then
I am busy recreating a powerpoint with xml. i have added all the neccessary
I am busy writing my own collection type and need to have a function
In a very busy PHP script we have a call at the beginning to
SO busy with some code, and have a function which basically takes dictionary where
On a busy ASP .NET website, I have a Dictionary, which acts as a

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.