Comments (9)
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.
@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.
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.
@JustDoIt1999 Could you please work on this and modify this extension to recognize 'x', 'y', 'width', and 'height'?
from cytoscape.js-graphml.
@ugurdogrusoz of course
from cytoscape.js-graphml.
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.
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
from cytoscape.js-graphml.
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')) }
};
from cytoscape.js-graphml.
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)
- TypeError: graphml is not a function HOT 6
- Unable to Import networkx exported graphml HOT 3
- Using in browser HOT 3
- If element data has keys of type object they are exported as [object Object] instead of something meaningful HOT 1
- Warning for deprecated usage
- Cytoscape style is not being preserved HOT 1
- Demo is not interactive
- Graphml structure is not preserved when exported
- Wrong type of data-field on edges HOT 2
- Define Parent after initializing elements via GraphML HOT 1
- Add attributes to "data" by name not by id HOT 1
- Cannot download in .graphml format HOT 5
- Layoutoptions aren't set correctly HOT 2
- type-field at edges
- import problems HOT 1
- Special characters are not encoded HOT 2
- Selector Option
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cytoscape.js-graphml.