Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [elk-dev] Meta Data Language

Hi Miro,

thanks for the effort! I inlined some answers below.

One further question. As you probably remember, layout options have to be resolved manually for klayjs. Do you think we can automatically generate this resolver using the new language?

Ulf

On Mon, Feb 1, 2016 at 10:39 AM, Miro Spönemann <miro.spoenemann@xxxxxxxxx> wrote:
Hi elk lovers,

here’s a proposal for an algorithm and layout options meta data language:


The generated code is currently not checked in, so you have to run GenerateMetaData.mwe2 manually. We should decide whether to check in the code or not and then apply the same to the Graphviz Dot language. It’s not hard to generate the code during the auto-build:


Furthermore, you will have to start a new Eclipse instance in order to use the meta data text editor. As soon as we have included the new plugins into the build, we can add them to the update site and include them in the Oomph setup so our developer instance will already have that editor.

The file extension is *.elkm (use Ctrl/Cmd + Shift + R to find the meta data files). A Java file is generated into src-gen for each elkm file. For example, the class LayoutOptions is now no longer hand-written, but generated.

Note how the linking between the elkm files and also between elkm and Java files works:
 - Ctrl/Cmd + Shift + R, type ‘Core.elkm'
 - Ctrl/Cmd + O, type ‘portConstraints’
 - Ctrl/Cmd-click onto ‘PortConstraints' to navigate directly to the enum type


Further observations:

 - Some enum options have an ‘UNDEFINED’ value (Direction, EdgeLabelPlacement, EdgeRouting, PortAlignment, PortConstraints, PortSide). We could remove those and set the default to null for the general option. Then we should make sure every algorithm that supports these options defines proper default values for them and uses the ‘duplicated’ keyword in its ‘supports’ declaration in order to generate a Property with overridden default value (see e.g. how this works for SPACING). Advantage: UNDEFINED would not be visible in the Layout view anymore.

I vote for removing UNDEFINED. 
 

 - Is there any reason for not merging the two Graphviz plugins into one?

You mean graphviz.dot and graphviz.layouter? I guess one reason is kwebs, where you can (theoretically) have the dot format without the graphviz layouters. I don't think this is a blocker for merging the two plugin but we have to make sure that we don't introduce a ui dependency (there's an optional ui dependency in graphviz.layouter).
 

 - The tree algorithm has plugin id org.eclipse.elk.alg.mrtree but package name org.eclipse.elk.alg.tree

 - How should we proceed with lower / upper bounds? For now I removed those from the meta data. I am thinking about introducing a more general approach of “graph validation”, which could be applied before any algorithm is executed. My feeling is that it would be more useful to throw an exception in this pre-layout phase instead of silently ignoring negative spacing values. If the source of the wrong values is programmatic, they should be fixed anyway. If the source is the UI (Layout view), ideally we should mark the wrong values there so the user gets an early feedback about nonsense configurations.

I don't like them. For most of the options they are irrelevant anyway. I like the idea of having a separate validation (which can be turned of in favor of performance).
 

 - Now we’re ready to generate documentation for algorithms and layout options. What would be a suitable format for that? And is there additional information would we like to add into the meta data in order to enhance the documentation?

I would prefer some kind of markdown, maybe the github stuff if we host the pages there anyway. 
 

Miro

_______________________________________________
elk-dev mailing list
elk-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/elk-dev



Back to the top