fatteneder / MakieSlides.jl

MIT License
17 stars 2 forks source link

Merge with MakiePresentation #2

Closed ffreyer closed 2 years ago

ffreyer commented 2 years ago

This will close #1. For now I've mostly just replaced MakieSlides code with MakiePresentations code and added an example.

TODO

fatteneder commented 2 years ago

Just noticed that you are already merging and preparing the move from @Layoutables to @Blocks. I was still holding back, because I was drafting things, but updating now makes sense.

I also updated positioning with FormattedLabel and it is much better now (replaced halign, valign with hjustify, vjustify options).

Also moving to a branching workflow for the drafting so to not interfer anymore with this PR.

fatteneder commented 2 years ago

I fixed the conflicts over here https://github.com/fatteneder/MakieSlides.jl/tree/fa/resolve-conflicts. Feel free to merge it into here, just did not want to interrupt any progress you made on this.

I got the automatic box height adjustment going again by switching from layoutboservables.autosize to layoutobservables.reportedsize. Not sure whether this is the right way to do it though ...

Also noticed a bug in line wrapping I introduced yesterday where characters are cut off at the beginning of the line. EDIT: Fixed it on the above branch.

ffreyer commented 2 years ago

I was already working on merging changes so I just used my version for now.

I've been quite destructive with updating things to blocks and I probably broke some stuff along the way. Though I also don't know how they worked before. It would be good if you went through the changes and repaired the damage I did. I left most of the old code as comments so you can still refer back to a lot of it.

Some problems I noticed:

As a note I replaced some of the layouting code in FormattedLabel with the code I have in the Makie pr because the old version was endlessly looping for me.

As another note I added a "new_mwe.jl" in the example folder which should be working.

fatteneder commented 2 years ago
  • lists are not left aligned and have visible boxes as the last entry

They are left aligned for me if I use my version for layouting in FormattedLabel, see below. The visible box at the end I have in there to tell its height such that the other labels are all shifted/flushed to the top. It just had a color for debugging. I don't like this solution, do you know of a better approach?

  • lists use * as markers rather than unicode dots or some other nicer symbols

The itemization_symbol is there to pick markers. I changed the default to the unicode dot from your MWE.

  • tables are completely broken for me. My markdown strings don't have an align field and no rows either

That's an annoying one. The Markdown parser interprets blocks with (I think) two or four spaces or multiples thereof as code blocks, hence, the wrong type. If you left align the whole table within md""" """ then it works. I am already thinking of moving to CommonMark.jl as an alternative Markdown parser, because that one offers more configuration options also for parsing, not sure if this behavior is configurable though ...

  • FormattedLabel is missing characters when wrapping like you mentioned

Fixed.

As a note I replaced some of the layouting code in FormattedLabel with the code I have in the Makie pr because the old version was endlessly looping for me.

I looked into your version and I remember having something similar when I started (I took it from Label). I can't see why it does not left align the text if FormattedLabels are used in a GridLayout. For now I changed that back to what I had before, but fixed the infinite update loop by updating now reporetedsize instead of autosize. Perhaps we can reconsider this whenever line wrapping is merged in Makie.jl.

Thanks for doing the Layoutable to Block refactor for me. I cleaned up the dead code and with the new Block API things look much simpler now.

fatteneder commented 2 years ago

I played a bit around with the presentation mode and it works. However, on my machine I notice lag when moving between slides. My first implementation with the one-figure-for-each-slide had some lag too, but I remember it to be less than what I observe now.

Perhaps I should dust out the old implementation and do a comparison. But then we would loose the common parent feature, hmmm :/