-
Notifications
You must be signed in to change notification settings - Fork 204
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
plot: properly handle descent in axis labels glyph boxes #708
Conversation
Codecov Report
@@ Coverage Diff @@
## master #708 +/- ##
==========================================
+ Coverage 72.53% 73.12% +0.59%
==========================================
Files 56 58 +2
Lines 5076 5370 +294
==========================================
+ Hits 3682 3927 +245
- Misses 1207 1249 +42
- Partials 187 194 +7
Continue to review full report at Codecov.
|
I'll address your comments shortly. (Mainly because there's something weird going on with the palette, probably coming from a larger vertical source being used up for each element of the palette. It's also present for legend entries. If somebody has any clue for the palette issue, I am all ears.) |
it's somewhat better. and I've "fixed" the glyphboxes around the tick-axis labels in |
I think I've found (one of) the glyphbox bug(s) for the tick-axis labels. |
ok, it's finally looking better.
for these items, one needs the underlying |
playing a bit w/ the "extended" refactoring the handling of carving out the space for the title into before I go too deep into that alley, would you (@kortschak) agree with proceeding with this interface change? |
What does the extended interface look like? Before I read you last sentence, I was thinking that perhaps a two phase logging and then panicking transition would work, but you already got there. Yes, agree. |
going from: type GlyphBoxer interface {
GlyphBoxes(*Plot) []GlyphBox
} to the new: type GlyphBoxer interface {
GlyphBoxes(c draw.Canvas, p *Plot) []GlyphBox
} it kind of make sense to tack the additional type Plotter interface {
// Plot draws the data to a draw.Canvas.
Plot(draw.Canvas, *Plot)
} |
So the |
For the plot title and for the legend, it's also used to get the min/max of the area (to compute the headroom for the title, or to position the legend box on the correct corner) |
Sure, that SGTM then. |
… glyphboxes Fixes gonum#676. Signed-off-by: Sebastien Binet <binet@cern.ch>
I think that is the way to go. We can attempt to fix the non-working things later. |
great. |
PTAL |
PTAL |
argh... after squashing the fixes from the review into the proper commit, diff --git a/vg/vggio/vggio_test.go b/vg/vggio/vggio_test.go
index 259e53b..dfd0d67 100644
--- a/vg/vggio/vggio_test.go
+++ b/vg/vggio/vggio_test.go
@@ -13,6 +13,7 @@ import (
"os"
"runtime"
"testing"
+ "time"
"gioui.org/layout"
"gioui.org/op"
@@ -55,6 +56,7 @@ func init() {
if err == nil {
return
}
+ time.Sleep(5 * time.Second)
}
panic(fmt.Errorf("vg/vggio_test: could not setup headless display: %+v", err)) I'll merge this PR w/o that fix/hack (as this isn't what you approved), and see whether this needs further attention. |
this time it went fine... |
Fixes #676.
Fixes #680.
Please take a look.