how to apply photos to specific nodes in the graph

Asked by Thuycam

Hi,

I tried to create a social network in topological graph. Would you please tell me how to add photo to node that represents an individual within the social network.

Much appreciated.

Thuycam

Question information

Language:
English Edit question
Status:
Solved
For:
Gephi Edit question
Assignee:
No assignee Edit question
Solved by:
Mathieu Bastian
Solved:
Last query:
Last reply:
Revision history for this message
Best Mathieu Bastian (mathieu.bastian) said :
#1

Hi Thuycam, this feature has been implemented as a Proof Of Concept and is hence experimental. You can however try it.

First you need a attribute with exactly "photo" as id. It is preferable to use GEXF.

Here is an example of a GEXF file with 3 pictures as nodes :

<?xml version="1.0" encoding="UTF-8"?>
<gexf xmlns="http://www.gephi.org/gexf" xmlns:viz="http://www.gephi.org/gexf/viz">
<graph type="static">
<attributes class="node" type="static">
<attribute id="importId" title="importId" type="string"/>
<attribute id="label" title="label" type="string"/>
<attribute id="photo" title="photo" type="string"/>
</attributes>
<nodes>
<node id="15" label="Site numro 1">
<viz:color b="177" g="116" r="114"/>
<viz:position x="-5.211296" y="-2.5921142" z="0.0"/>
<viz:size value="1.0"/>
<attvalues>
<attvalue id="0" value="s1"/>
<attvalue id="1" value="Site numro 1"/>
<attvalue id="2" value="http://www.exalead.com/img?f=11893770338900824462" />
</attvalues>
</node>
<node id="16" label="Site numro 2">
<viz:color b="251" g="116" r="219"/>
<viz:position x="-2.0114172" y="2.5740356" z="0.0"/>
<viz:size value="1.0986123"/>
<attvalues>
<attvalue id="0" value="s2"/>
<attvalue id="1" value="Site numro 2"/>
<attvalue id="2" value="http://www.exalead.com/img?f=11893770338900824462" />
</attvalues>
</node>
<node id="17" label="Site numro 3">
<viz:color b="223" g="208" r="192"/>
<viz:position x="0.85989237" y="-2.6867585" z="0.0"/>
<viz:size value="1.0986123"/>
<attvalues>
<attvalue id="0" value="s3"/>
<attvalue id="1" value="Site numro 3"/>
<attvalue id="2" value="http://www.exalead.com/img?f=11893770338900824462" />
</attvalues>
</node>
</nodes>
<edges>
<edge id="18" source="15" target="16"/>
<edge id="19" source="16" target="17"/>
<edge id="20" source="17" target="16"/>
<edge id="21" source="17" target="15"/>
</edges>
</graph>
</gexf>

Then load your graph and right click on the graph window. Then open the "Properties..." dialog and the "Objects" tab. There, instead of Sphere, select "Photo". You should see you pictures.

If you don't want to use URL but FILES, name your photo attributes with "file:" before. This for a photo named "john.jpg", change the GEXF above with

<attvalue id="2" value="file:john.jpg" />

The file should be put at the defautl Gephi directory, which is where you execute the "exe" or "sh".

Note that for the moment the SVG Exporter is not able to export the graph with the pictures.

Revision history for this message
Thuycam (thuycamng) said :
#2

Thanks Mathieu Bastian, that solved my question.