Giter VIP home page Giter VIP logo

Comments (9)

hasanbalci avatar hasanbalci commented on May 17, 2024

AFAIK, graphml format doesn't include a separate structure or keyword for the position information. It is also given as a data element, so extension stores that information in node's data field. Position information can be reached from node's data field after import.

In my opinion, estimating position information from a data element and assigning it directly to the node's position field is not so convenient. Because, user may define position information with different names. (In the above file, it is x and y, but in another file it can be xPos and yPos.)

from cytoscape.js-graphml.

ugurdogrusoz avatar ugurdogrusoz commented on May 17, 2024

@hasanbalci Does this extension recognize any of these ways to specify location? Can we perhaps make it recognize some commonly accepted location and dimension specification keywords?

from cytoscape.js-graphml.

hasanbalci avatar hasanbalci commented on May 17, 2024

No, it doesn't recognize. But maybe we can specify 'x' and 'y' for the position and 'width' and 'height' for the dimension.

from cytoscape.js-graphml.

ugurdogrusoz avatar ugurdogrusoz commented on May 17, 2024

@JustDoIt1999 Could you please work on this and modify this extension to recognize 'x', 'y', 'width', and 'height'?

from cytoscape.js-graphml.

PermanAtayev avatar PermanAtayev commented on May 17, 2024

@ugurdogrusoz of course

from cytoscape.js-graphml.

zeeshanullah avatar zeeshanullah commented on May 17, 2024

A node in my graphml looks like this

<node id="n0">
      <data key="d0">
        <y:ImageNode>
          <y:Geometry height="48.0" width="48.0" x="-24.0" y="694.0"/>
          <y:Fill color="#CCCCFF" transparent="false"/>
          <y:BorderStyle color="#000000" type="line" width="1.0"/>
          <y:NodeLabel alignment="center" autoSizePolicy="content" backgroundColor="#FFFFFF" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasLineColor="false" height="18.701171875" modelName="sides" modelPosition="e" textColor="#000000" visible="true" width="39.34375" x="52.0" y="14.6494140625">Server</y:NodeLabel>
          <y:Image refid="1"/>
        </y:ImageNode>
      </data>
      <data key="d1"/>
</node>

I am interested in the nodes position x and y. Since position cannot be recognized by the library, Can you guide me how can I access that manually? @PermanAtayev

from cytoscape.js-graphml.

PermanAtayev avatar PermanAtayev commented on May 17, 2024

You can access it as follows:
let obj = {}; obj["position"] = { x: parseInt(ele.data('x')), y: parseInt(ele.data('y')) };
where ele is a node in cytoscape.js

@zeeshanullah

from cytoscape.js-graphml.

zeeshanullah avatar zeeshanullah commented on May 17, 2024

I already tried this but it returns NaN for both values.

$graph.children("node").each(function () {
      var $node = $(this);

      var settings = {
        data: {id: $node.attr("id")},
        css: {},
        position: { x: parseInt($node.data('x')), y: parseInt($node.data('y')) }
      };

@PermanAtayev

from cytoscape.js-graphml.

PermanAtayev avatar PermanAtayev commented on May 17, 2024

This type of graphml is not supported by the extension, please use the format I provided for this issue.
@zeeshanullah

from cytoscape.js-graphml.

Related Issues (18)

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.