Interfaces for creating new rankings and transformer. RankingBuilder
feeds the list of available rankings. The default rankings include for
instance 'Degree' or numerical attribute columns. Transformers apply for
instance color or size transformation to objects.
Create a new Transformer
- Create a new module and set
RankingAPI
, GraphAPI
and Lookup
as dependencies.
- Create a new builder class by implementing
TransformerBuilderr
,
this class is basically a factory that will create the transformer on demand.
- Add @ServiceProvider annotation to your builder, that it can
be found by the system. Set
TransformerBuilder
as the
annotation parameter. You can also add a position to define the order
your transformer should be displayed. Put 1000 to be displayed after
the default one.
- Implement the
isTransformerForElement()
method. If your
transformer manipulates both nodes and edges, return true
when the element type is Ranking.NODE_ELEMENT
or
Ranking.EDGE_ELEMENT
. If it manipulates only one element,
restrict in consequences.
- Create a new class that implements
Transformer
. One can
add a dependency to the RankingPlugin module and extends the
AbstractRanking
.
- Configure the Target type of you transformer. If your transformer works only
with nodes, put
NodeData
, if it works only with edges, put
EdgeData
. If it works with both, put Renderable
or
Attributable
. These are interfaces both nodes and edges implement.
- Implement the
transform()
method of the transformer.
- If the transformer needs an UI, create a new class that implements the
TransformerUI
interface. Add @ServiceProvider annotation
to your class, that it can be found by the system. Set TransformerUI
as the service annotation parameter.
- Configure the
isUIForTransformer()
to return true
only
when the given transformer is an instance of the Transformer you defined earlier.
- Implement a user interface and set the
getPanel()
method to return it.