Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting Labels using GraphML #1502

Closed
ftrotter opened this issue May 31, 2016 · 2 comments
Closed

Setting Labels using GraphML #1502

ftrotter opened this issue May 31, 2016 · 2 comments

Comments

@ftrotter
Copy link

Hello.

When importing GraphML files, I am having trouble setting the label of nodes. So far I have tried three things, based on hints in the various documentation(s). the two unorthodox things I have tried is to add a "label" attribute to the element. I have also tried adding a element with a key of "label". Neither of those seems to work correctly.

As per the graphml standard, the way this should work is using a single element as the first sub-element of the element. That does not seem to work either. The desc element is not very well outlined in the GraphML primer but it is there, at the very end.

Personally I think that the labels should be set a per the GraphML standard, but I would be happy to conform to what gephi is expecting, but there is no mention of setting the labels properly in this gephi documentation.

Thank you all for working on such a great project.

-Fred Trotter

@eduramiba
Copy link
Member

Should be fixed with #1719 Please try with latest 0.9.2 snaphost https://github.com/gephi/gephi#nightly-builds

@eduramiba eduramiba self-assigned this Jul 7, 2017
@eduramiba eduramiba added this to the 0.9.2 milestone Jul 7, 2017
@krishna116
Copy link

I meet the same question about how to set the label, and I find a method: define custom-label-property in the graphml scope and use the custom-label-property in the node scope.
For example:

<graphml>
  <key id="label" for="node" attr.name="label" attr.type="string"/> <!--Define custom label property-->
  
  <graph id="G" edgedefault="directed">
    <node id="1">
        <data key="label">a</data>      <!--Using custom label property-->
    </node>
    <node id="2">
        <data key="label">b</data>      <!--Using custom label property-->
    </node>
    <node id="3">
        <data key="label">c</data>      <!--Using custom label property-->
    </node>
    <edge source="1" target="2"/>
    <edge source="1" target="3"/>
  </graph>
</graphml>

I don't know about gephi but I know yEd has given an option to mapping any custom property to label so it can be rendered.
image
That's all, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants