Comments (2)
Very good question! Short answer: no.
Longer answer: changing the size of objects is often much more complicated because of the dependency graph between the observables. For example, if you change the number of edges that will trigger a replot of the graph which will read the color
value for every edge. So you need to change the color vector first. But when you change the color vector this will trigger a update of the graph which migh errors because now you have more colors than edges.
I'd like this all to work but is very tedious to implement and to test because there are so many possible combinations. Feel free to make PRs or if you don't really now you can also post self contained test code here and i'll try to have a look on how to fix that.
The error you just showed is a bit more complicated: if you use "curvy" lines, internally every edge is draw using a separat lines
plot. If one changes the number of lines one needs to add one of those plots or remove it from the axis. Looking at the source again it seems like i was aware of that limitation but didn't bother :D
Line 557 in 061addf
The good news is: one would only need to update the beziergraphs
recipe. One would probably need keep track of all the line plots and delete!
and push!
according to the changes.
MWE to start working on that error would be
using GraphMakie
using GraphMakie: Line, beziersegments
pathes=Observable([Line(Point2f(0,0), Point2f(1,0)),
Line(Point2f(0,1), Point2f(1,1))])
fig, ax, p = beziersegments(pathes)
push!(pathes[], GraphMakie.Line(Point2f(0,.5), Point2f(0,.5)))
notify(pathes) # errors
EDIT: A more pragmatic simpler solution might be to detect changes in the number and then delete ALL line plots and reinitialize the complete beziersegments
plot. Or even more pragmatic: delete!
the graphplot
from the axis and create a new graphplop
whenever you change the graph. You don't need to reopen the whole figure for that.
from graphmakie.jl.
Thank you! This is really helpful. Actually, I have tried your approach on deleting the entire graphplot
object (say p
) and re-plot it. However, as my controls depends on the p
instance. When I replot, there is no way (as I know) to preserve p
(inplace modification), but a new graphplot
will be returned by the graphplot!
method. Therefore, all my controls lose track of the new graphplot
object.
Now I know that GraphMakie does not support this kind of usage. Maybe I will try the most straightforwad way: replot and re-construct my whole control panel, as my graph is really small (no more than 1000 nodes, typical number of nodes is 5 - 20).
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. HOT 1
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.