New/extend Model presentation

balage
balage New Altair Community Member
edited November 5 in Community Q&A
Hi everyone!

I'm rather new in RM development and I wasn't able to find info on how to implement new or extend existing visualization of the result (model) of an operator.

We have a self made operator which produces a model which is a descedent of the class com.rapidminer.operator.learner.tree.TreeModel.
It is displayed well using some built-in visualizer: as a graph or a text.

However, I would like extend the visualization in several ways:
  • I would like to provide an alternative textual display (in other words: overriding how the visualizer displays the model as text)
  • I would like to add new ways of visualization, either within the same tab or as a new tab/window
I tried to figured out how the binding of model and visualizer works and how to override/extend it, but got lost.

Can anyone give me the first hints where to search for more information or how to do it?

Thanks in advance!

Balage

Answers

  • Marco_Boeck
    Marco_Boeck New Altair Community Member
    Hi,

    I've never tried to do anything of the sorts, so I can't give you a detailed description here, but from what I found I think you should have a look at the RendererService class, especially the registerRenderers(String, String, boolean, String, List<String>, ClassLoader) method.
    As far as I see it, the ResultDisplay asks the RendererService what kind of renderers are linked to these result objects, and then proceeds to create all renderers which have been registered for the result IOObject(s). So if you register your own renderers, they should show up as well.
    As for your other question, you should have a look at the implementations of the Renderer interface. DefaultTextRenderer should be the one you are looking for.

    Regards,
    Marco
  • balage
    balage New Altair Community Member
    Thanks!

    It was quite what I needed.
    With your hints, I found where the association of Models and Renderers are done. I also found the config file where the default ones are defined.
    I was able to register my own ones through my plugin initGUI function.

    However there are still some issues I have to solve: It seems that the registerRenderer gets only one classLoader and my plugins loader is differs, so I can only assing to my model renderer classes from my own package. It made it necessary to make a dummy copy (a subclass of it having nothing in it) of the original graph renderer to be able to add original and both new renderers. It is not pretty and I don't like, but at least it works.

    Thanks again.
    Balage