-
-
Notifications
You must be signed in to change notification settings - Fork 370
Using a Compute graph as alternative to Observables #4630
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
Conversation
|
Progress on GLMakie: The number of failing tests is now down to 15, with 27 tests throwing errors. TODOs/Problems:
|
|
CairoMakie is now at 2 fails - 28 errors, GLMakie at 14-27 |
| function Float32Convert(resolution = 1e4) | ||
| scaling = LinearScaling(Vec{3, Float64}(1.0), Vec{3, Float64}(0.0)) | ||
| return Float32Convert(Observable(scaling), resolution) | ||
| return Float32Convert(Observable(scaling; ignore_equal_values=true), resolution) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be useless because update_limits!() already skips updates when the current scaling is acceptable.
|
Just a thought related to #4752 - would it make sense to have "versioned" nodes in the compute graph? For example with linesegments we have This would make the pipeline easier to adjust because naming would become easier. E.g. if I wanted to hack the linesegments pipeline to do something to That would be quite useful for transform functions that change geometry as described in #4752. Maybe it would also be useful in recipes? |
src/compute-plots.jl
Outdated
| attribute_per_pos!(attr, :scaled_color, :synched_color) | ||
| attribute_per_pos!(attr, :linewidth, :synched_linewidth) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This only applies to LineSegments. For them it maps a value per point pair to two values for the vertices, which results in per-segment colors/linewidths. In Lines this would result in a const value segment, then a gradient segment, then a const value segment, etc.
src/utilities/texture_atlas.jl
Outdated
| function all_marker_computations!(attr, atlas_res=1024, atlas_ppg=32) | ||
| atlas_sym = Symbol("atlas_$(atlas_res)_$(atlas_ppg)") | ||
| if !haskey(attr, atlas_sym) | ||
| register_computation!(attr, Symbol[], [atlas_sym]) do _, changed, last | ||
| (get_texture_atlas(atlas_res, atlas_ppg),) | ||
| end | ||
| end | ||
| inputs = [atlas_sym, :uv_offset_width, :marker, :font, :markersize] | ||
| outputs = [:sdf_marker_shape, :sdf_uv, :image] | ||
| register_computation!( | ||
| compute_marker_attributes, attr, inputs, outputs | ||
| ) | ||
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When switching between GLMakie and WGLMakie this should error because we'll try to re-register the computation with "atlas_1024_32" instead of "atlas_2048_64" or vice versa. If it doesn't this may cause incorrect uvs to be used because they may be sampled from a different atlas.
Benchmark ResultsSHA: e858b8eca5ac2801b1daa3ff7658dedc5db88fad Warning These results are subject to substantial noise because GitHub's CI runs on shared machines that are not ideally suited for benchmarking. |
* restrict computepipeline version * Makie needs a license * update CHANGELOG * correct version
|
just want to say thank you for all the work you put into the new compute graph! my website is amazingly fast now!! |
This introcudes
ComputePipeline(all names very WIP) as an alternative to Observables, which solves:State of this PR:
Primitive plots
Implementations for primitive plots tend to go through stages. First is an initial implementation, where simple plots like
scatter(rand(10))work. The second stage includes connecting various attributes that have not yet been connected and fixing errors. The last stage is having all tests pass, which is not in reach until the pr is close to done.General
TODO:
color::Computed.value::Symbol = RGBAf(...),barplot lowclip highclip nan_colortrying to set highclip to a Symboldata_limits()andboundingbox()methodsmove_toneeds to do some surgery to disconnect the plot compute graph from its parent scene compute graph and connect it to another without loosing dependenciespixel_spaceis needed in any plot, remove it if notsurfacegenerates incorrect normals with distorting transform funcs (and model?) (we no longer consider transform_func in mesh gen in CairoMakie and WGLMakie)Breaking:
attr = copy(Attributes(plot)); pop!(attr, ...); attr[...] = ...style of preparing passthrough attributes does not work anymoreplot!(parent, args..., parent.attributes...)syntax does not work anymoreplot!(parent, attr, args...; kwargs...)replace_automatic!does not work with ComputeGraph + Observable defaultsp = text(string); p[1]is no longer a String, but the positionannotations!()(which have been deprecated in favor oftext!())Maybe breaking:
@recipe BarPlot (x, y)used to work with PointBased conversions, but doesn't anymore (removed in barplot, waterfall, tooltip)State of this PR: first implementation for various plots, hacking into the plot pipeline to replace the their constructors and hijack it with a computegraph implementation for convert_arguments/convert_attributes and any backend computation. It currently leaves the plot type unchanged and stores the compute graph in
plot.args[1](lol) and overloads a few methods already just for Scatter (not getproperty etc though, yet).Next steps:
Continuation of: #4550 and #4360
Notes