Giter VIP home page Giter VIP logo

Comments (6)

frewsxcv avatar frewsxcv commented on August 10, 2024

Just tried this out. It looks like 1M nodes + 1M edges results in just
under 1 FPS for me. 100K nodes + 100K edges gets something more like 20
FPS for me. I unfortunately have spent little time on optimizations for
Graphosaurus, so there's probably tons of room for improvement. Let me
know if you have any other questions!

On Fri, May 13, 2016, at 08:37 PM, Paul Shannon wrote:

Intrigued to discover this project. Before diving in, may I ask if
Graphosaurus supports very large networks, with > 10^6 nodes?
Thanks!

  • Paul

    You are receiving this because you are subscribed to this thread.
    Reply to this email directly or view it on GitHub[1]

Links:

  1. #79

from graphosaurus.

paul-shannon avatar paul-shannon commented on August 10, 2024

Thanks, Corey. Could I trouble you to post your code, perhaps as a gist?

  • Paul

from graphosaurus.

frewsxcv avatar frewsxcv commented on August 10, 2024
<html>
<head>
  <meta charset="UTF-8">
  <style>
    #frame {
      position: absolute;
      top: 0;
      bottom: 0;
      left: 0;
      right: 0;
      z-index: 0;
    }
  </style>
</head>
<body>

<div id="frame"></div>

<script src="../../dist/graphosaurus.js"></script>
<script>
var nodes = [];

graph = G.graph({
  nodeImage: "../_common/disc.png",
  nodeImageTransparent: true,
  antialias: true,
  bgColor: 0xEEEEEE,
  edgeWidth: 4,
  nodeSize: 18,
});


for (var i = 0; i < 100000; i++) {
  var node = G.node(randomPosition(), {color: 0x444444});
  if (nodes.length > 0) {
    var randomIndex = Math.floor(Math.random() * nodes.length);
    var otherNode = nodes[randomIndex];
    G.edge([node, otherNode], {color: 0x222222}).addTo(graph);
  }
  nodes.push(node);
  node.addTo(graph);
}

graph.renderIn('frame');

function randomPosition() {
  return [Math.random(), Math.random(), Math.random()];
}
</script>
</body>
</html>

from graphosaurus.

paul-shannon avatar paul-shannon commented on August 10, 2024

Very nice., thank you. This is some lovely capability you have created.

After running a few examples I am now experimenting with trees, with the goal of rendering phylogenetic relationships in the microbiome. Two questions arose quickly for me:

  1. How do I gain access to three.js scene, camera etc. through the nice abstractions you provide?
  2. How to render nodes so that their size scales with the zoom applied to the canvas? At present (see two images pasted in) the nodes keep their absolute screen size at all zoom levels.

image

image

from graphosaurus.

frewsxcv avatar frewsxcv commented on August 10, 2024

Wow, I must have missed this last comment. Sorry for the very late reply!

  1. How do I gain access to three.js scene, camera etc. through the nice abstractions you provide?
var frame = graph.renderIn("#some-id");
console.log(frame.scene);
console.log(frame.camera);
console.log(frame.renderer);

More info in frame.js.

  1. How to render nodes so that their size scales with the zoom applied to the canvas?

I think you want Graph({sizeAttenuation: true})

* @param {Boolean} props.sizeAttenuation - 'true' if nodes' size should change with distance. Defaults to 'false'.

from graphosaurus.

paul-shannon avatar paul-shannon commented on August 10, 2024

Thanks, Cory! Your answers are very encouraging -- if a little delayed :} I will get back to my experimenting soon.

  • Paul

from graphosaurus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.