[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 583: sizeof(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 639: sizeof(): Parameter must be an array or an object that implements Countable
Gephi forumsPlease post new questions on facebook group too (https://www.facebook.com/groups/gephi) 2014-05-28T12:49:35+01:00 https://forum-gephi.org/app.php/feed/topic/1665 2014-05-28T12:49:35+01:002014-05-28T12:49:35+01:00 https://forum-gephi.org/viewtopic.php?t=1665&p=10385#p10385 <![CDATA[Re: [TODO] Selectable multiple attributes/colour per node]]>
Thank you !
demo2.png

demo1.png

Statistics:Posted by diddyxn — 28 May 2014 12:49


]]>
2013-07-09T14:37:29+01:002013-07-09T14:37:29+01:00 https://forum-gephi.org/viewtopic.php?t=1665&p=8957#p8957 <![CDATA[Re: [TODO] Selectable multiple attributes/colour per node]]>
Thanks!!!
Hannah

Statistics:Posted by hdean83@gmail.com — 09 Jul 2013 14:37


]]>
2012-04-02T01:24:01+01:002012-04-02T01:24:01+01:00 https://forum-gephi.org/viewtopic.php?t=1665&p=6030#p6030 <![CDATA[Re: [TODO] Selectable multiple attributes/colour per node]]> Statistics:Posted by Ferretti — 02 Apr 2012 01:24


]]>
2012-03-31T17:41:32+01:002012-03-31T17:41:32+01:00 https://forum-gephi.org/viewtopic.php?t=1665&p=6016#p6016 <![CDATA[Re: [TODO] Selectable multiple attributes/colour per node]]> New release Gephi 0.8.1 beta includes the renderer manager. It appears in preview when any plugin is installed. There you can play with it and see where your renderer is actually positioned and move it.

Also please look at new Renderer class documentation http://gephi.org/docs/api/org/gephi/pre ... derer.html
You have to implement two new methods more, and to replace a default renderer you only have to extend it now. So never use "supersedes" parameter of ServiceProvider.

There are adapted examples of preview plugins here https://github.com/gephi/gephi-plugins-bootcamp

Eduardo

Statistics:Posted by eduramiba — 31 Mar 2012 17:41


]]>
2012-03-31T16:26:36+01:002012-03-31T16:26:36+01:00 https://forum-gephi.org/viewtopic.php?t=1665&p=6015#p6015 <![CDATA[Re: [TODO] Selectable multiple attributes/colour per node]]>
It has come to the time where I need to use one of the graphs in my report, but I am still stuck when attempting to get the leabels to render correctly above my custom node renderer, maybe you guys have discovered the problem?

Attached is the code in its current state, the issue I presume lies in the @ServiceProvider line. Even when including the full renderer name in the supersedes field the original renderer still runs beneath mine.

I would like to get this finished and working to help others who wish to use this feature!

Thanks

CODE:

/* * To change this template, choose Tools | Templates * and open the template in the editor. */package org.ferretti.MultiColourNode;import java.awt.BasicStroke;import java.awt.Color;import java.awt.Graphics2D;import java.awt.Stroke;import java.util.ArrayList;import java.util.Scanner;import org.gephi.graph.api.Node;import org.gephi.preview.api.*;import org.gephi.preview.plugin.items.NodeItem;import org.gephi.preview.spi.Renderer;import org.gephi.data.attributes.type.IntegerList;import org.gephi.preview.plugin.renderers.NodeRenderer;import org.openide.util.lookup.ServiceProvider;import org.w3c.dom.Element;import processing.core.PGraphicsJava2D;/** * * @author James */@ServiceProvider(service = Renderer.class, position = 1, supersedes={"org.gephi.preview.plugin.renderers.NodeRenderer"})public class MultiColourRenderer implements Renderer {    @Override    public void preProcess(PreviewModel previewModel) {    }    @Override    public void render(Item item, RenderTarget target, PreviewProperties properties) {        if (target instanceof ProcessingTarget) {            renderProcessing(item, (ProcessingTarget) target, properties);        } else if (target instanceof SVGTarget) {            renderSVG(item, (SVGTarget) target, properties);        } else if (target instanceof PDFTarget) {            renderPDF(item, (PDFTarget) target, properties);        }    }    @Override    public PreviewProperty[] getProperties() {        return new PreviewProperty[]{                    PreviewProperty.createProperty(this, "MultiColourNode", Boolean.class,                    "Multi Colour Nodes",                    "Make a node be coloured more then one hue",                    PreviewProperty.CATEGORY_NODES).setValue(false)                };    }    @Override    public boolean isRendererForitem(Item item, PreviewProperties properties) {        return item.getType().equals(Item.NODE) && properties.getBooleanValue("MultiColourNode");    }    private void renderProcessing(Item item, ProcessingTarget target, PreviewProperties properties) {        //Params        Float xF = item.getData(NodeItem.X);        Float yF = item.getData(NodeItem.Y);        //Float sizeF = item.getData(NodeItem.SIZE);        int x = xF.intValue();        int y = yF.intValue();        Node n = (Node) item.getSource();        Integer size = (Integer) n.getNodeData().getAttributes().getValue("size");        Object colourList = n.getNodeData().getAttributes().getValue("colourList");        ArrayList<Color> colourArray = splitColourList(colourList);        int radius = size;        PGraphicsJava2D graphics = (PGraphicsJava2D) target.getGraphics();        Graphics2D g2 = graphics.g2;        // draw colour indices as pie chart around point        if (colourArray.size() > 0) {            double arcAngle = 360.0 / colourArray.size();            // draw 'pieces of pie'            for (int i = 0; i < colourArray.size(); i++) {                //System.out.println(Integer.parseInt(n.getColour(i)));                g2.setColor(colourArray.get(i));                g2.fillArc((x - radius), (y - radius), (radius * 2), (radius * 2),                        (int) (arcAngle * i), (int) arcAngle);            }            // draw 'spokes' between pieces            if (colourArray.size() > 1) {                Stroke oldStroke = g2.getStroke();                for (int i = 0; i < colourArray.size(); i++) {                    double spokeAngle = arcAngle * i / 180 * Math.PI;                    g2.setColor(Color.BLACK);                    g2.setStroke(new BasicStroke(0.5f));                    g2.drawLine(x, y, (int) (x + radius * Math.cos(spokeAngle)), (int) (y - radius * Math.sin(spokeAngle)));                }                g2.setStroke(oldStroke);            }        } else {            // draw filled white circle            g2.setColor(Color.WHITE);            g2.fillOval(x - radius, y - radius, radius * 2, radius * 2);        }        // draw black circle        g2.setColor(Color.BLACK);        g2.drawOval(x - radius, y - radius, radius * 2, radius * 2);        //original        //g2.setPaint(p);        //g2.fillOval((int) (x.floatValue() - radius), (int) (y.floatValue() - radius), (int) (radius * 2), (int) (radius * 2));    }    private void renderSVG(Item item, SVGTarget target, PreviewProperties properties) {        //Params        Float x = item.getData(NodeItem.X);        Float y = item.getData(NodeItem.Y);        Float size = item.getData(NodeItem.SIZE);        Node n = (Node) item.getSource();        Object colourListObj = n.getNodeData().getAttributes().getValue("colourList");        ArrayList<Color> colourArray = splitColourList(colourListObj);        Float radius = size - 3;        //float borderSize = properties.getFloatValue(PreviewProperty.NODE_BORDER_WIDTH);        float alpha = properties.getIntValue(PreviewProperty.NODE_OPACITY) / 100f;        if (alpha > 1) {            alpha = 1;        }        // draw colour indices as pie chart around point        if (colourArray.size() > 0) {            float arcAngle = (float) (360.0 / colourArray.size());            // draw 'pieces of pie'            for (int i = 0; i < colourArray.size(); i++) {                //Arc2D arca = new Arc2D.Float((x - radius), (y - radius), (radius * 2), (radius * 2), (arcAngle * i), (arcAngle), Arc2D.CHORD);                float[] startXY = toCartesianCoordinate(x, y, radius, arcAngle * i);                float[] endXY = toCartesianCoordinate(x, y, radius, (arcAngle * i) + arcAngle);                Element nodeElem = target.createElement("path");                nodeElem.setAttribute("class", n.getNodeData().getId());                nodeElem.setAttribute("fill", target.toHexString(colourArray.get(i)));                nodeElem.setAttribute("d", "M" + " " + startXY[0] + " " + startXY[1] + " " + "A" + " " + radius + " " + radius + " " + 0 + " " + 0 + " " + 0 + " " + endXY[0] + " " + endXY[1]);                //PATH = M startXY[0] startXY[1] A radius radius 0 0 0 endXY[0] endXY[1]                nodeElem.setAttribute("fill-opacity", "" + alpha);                nodeElem.setAttribute("stroke", "black");                nodeElem.setAttribute("stroke-width", "2");            }        } else {            Element nodeElem = target.createElement("circle");            nodeElem.setAttribute("class", n.getNodeData().getId());            nodeElem.setAttribute("cx", x.toString());            nodeElem.setAttribute("cy", y.toString());            nodeElem.setAttribute("r", size.toString());            nodeElem.setAttribute("fill", target.toHexString(Color.WHITE));            nodeElem.setAttribute("fill-opacity", "" + alpha);        }    }    private void renderPDF(Item item, PDFTarget pdfTarget, PreviewProperties properties) {        //TODO    }    /**     * turns a list of numbers into an ArrayList of Colours should be able to     * deal with bot a string or a IntegerList item     *     * @param colorList String, list of colours taken from the column     * "colourList"     * @return An ArrayList of Colour objects, to be drawn on the node     */    private ArrayList<Color> splitColourList(Object colourListObj) {        ArrayList<Color> toReturn = new ArrayList<Color>();        if (colourListObj instanceof IntegerList) {            IntegerList colourIntList = (IntegerList) colourListObj;            if (colourIntList != null) {                for (int i = 0; i < colourIntList.size(); i++) {                    Integer rgb = colourIntList.getItem(i);                    rgb = rgb/15;                    Color col = new Color(rgb);                    if (!toReturn.contains(col)) {                        toReturn.add(col);                    }                }            }        } else if (colourListObj instanceof String) {            //-1 denotes a default value where no colours were attributed to a node            String colourList = (String) colourListObj;            if (!colourList.equals("-1")) {                Scanner scan = new Scanner(colourList);                scan.useDelimiter(",");                while (scan.hasNext()) {                    String str = scan.next();                    Integer rgb = str.hashCode();                    rgb = rgb/15;                    //Integer rgb = Integer.parseInt(str);                    Color col = new Color(rgb);                    if (!toReturn.contains(col)) {                        toReturn.add(col);                    }                }            }        }        return toReturn;    }    private float[] toCartesianCoordinate(float centerX, float centerY, float radius, float angleInDegrees) {        float angleInRadians = (float) (angleInDegrees * Math.PI / 180.0);        float x = (float) (centerX + radius * Math.cos(angleInRadians));        float y = (float) (centerY + radius * Math.sin(angleInRadians));        float[] arr = {x, y};        return arr;    }}

Statistics:Posted by Ferretti — 31 Mar 2012 16:26


]]>
2012-02-19T15:32:01+01:002012-02-19T15:32:01+01:00 https://forum-gephi.org/viewtopic.php?t=1665&p=5680#p5680 <![CDATA[Re: [TODO] Selectable multiple attributes/colour per node]]> Yes we decided to do the Renderers manager idea.

To supersede a renderer you have to provide the full class name, in this case "org.gephi.preview.plugin.renderers.NodeRenderer"
If you want to disable node renderer you can set the opacity to 0. In the future this will be done to any renderer with the manager.

About the position, it is strange that it does not work.
Here is a list of the default renderers and their positions:
org.gephi.preview.plugin.renderers.EdgeRenderer 100
org.gephi.preview.plugin.renderers.ArrowRenderer 200
org.gephi.preview.plugin.renderers.NodeRenderer 300
org.gephi.preview.plugin.renderers.NodeLabelRenderer 400
org.gephi.preview.plugin.renderers.EdgeLabelRenderer 500

Eduardo

Statistics:Posted by eduramiba — 19 Feb 2012 15:32


]]>
2012-02-18T20:11:52+01:002012-02-18T20:11:52+01:00 https://forum-gephi.org/viewtopic.php?t=1665&p=5676#p5676 <![CDATA[Re: [TODO] Selectable multiple attributes/colour per node]]>
I am still having problems with the rendering unfortunately, I cannot get my lables above my nodes.

I have tried:

CODE:

@ServiceProvider(service = Renderer.class, position = 1)
same result.

CODE:

@ServiceProvider(service = Renderer.class, supersedes={"NodeRenderer"})
same result, and still renders original nodes. I have included the {} because it asks for a String[].

CODE:

@ServiceProvider(service = Renderer.class, position = 1, supersedes={"NodeRenderer"})
Same result.

Is it something to do with the Label renderer being attached to the original node renderer?

Thanks.

Also, SVG will still always use the default renderer. I don't need this function personally but it would be nice to get it working for others who may wish to in the future when this plugin is released.

Thanks, James

Is the label renderer somhow atatched to the NodeRenderer?

Statistics:Posted by Ferretti — 18 Feb 2012 20:11


]]>
2012-02-14T21:14:17+01:002012-02-14T21:14:17+01:00 https://forum-gephi.org/viewtopic.php?t=1665&p=5669#p5669 <![CDATA[Re: [TODO] Selectable multiple attributes/colour per node]]> What happens is that a Renderer can't disable other renderer and does not automatically disable other node renderers, for example. So the only thing you could do is supersede it in ServiceProvider annotation, but that is not good in my opinion.

But you gave me an idea :) I think the best solution for these kind of problems would be to always have a panel in preview that shows every installed renderer and a checkbox to control it. This way the user controls easily what should be renderer, you would not have to create a checkbox to enable your renderer, and also this could be used to automatically hide preview settings of renderers that are not enabled at the moment.
What do you guys think about this?

About the labels under your nodes, note that the labels are rendered by another separate renderer and it should be executed after yours. So to control the order of renderers you use the position parameter of ServiceProvider.

For example NodeLabelRenderer has this:

CODE:

@ServiceProvider(service = Renderer.class, position = 400)
So just do the same with a lower than 400 number and your renderer will execute before the labels renderer.

About the SVG, I could not see why it is not working with your code, it looks right.

Eduardo

Statistics:Posted by eduramiba — 14 Feb 2012 21:14


]]>
2012-02-14T18:19:21+01:002012-02-14T18:19:21+01:00 https://forum-gephi.org/viewtopic.php?t=1665&p=5667#p5667 <![CDATA[Re: [TODO] Selectable multiple attributes/colour per node]]>
So the user should clearly notice on this and future plugins that he has to disable the normal nodes rendering and enable yours.
Surely when you click the check box the original renderer should be disabled and only mine used? it would possibly make more sense to have a drop-down menu to select renderer next to where the "presets" menu is. You could select renderer and also be presented with options specific to that renderer in the panel on the right.

Is theres something in my code that is preventing the SVG from rendering using my renderer, or is it that a bug further up the chain?

Thanks

Statistics:Posted by Ferretti — 14 Feb 2012 18:19


]]>
2012-02-13T23:35:14+01:002012-02-13T23:35:14+01:00 https://forum-gephi.org/viewtopic.php?t=1665&p=5665#p5665 <![CDATA[Re: [TODO] Selectable multiple attributes/colour per node]]>
To make your checkbox work you should change isRendererForItem to:

CODE:

public boolean isRendererForitem(Item item, PreviewProperties properties) {    return item.getType().equals(Item.NODE) && properties.getBooleanValue("MultiColourNode");}
It is normal that both normal nodes and your nodes render, because your renderer is not supersiding the default one. I am not sure about supersiding being safe when the amount of preview plugins grow, since some could rely on it.
So the user should clearly notice on this and future plugins that he has to disable the normal nodes rendering and enable yours. Anyone has a better idea for these cases?

In order to let the user select any column with any title you can create your own preview UI. A similar example called NodesZOrderingUI is available here https://github.com/gephi/gephi-plugins-bootcamp
Also if you use a number list column, you won't have to parse the strings to get the numbers and can be more friendly for users.

Eduardo

Statistics:Posted by eduramiba — 13 Feb 2012 23:35


]]>
2012-02-13T18:12:18+01:002012-02-13T18:12:18+01:00 https://forum-gephi.org/viewtopic.php?t=1665&p=5663#p5663 <![CDATA[Re: [TODO] Selectable multiple attributes/colour per node]]>
Here is the full code I have done so far - hopefully you can spot the error. I am not 100% sure my SVG path calculations are correct, especially line 147, I have been unable to test them!

CODE:

/* * To change this template, choose Tools | Templates * and open the template in the editor. */package org.ferretti.MultiColourNode;import java.awt.BasicStroke;import java.awt.Color;import java.awt.Graphics2D;import java.awt.Stroke;import java.awt.geom.Arc2D;import java.util.ArrayList;import java.util.Scanner;import org.gephi.graph.api.Node;import org.gephi.preview.api.*;import org.gephi.preview.plugin.items.NodeItem;import org.gephi.preview.spi.Renderer;import org.openide.util.lookup.ServiceProvider;import org.w3c.dom.Element;import processing.core.PGraphicsJava2D;/** * * @author James */@ServiceProvider(service = Renderer.class)public class MultiColourRenderer implements Renderer {    @Override    public void preProcess(PreviewModel previewModel) {    }    @Override    public void render(Item item, RenderTarget target, PreviewProperties properties) {        if (target instanceof ProcessingTarget) {            renderProcessing(item, (ProcessingTarget) target, properties);        } else if (target instanceof SVGTarget) {            renderSVG(item, (SVGTarget) target, properties);        } else if (target instanceof PDFTarget) {            renderPDF(item, (PDFTarget) target, properties);        }    }    @Override    public PreviewProperty[] getProperties() {        return new PreviewProperty[]{                    PreviewProperty.createProperty(this, "MultiColourNode", Boolean.class,                    "Multi Colour Nodes",                    "Make a node be coloured more then one hue",                    PreviewProperty.CATEGORY_NODES).setValue(false)                };    }    @Override    public boolean isRendererForitem(Item item, PreviewProperties properties) {        return item.getType().equals(Item.NODE);    }    private void renderProcessing(Item item, ProcessingTarget target, PreviewProperties properties) {        //Params        Float xF = item.getData(NodeItem.X);        Float yF = item.getData(NodeItem.Y);        Float sizeF = item.getData(NodeItem.SIZE);        int x = xF.intValue();        int y = yF.intValue();        int size = sizeF.intValue();        Node n = (Node) item.getSource();        String colourList = (String) n.getNodeData().getAttributes().getValue("colourList");        ArrayList<Color> colourArray = splitColourList(colourList);        int radius = size - 4;        PGraphicsJava2D graphics = (PGraphicsJava2D) target.getGraphics();        Graphics2D g2 = graphics.g2;        // draw colour indices as pie chart around point        if (colourArray.size() > 0) {            double arcAngle = 360.0 / colourArray.size();            // draw 'pieces of pie'            for (int i = 0; i < colourArray.size(); i++) {                //System.out.println(Integer.parseInt(n.getColour(i)));                g2.setColor(colourArray.get(i));                g2.fillArc((x - radius), (y - radius), (radius * 2), (radius * 2),                        (int) (arcAngle * i), (int) arcAngle);            }            // draw 'spokes' between pieces            if (colourArray.size() > 1) {                Stroke oldStroke = g2.getStroke();                for (int i = 0; i < colourArray.size(); i++) {                    double spokeAngle = arcAngle * i / 180 * Math.PI;                    g2.setColor(Color.BLACK);                    g2.setStroke(new BasicStroke(0.5f));                    g2.drawLine(x, y, (int) (x + radius * Math.cos(spokeAngle)), (int) (y - radius * Math.sin(spokeAngle)));                }                g2.setStroke(oldStroke);            }        } else {            // draw filled white circle            g2.setColor(Color.WHITE);            g2.fillOval(x - radius, y - radius, radius * 2, radius * 2);        }        // draw black circle        g2.setColor(Color.BLACK);        g2.drawOval(x - radius, y - radius, radius * 2, radius * 2);        //original        //g2.setPaint(p);        //g2.fillOval((int) (x.floatValue() - radius), (int) (y.floatValue() - radius), (int) (radius * 2), (int) (radius * 2));    }    private void renderSVG(Item item, SVGTarget target, PreviewProperties properties) {        //Params        Float x = item.getData(NodeItem.X);        Float y = item.getData(NodeItem.Y);        Float size = item.getData(NodeItem.SIZE);        Node n = (Node) item.getSource();        String colourList = (String) n.getNodeData().getAttributes().getValue("colourList");        ArrayList<Color> colourArray = splitColourList(colourList);        Float radius = size - 3;        //float borderSize = properties.getFloatValue(PreviewProperty.NODE_BORDER_WIDTH);        float alpha = properties.getIntValue(PreviewProperty.NODE_OPACITY) / 100f;        if (alpha > 1) {            alpha = 1;        }        // draw colour indices as pie chart around point        if (colourArray.size() > 0) {            float arcAngle = (float) (360.0 / colourArray.size());            // draw 'pieces of pie'            for (int i = 0; i < colourArray.size(); i++) {                //Arc2D arca = new Arc2D.Float((x - radius), (y - radius), (radius * 2), (radius * 2), (arcAngle * i), (arcAngle), Arc2D.CHORD);                float[] startXY = toCartesianCoordinate(x, y, radius, arcAngle*i);                float[] endXY = toCartesianCoordinate(x, y, radius, (arcAngle*i)+arcAngle);                Element nodeElem = target.createElement("path");                nodeElem.setAttribute("class", n.getNodeData().getId());                nodeElem.setAttribute("fill", target.toHexString(colourArray.get(i)));                                nodeElem.setAttribute("d", "M" + " " + startXY[0] + " " + startXY[1] + " " + "A" + " " + radius + " " + radius + " " + 0 + " " + 0 + " " + 0 + " " + endXY[0] + " " + endXY[1]);                //PATH = M startXY[0] startXY[1] A radius radius 0 0 0 endXY[0] endXY[1]                                nodeElem.setAttribute("fill-opacity", "" + alpha);                nodeElem.setAttribute("stroke", "black");                nodeElem.setAttribute("stroke-width", "2");            }        } else {            Element nodeElem = target.createElement("circle");            nodeElem.setAttribute("class", n.getNodeData().getId());            nodeElem.setAttribute("cx", x.toString());            nodeElem.setAttribute("cy", y.toString());            nodeElem.setAttribute("r", size.toString());            nodeElem.setAttribute("fill", target.toHexString(Color.WHITE));            nodeElem.setAttribute("fill-opacity", "" + alpha);        }    }    private void renderPDF(Item item, PDFTarget pdfTarget, PreviewProperties properties) {        //TODO    }    /**     * turns a list of numbers into an ArrayList of Colours     *     * @param colorList String, list of colours taken from the column     * "colourList"     * @return An ArrayList of Colour objects, to be drawn on the node     */    private ArrayList<Color> splitColourList(String colourList) {        ArrayList<Color> toReturn = new ArrayList<Color>();        //-1 denotes a default value where no colours were attributed to a node        if (!colourList.equals("-1")) {            Scanner scan = new Scanner(colourList);            scan.useDelimiter(",");            while (scan.hasNext()) {                String str = scan.next();                Integer rgb = Integer.parseInt(str);                Color col = new Color(rgb);                toReturn.add(col);            }        }        return toReturn;    }    private float[] toCartesianCoordinate(float centerX, float centerY, float radius, float angleInDegrees) {        float angleInRadians = (float) (angleInDegrees * Math.PI / 180.0);        float x = (float) (centerX + radius * Math.cos(angleInRadians));        float y = (float) (centerY + radius * Math.sin(angleInRadians));        float[] arr = {x, y};        return arr;    }}
Thanks, hopefully we can crack this and get the plug in out there.

EDIT: After playing around with a few things I have discovered that preview mode is rendering two copies of the graph, mine and the default below it. This must be some error in how I have set up the plug-in!

Statistics:Posted by Ferretti — 13 Feb 2012 18:12


]]>
2012-02-12T16:28:29+01:002012-02-12T16:28:29+01:00 https://forum-gephi.org/viewtopic.php?t=1665&p=5661#p5661 <![CDATA[Re: [TODO] Selectable multiple attributes/colour per node]]>
At the moment it requires a column labelled 'colourList', which isn't to most straightforward thing
What data type to you use? Because we have a list type in Gephi. It can be imported from a GEXF for example by setting 'listint' for an integer list, separated by one of the default separators (,|;). We don't support color lists but anyway it's better to import ints or doubles and assign colors later. Lists are not really integrated in Gephi at this point (no filtering capabilities or ranking). The column will be there, visible in the Data Laboratory and accessible like any other column.
At the moment the 'colourList' column contains RBG values separated by commas, presumably stored as a String. I pull out this string and run it through a scanner to extract the RGB vales, which I then use to create the colours. Thing may be more complicated by the fact I am using GraphML to hold my graph data, I'm not sure if you can define types. The problem is a person will have to somehow know that if they want to use my plug-in they will have to have the specifically labelled 'colourlist' column, else it won't work.

Also I have the problem that it will always use this renderer even if I disable the checkbox, presumably this is some error on my part?
Are you defining a new Node Renderer or inherit from the default?
Currently I have:

CODE:

@ServiceProvider(service = Renderer.class)public class MultiColourRenderer implements Renderer {...}
A personal request - I like the feature in the overview where moving over one node highlights its neighbours, is it possible to replicate this in preview mode?
It should be possible but we avoided doing that to maximize refresh rate in Preview. Our idea was to have speed and interactivity in Overview and customization and aesthetic in Preview.
So would this be something I could easily turn on or would it requre lots of changes? It's not the most important thing but it makes the graph more interactive and feel more 'alive'.
Also is it possible to create a standalone interactive graph using Gephi as the basis but without having to actually load the gephi software?
Yes you can use the Gephi Toolkit. Here is an example of a standalone Preview component usage.
Great, I will look more into this.

Thanks for your help and all your work!

Statistics:Posted by Ferretti — 12 Feb 2012 16:28


]]>
2012-02-12T07:26:09+01:002012-02-12T07:26:09+01:00 https://forum-gephi.org/viewtopic.php?t=1665&p=5660#p5660 <![CDATA[Re: [TODO] Selectable multiple attributes/colour per node]]>
At the moment it requires a column labelled 'colourList', which isn't to most straightforward thing
What data type to you use? Because we have a list type in Gephi. It can be imported from a GEXF for example by setting 'listint' for an integer list, separated by one of the default separators (,|;). We don't support color lists but anyway it's better to import ints or doubles and assign colors later. Lists are not really integrated in Gephi at this point (no filtering capabilities or ranking). The column will be there, visible in the Data Laboratory and accessible like any other column.
Also I have the problem that it will always use this renderer even if I disable the checkbox, presumably this is some error on my part?
Are you defining a new Node Renderer or inherit from the default?
A personal request - I like the feature in the overview where moving over one node highlights its neighbours, is it possible to replicate this in preview mode?
It should be possible but we avoided doing that to maximize refresh rate in Preview. Our idea was to have speed and interactivity in Overview and customization and aesthetic in Preview.
Also is it possible to create a standalone interactive graph using Gephi as the basis but without having to actually load the gephi software?
Yes you can use the Gephi Toolkit. Here is an example of a standalone Preview component usage.

Statistics:Posted by mbastian — 12 Feb 2012 07:26


]]>
2012-02-11T19:17:16+01:002012-02-11T19:17:16+01:00 https://forum-gephi.org/viewtopic.php?t=1665&p=5659#p5659 <![CDATA[Re: [TODO] Selectable multiple attributes/colour per node]]>
A personal request - I like the feature in the overview where moving over one node highlights its neighbours, is it possible to replicate this in preview mode? Also is it possible to create a standalone interactive graph using Gephi as the basis but without having to actually load the gephi software?

Thanks

Statistics:Posted by Ferretti — 11 Feb 2012 19:17


]]>
2012-02-11T00:47:36+01:002012-02-11T00:47:36+01:00 https://forum-gephi.org/viewtopic.php?t=1665&p=5658#p5658 <![CDATA[Re: [TODO] Selectable multiple attributes/colour per node]]> Does it render with pdf and svg too?

Eduardo

Statistics:Posted by eduramiba — 11 Feb 2012 00:47


]]>
2012-02-10T21:21:21+01:002012-02-10T21:21:21+01:00 https://forum-gephi.org/viewtopic.php?t=1665&p=5657#p5657 <![CDATA[Re: [TODO] Selectable multiple attributes/colour per node]]> Statistics:Posted by admin — 10 Feb 2012 21:21


]]>
2012-02-10T20:43:54+01:002012-02-10T20:43:54+01:00 https://forum-gephi.org/viewtopic.php?t=1665&p=5656#p5656 <![CDATA[Re: [TODO] Selectable multiple attributes/colour per node]]>
Image

Statistics:Posted by Ferretti — 10 Feb 2012 20:43


]]>
2012-02-10T19:38:14+01:002012-02-10T19:38:14+01:00 https://forum-gephi.org/viewtopic.php?t=1665&p=5655#p5655 <![CDATA[Re: [TODO] Selectable multiple attributes/colour per node]]>
Ferretti wrote:Hi, thanks for fixing that, I have made some progress today but have hit a problem with getting the data.

I have stored my data in a column loaded from a graphML file. The column is called colourList, and contains a string of the format "colour1,colour2,colour3,etc" where the colours are rgb int values. What I want to do is read the string so I can pull out the values and use them to colour the nodes, however I'm not sure how to go about getting the data. I tried doing

CODE:

String colourList = item.getData("colourList");
but it returns null. How should I go about linking to this data in the column?

Thanks, James
Hi James,
item.getData is used for getting data stored in the item in the item builder.
To get data from the columns of a NodeItem you have to use some code like this:

CODE:

Node n=(Node) item.getSource();n.getNodeData().getAttributes().getValue("colourList")
Eduardo

Statistics:Posted by eduramiba — 10 Feb 2012 19:38


]]>
2012-02-10T18:40:48+01:002012-02-10T18:40:48+01:00 https://forum-gephi.org/viewtopic.php?t=1665&p=5654#p5654 <![CDATA[Re: [TODO] Selectable multiple attributes/colour per node]]>
I have stored my data in a column loaded from a graphML file. The column is called colourList, and contains a string of the format "colour1,colour2,colour3,etc" where the colours are rgb int values. What I want to do is read the string so I can pull out the values and use them to colour the nodes, however I'm not sure how to go about getting the data. I tried doing

CODE:

String colourList = item.getData("colourList");
but it returns null. How should I go about linking to this data in the column?

Thanks, James

Statistics:Posted by Ferretti — 10 Feb 2012 18:40


]]>
2012-02-09T08:33:20+01:002012-02-09T08:33:20+01:00 https://forum-gephi.org/viewtopic.php?t=1665&p=5635#p5635 <![CDATA[Re: [TODO] Selectable multiple attributes/colour per node]]>
My mistake. I updated the Gephi JARs but forgot to commit them. Thanks a lot for finding that.

I pushed them so it should work now. Sorry about that.

Statistics:Posted by mbastian — 09 Feb 2012 08:33


]]>