I am repeating for the n-th time: The input to
Mondrian are not nodes
& edges. The input are only entities which can be anything. The engine
simply provides a means to transform your entities into nodes and
edges.
Take this point of view, and you will see that it becomes consistent
:)
You keep on repeating that you are passing nodes to the edges:, but
you are not. You are always passing some entities from which the edges
are to be constructed. That is all. It just happens that you choose to
use the same entity as a model for both an node and an edge. It is
clear that if there is no easy mapping between the entity model and
the graph model, the script can become cumbersome.
Let's take your example:
view node: 'node' forIt: [
view interaction
whenEnteringUpdateNode: [ :aValue |
view edges: {aValue} from: #yourself toAll: ((1 to: 9) copyWithout:
aValue ) ].
view shape rectangle size: 30.
view nodes: (1 to: 9).
view gridLayout gapSize: 10.
First, this example is not instructive because it takes several
shortcuts, but let's just focus on aValue.
In your script, aValue is the value behind the node, not the node. The
node is another object. Then you use it also as the model for the edge
because you do not have anything else. So, you will have the same
aValue object used both for creating the node and for creating the
edge.
So, a method like
buildEdgesFromVertices: nodes fromAccessor: aValuable toAccessor:
aValuable
is wrong in the context of Mondrian, because it uses the wrong
vocabulary.
How is that? :)
Cheers,
Doru
On 20 Jun 2011, at 14:15, Stéphane Ducasse wrote:
On Jun 20, 2011, at 1:32 PM, Tudor Girba wrote:
Hi Stef,
On 20 Jun 2011, at 13:18, Stéphane Ducasse wrote:
I think that this is more than just having
correct/good
comments....
is the parameter passed to edges: consistent? I do not think so
It is consistent. All the time the first argument sent to
edges:from:to and nodes: is meant to hold a collection of entities
that will be the model behind the graph element. In the case of
nodes, there is no fancy transformation. In the case of edge, there
are two transformations. That is all.
If you find a case in which this is not true, then we need to fix
that.
at least from what I understood
edges: from: to:
and
aView edges: someFamixInvocations from: #sender toAll:
#candidates
show different cases.
Now if nodes: except a collection of entities playing the node
role
why edges is not a collection of antities playing edges role?
It is.
No it is not
You have to send messages to nodes to get edges so the collection is
not an edge collection
Corollary
why in some cases this is the case and in other not?
Just the comments are misleading. It is always the same. Only when
you have something marked differently, you expect a different
input, like edgesFromAssociations: which expect to have a
collection of associations. But those are just convenience.
I really lost then.
Because in
view node: 'node' forIt: [
view interaction
whenEnteringUpdateNode: [ :aValue |
view edges: {aValue} from: #yourself toAll: ((1 to: 9)
copyWithout: aValue ) ].
view shape rectangle size: 30.
view nodes: (1 to: 9).
view gridLayout gapSize: 10.
aValue is a node not an Edge?
I always have the problem with mondrian that what I say is wrong. It
is a wonderful feeling.
Now I see what the API says
is Oh
nodes: nodes you specify nodes with nodes nice
but you specify edges with nodes...... not nice
edges: nodes
And for me this is confusing. Because why do I have to remember
that edges: is not about edges but about nodes that will generate
information about edge.
What you call declarative for me is really confusing.
Now changing aCollection to aCollectionOfEntities only work is you
explain systematically in the comments that theses are entities
in fact the entities that are not first class relationship and
nodes that can generate information to represent the edges. Else
without context
collectionOfEntities look like collection of objects.
Again, the comment needs to be fixed.
Does this clarify the situation?
Yes but I do not like it. Why because
edges: from: to: is connoted
Since math exist edges: are edges and not vertices from: is a vertex
and to: another vertex
So if I need to build visualization in Mondrian I will build a layer
on top a layer for idiots like me.
buildEdgesFromVertices: nodes fromAccessor: aValuable toAccessor:
aValuable
Now I would really like to have a non declarative way of expressing
that. In fact I do not even understand why a declarative way is
supposed to be better than an imperative one.
Especially because most of the time the order is important in
Mondrian.
Declarations does not talk to me and the the stack semantics of
Mondrian is difficult to understand and debug. And do not dream
there will be no debugger able to debug Mondrian scripts
in the close future. So we are left with method names and arguments
and guessing right.
What frustrate me with mondrian is that I'm programming in lisp
without any debugger, but worse not printf.....
So I start fast and boum I hit the wall and got trapped in DSL
swamps.
Stef
_______________________________________________
Moose-dev mailing list
Moose-dev(a)iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
"There are no old things, there are only old ways of looking at them."
_______________________________________________
Moose-dev mailing list
Moose-dev(a)iam.unibe.ch