Comments (3)
I tried to look into this a bit. Didn't get to any solution, but the additional info might be helpful.
For the case of node click handlers, nothing happens because of the last if statement below always being false. It seems that a click on a node used to give back the Scatter plot of the nodes, and now it returns a Mesh.
In MakieOrg/Makie.jl#1658 mouse_selection
was deprecated for pick
, but replacing that doesn't work. Still it might be related. The new point picking docs are here: https://makie.juliaplots.org/stable/documentation/events/#point_picking
So what is this Mesh that it returns, and how do we get the Scatter plot of nodes back with pick
(get_node_plot(gp::GraphPlot)
)?
from graphmakie.jl.
Thanks for bringing this up. I played around a bit but could not resolve it yet. Using the simple code below you can see that the interactions still work but the reportet elements are infact not the ones below the cursor but a bit offset. However both node and edge interactions work.
Maybe there is some problem with whether the mouse position is calculated with respect to the axis or the figure?
g = wheel_graph(10)
f, ax, p = graphplot(g,
edge_width = [2.0 for i in 1:ne(g)],
edge_color = [colorant"gray" for i in 1:ne(g)],
node_size = [10 for i in 1:nv(g)],
node_color = [colorant"red" for i in 1:nv(g)])
hidedecorations!(ax); hidespines!(ax)
deregister_interaction!(ax, :rectanglezoom)
function node_hover_action(state, idx, event, axis)
p.node_size[][idx] = state ? 20 : 10
p.node_size[] = p.node_size[] # trigger observable
end
nhover = NodeHoverHandler(node_hover_action)
register_interaction!(ax, :nhover, nhover)
function edge_hover_action(state, idx, event, axis)
p.edge_width[][idx]= state ? 5.0 : 2.0
p.edge_width[] = p.edge_width[] # trigger observable
end
ehover = EdgeHoverHandler(edge_hover_action)
register_interaction!(ax, :ehover, ehover)
from graphmakie.jl.
I checked, and this example now works well on the newly released Makie v0.17.4. Thanks for tracking the issue upstream!
from graphmakie.jl.
Related Issues (20)
- curve_distance & curve_distance_usage observable not updating figure
- Precompilation stuck on Julia 1.9 HOT 6
- handle overlapping `nlabels` HOT 6
- node_color and node_marker only accept Symbol HOT 5
- Performant graph plotting and benchmarking HOT 4
- Element-wise `automatic` configuration HOT 1
- Deleting a plot doesn't remove all listeners HOT 2
- Mixing directed and undirected edges HOT 2
- Add padding around graphplot to accommodate node size. HOT 2
- `node_attr` broken using Makie v0.19.11 HOT 1
- Slow start HOT 2
- Setting node size with ilabel
- Improve Reftests HOT 1
- provide convenience function for MetaGraphsNext HOT 7
- KeyError: key :textsize not found when running doc examples HOT 2
- UndefVarError: `mouse_selection` not defined HOT 5
- arrow_shift = :end works poorly with larger edge width HOT 6
- bounding box cuts off nodes HOT 3
- `pick` one `LineSegments` returns odd index HOT 2
- Dynamic Layout + Interaction.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graphmakie.jl.