Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document what is Mouse.left what is Mouse.down what is DragEnum etc. #561

Open
Datseris opened this issue Dec 22, 2018 · 4 comments
Open
Assignees
Labels
documentation good first issue Makie Backend independent issues (Makie core)

Comments

@Datseris
Copy link
Contributor

So that other people (like me) can help development of the interactive API. At the moment it is something alien that I Can just use through example. This is not the proper way forward...

(finally found Mouse in interaction/iodevices.jl...)

@Datseris
Copy link
Contributor Author

I am asking of a Documentation of how to use Mouse.down. I have been trying very hard by myself (see Slack) but it didn't work, so I guess a bit more help in the docs is necessary.

@asinghvi17 asinghvi17 self-assigned this Jul 20, 2019
@asinghvi17
Copy link
Member

Also could use a description of the keyboard enum. Will probably put this in the interaction section...

@asinghvi17
Copy link
Member

@SimonDanisch could you give a simple example of using DragEnum? There is edit_polygons but that's a little complicated

@SimonDanisch
Copy link
Member

Maybe something like:

function drag_scatter!(scene, scatterplot)
    idx = Ref(0)
    points = scatterplot[1]
    on(events(scene).mousedrag) do drag
        if ispressed(scene, Mouse.right)
            if drag == Mouse.down
                plot, selection = mouse_selection(scene)
                (plot === scatterplot) && (idx[] = selection)
            elseif drag == Mouse.pressed && checkbounds(Bool, points[], idx[])
                pos = mouseposition(scene)
                points[][idx[]] = pos
                points[] = points[]
            end
        else
            idx[] = 0
        end
        return
    end
end


s = scatter(rand(4))
drag_scatter!(s, s[end])
s

@jkrumbiegel jkrumbiegel transferred this issue from JuliaPlots/AbstractPlotting.jl Apr 27, 2020
@jkrumbiegel jkrumbiegel added Makie Backend independent issues (Makie core) documentation labels Apr 27, 2020
@SimonDanisch SimonDanisch removed this from In progress in Makie.jl planned features Sep 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation good first issue Makie Backend independent issues (Makie core)
Projects
None yet
Development

No branches or pull requests

4 participants