# Convert Observable Vector of Ranges into Vector of Observable Ranges

**URL:** https://discourse.julialang.org/t/convert-observable-vector-of-ranges-into-vector-of-observable-ranges/88006
**Category:** Visualization
**Tags:** makie
**Created:** [September 29, 2022, 7:09pm UTC](https://discourse.julialang.org/t/convert-observable-vector-of-ranges-into-vector-of-observable-ranges/88006 "2022-09-29T19:09:15Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![jar1](https://avatars.discourse-cdn.com/v4/letter/j/c0e974/32.png) [@jar1](https://discourse.julialang.org/u/jar1)
#### Post date: [September 29, 2022, 7:09pm UTC](https://discourse.julialang.org/t/convert-observable-vector-of-ranges-into-vector-of-observable-ranges/88006/1 "2022-09-29T19:09:15Z")

</div>

I have an observable vector of ranges and I want a vector of observable ranges so I can call `lines` on them. How can I do that?

```julia
using WGLMakie, LinearAlgebra, Chain, Compat

c = Observable([5,6,7])
vertices = map(collect, Iterators.product(Iterators.repeated([-1,1],3)...))
edges = @chain vertices begin
    Iterators.product(_, _)
    collect
    filter(Base.splat((v,w)->sort(abs.(v-w))==[0,0,2]), _)
    map(x->stack(x; dims=2), _)
end

screenposition((x,y,z)) = [x/z,y/z]
screenpoints = lift(c) do c
    map(v->screenposition(v-c), vertices)
end
screenedges = lift(c) do c
    map(edges) do e
        from, to = mapslices(screenposition, e .- c; dims=1)
        from:.01:to
    end
end

```
