Makie.jl: missing Observables from makie

Created on 14 Apr 2020  路  8Comments  路  Source: JuliaPlots/Makie.jl

julia> a = Makie.Observable(rand(5))
ERROR: UndefVarError: Observable not defined
Stacktrace:
 [1] getproperty(::Module, ::Symbol) at .\Base.jl:26
 [2] top-level scope at none:0
julia> a = Makie.Node(rand(5))
Observable{Array{Float64,1}} with 0 listeners. Value:
[0.8777070772545308, 0.08807852512638004, 0.889451005211209, 0.045739032982380134, 0.3469881760911002]

it ~is totally not cool~ makes little sense to use "Node" instead of the name of what the thing actually is. Please allow Observables, or better yet, replace all Node with Observable.

planning

Most helpful comment

If I make my marker color a "Node", I don't make it part of a graph

That's not really true, since you do make it part of a call back tree:

a = Node(1)
b = Node(2)
c = map(+, a, b)
...

So these observables will be connected in a graph like structure ;)
But of course, that tree only blossoms inside Makie for your example^^

Anyways, I was also considering to drop the Node alias.
Having my own alias helped a lot going from Reactive.jl to Observables.jl, so I thought its a good idea to keep having this.
But going forward, I started using Observable almost exclusively in my code, and I'm pretty sick of the confusion and having people chose between those two...

All 8 comments

I'm not really keen on an issue text stating that something is "totally not cool" - not so much that it's not so friendly, but it's also really vague. Could you maybe specify exactly what issue this is causing for you, or whether this is in violation on official guidelines?

Anyway, there's a reason for this - it allows to change what Node does in Makie without committing type piracy - there's no promise that it will continue being identical to an Observable.

True, you have a point, and I apologize for my offensive and misleading wording, so I altered the text to reflect the reality as I see it in my eyes. Here is why I see the reality like this:

  1. Node, the english word Node, has no thematic connection whatsoever in the context it is used. Unless there are meanings to the word Node that I am not aware of. All the meanings I know, don't make any reasonable sense to fit here.
  2. Observable and Node are _actually the same thing_, but using different names hints otherwise.
  3. User has to understand the above statement, and understand that they should learn to use Observables in order to use Nodes. E.g. any error messages regarding the use of Node in fact are error messages about Observable.
  4. I have written the http://makie.juliaplots.org/stable/interaction.html page (or atleast its initial version). Repetition of Observables documentation is mandatory, since Makie pretends they are not they same thing with Nodes. As long as a different name is used, we can't say "here is the docs of observables link".

it allows to change what Node does in Makie without committing type piracy

Please explain to me how this is possible. Any dispatch towards Node is in fact dispatch towards Observable.

IMO we're pretty set on the Observables system, so I can see where this is coming from. We could make an alias Obs or something instead?

In any case, even if you completely disagree with what I say, it costs you nothing to export Observable as well as Node.

Can do, that shouldn't be hard. To address your comment - vertices of graphs are also called nodes, so if you think of Observables as encoding dependency chains of updates, then this makes sense.

I personally agree it would make sense to have it just be Observables, but I don't know if Simon plans to take the Node implementation somewhere else. (And Observable is terrible to type :smile: )

vertices of graphs are also called nodes, so if you think of Observables as encoding dependency chains of updates, then this makes sense.

Yes I am familiar with graph theory and I thought that Node comes from there. Yet I still argue that the name doesn't make sense here. There is no dependency encoded in Node in Makie, at least not in the basic level. For Makie, "Node" is anything whose value can change interactively in real time. In addition, there is no "connection" encoded in Makie's Nodes (something absolutely mandatory in graph theory), at least not from the user perspective: If I make my marker color a "Node", I don't make it part of a graph, I just make its value possible to change in real time.

The graph version of node has no connection to this behavior.

If I make my marker color a "Node", I don't make it part of a graph

That's not really true, since you do make it part of a call back tree:

a = Node(1)
b = Node(2)
c = map(+, a, b)
...

So these observables will be connected in a graph like structure ;)
But of course, that tree only blossoms inside Makie for your example^^

Anyways, I was also considering to drop the Node alias.
Having my own alias helped a lot going from Reactive.jl to Observables.jl, so I thought its a good idea to keep having this.
But going forward, I started using Observable almost exclusively in my code, and I'm pretty sick of the confusion and having people chose between those two...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tshort picture tshort  路  5Comments

phlavenk picture phlavenk  路  6Comments

grahamas picture grahamas  路  3Comments

Datseris picture Datseris  路  7Comments

Datseris picture Datseris  路  7Comments