[deepamehta-devel] custom renderer question

Jörg Richter jri at deepamehta.de
Fr Sep 6 17:30:50 CEST 2013


On Sep 5, 2013, at 13:42, Torsten Ziegler wrote:

> Concerning the rendering I agree with you,
> one way would be to rewrite the topicmap renderer,
> but I would prefer to use some hooks in the standard
> implementation.
> I would like to use hooks for:
> - delivering a custom html rendering for a topic
> - defining custom areas where the topic is clickable to activate it (might be bigger, smaller than outline or non continuos )
> - changing the reaction to a mouse click, doubleclick, drag (move)
> - triggering a re-rendering of a topic (might be done by hide and show)

When you want a custom **HTML** rendering for a topic the default topicmap renderer would not be suitable as it is Canvas based (it's just a bitmap, there is no DOM for the individual topics/associations).

In this case I would no longer recommend to equip the default topicmap renderer with further extension points (my job) but to implement a custom topicmap renderer (your job). The DM Webclient framework provides all the basics needed by 3rd party developers to implement a custom topicmap renderer. When implementing your own one you have full control over the rendering approach and all user interaction. Furthermore you can have a custom view model for the topicmap, which is important as you must store the data you need for presenting the topicmap (coordinates, colors, contents, ...).

When you want implement your own topicmap renderer it is a good starting point for you to look at the 3 existing renderer implementation mentioned in my original reply. Perhaps it is a good idea to continue the development of the SVG-based renderer. Its implementation has reached basic functionality but is not finished. Perhaps you can adopt this project from Jörn. Being SVG-based the cool thing about it is each topic/association has its own DOM which simplifies e.g. click detection and event handling.

However, I still don't not know enough about your actual goal. If you want just draw a frame around a topic you would not neccessarily need a DOM (HTML/SVG) but could use the Canvas of the default renderer for that. Besides the extension point for the topic drawing I could equip the default renderer with further extension points for click detection and event handling as you mentioned above. And what about the topicmap view model? Is the standard topicmap view model sufficient (topicmap-based topic coordinates, topic content, topic type-based view data, e.g. icon)?

> I guess that using these hooks it would be also possible
> to work with custom associations that show
> arrows or some text besides them as they also
> are topics by themselves ?

Here again we must think about the view model. What data is needed to render an association? Is the assoc type and the 2 role types + the assoc type-based view data, e.g. color enough, as it is now? Or do we need further per-association instance view data? Is it really per-association instance? Or is it per-association-topicmap-pair, that is the same association is rendered differently in different topicmaps (like the same topic has per-topicmap individual coordinates)?

Lets try to further investigate these questions:
- Do you really need a DOM per topic/association (SVG topicmap renderer) or would the Canvas (default renderer) do as well? The extensibility you sketched out so far is realizible in both cases.
- What data do you need to render a topic/association within a particular topicmap? What's your view model?

Cheers,
Jörg




Mehr Informationen über die Mailingliste devel