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

How to split the animation into two animation contexts (two separate canvases in same canvas)? #31

Closed
mantzaris opened this issue Feb 19, 2018 · 4 comments

Comments

@mantzaris
Copy link

mantzaris commented Feb 19, 2018

I am would like to know if it possible to; have a ball like simulation and a different 'context/pane/section' next to it, which the simulation does not move into, and then in the different area something such as statistics of the balls can then be displayed.

Would that use the 'tiles/partitions'? http://juliagraphics.github.io/Luxor.jl/stable/basics.html#Tiles-and-partitions-1

The partitions and tiles seem to provide the position context but does the algorithm utilizing them need to ensure the boundaries are respected? Can the background of the tiles be recalled to erase mistaken trespasses ?

@cormullion
Copy link
Member

I think most basic 2D tasks are possible, it's more a matter of how much code you're prepared to write... :)

juliapool

code

Formatting the text is one of those tasks where I can imagine having to write a bit of code, simply because you're having to position each piece of text intellligently. No tables or legends in Cairo, so you'd have to roll your own.

@mantzaris
Copy link
Author

mantzaris commented Feb 20, 2018

Thank you for this. I see that you used 'Tiles'. Would the 'Partition' function deliver anything different? How would I be able to produce a different back ground if the back ground function is the same? Would the partition function apply in context when the background function is called?

@mantzaris
Copy link
Author

Theoretically could you use the 'origin()' function to reset the coordinate reference point/

@cormullion
Copy link
Member

The difference between Tiles and Partition is really just whether you want to specify the quantity of panes or their dimensions. (You can’t specify both at the same time, oddly enough...) But they’re both just simple iterators to help with positioning and dimensions, they’re not ‘smart’ graphic objects with properties such as ‘background’ color schemes.

I believe the background() function works with the current clipping region, which is either the whole drawing, or the current clipping path, if you’ve set one up. So to change the background color of a pane, you can define a rectangular clipping region and use background(), or just draw a box and fill it.

origin() takes you to the original center of the drawing, not always useful.

Cairo/Luxor is fairly low-level!

The Compose.jl package is perhaps more what you think a graphics package should be - being aligned more with the needs of statistical graphics, R’s Grammar of Graphics, plotting and visualisation tools, Gadfly, declarative graphics, and so on. Not my thing (hence Luxor) but v. popular with the academic side of the Julia community because of the higher-level focus.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants