-
Notifications
You must be signed in to change notification settings - Fork 250
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
Alpha in SVGJS #1353
Comments
The |
Note that this happens when But the better way to do this now should be: pa = plot(D, x=:x, y=:y, Geom.rectbin, Theme(alphas=[0.5])) # and/or
pa = plot(D, x=:x, y=:y, alpha=[0.5], Geom.rectbin) so the |
I've since tried a MWE. Unfortunately, it has worked... using Colors, Gadfly
set_default_plot_size(21cm, 8cm)
p1 = plot(x=1:9, y=1:9, Geom.blank, layer(xmin=[2], ymin=[2], xmax=[8], ymax=[8], Geom.rect, Theme(default_color=RGBA(0.5,0.5,0.5,0.5))));
p2 = plot(x=1:9, y=1:9, Geom.blank, layer(xmin=[2], ymin=[2], xmax=[8], ymax=[8], Geom.rect, Theme(default_color=RGBA(0.5,0.5,0.5,0.5))));
p = hstack(p1,p2)
p |> SVG("foo.svg")
p |> SVGJS("foo.html")
import Cairo
import Fontconfig
p |> PNG("foo.png") |
But now p1 and p2 each have 2 layers , so you've changed the Compose tree and the inheritance. |
Some more information to determine where in the tree that there is an issue. Also, it seems that only SVGJS is affected. p1 = plot(layer(xmin=[2], ymin=[2], xmax=[3], ymax=[3], Geom.rect, Theme(default_color=RGBA(0.5,0.5,0.5,0.5))));
p2 = plot(layer(xmin=[2], ymin=[2], xmax=[3], ymax=[3], Geom.rect, Theme(default_color=RGBA(0.5,0.5,0.5,0.5)))); p1 = plot(layer(xmin=[2,4], ymin=[2,4], xmax=[3,8], ymax=[3,8], Geom.rect, Theme(default_color=RGBA(0.5,0.5,0.5,0.5))));
p2 = plot(layer(xmin=[2,4], ymin=[2,4], xmax=[3,8], ymax=[3,8], Geom.rect, Theme(default_color=RGBA(0.5,0.5,0.5,0.5)))); p1 = plot(layer(xmin=[2], ymin=[2], xmax=[3], ymax=[3], Geom.rect, Theme(default_color=RGBA(0.5,0.5,0.5,0.5))));
p2 = plot(layer(xmin=[2,4], ymin=[2,4], xmax=[3,8], ymax=[3,8], Geom.rect, Theme(default_color=RGBA(0.5,0.5,0.5,0.5)))); |
@Mattriks, can one reasonably use Compose's introspect function on these plots? If so, all MWE plots in this thread have the same tree. |
Maybe the introspect plot is clipped or has overlapping elements. |
Actually this issue is the same problem as in #1242. It was "fixed" for i) "fixed" in Gadfly, e.g. enable I'm guessing there's an unidentified inheritance issue in the SVG backend, which is appearing in SVGJS for unknown reasons. |
It'd be nice to track this down and fix it in Compose so that |
On the introspect function, Gadfly's plot tree has a set_default_graphic_size(8inch, 4inch)
p = plot(x=[0,10], y=[0,1], Geom.blank)
tbl = render(p).container_children.head.container_children.head
# compose(context(), tbl[1,3]) # see what renders
introspect(tbl[1,3][1]) Note the plot tree includes 3 guides for SVGJS, which are easy to pick out because they contain text. |
When checking out the |
PR #1439 will close this issue in Gadfly. If there is a related problem in Compose, than an example should be illustrated using Compose only (and an issue opened there). |
The theme is not displayed correctly in the left-hand plot. There should be some transparency.
http://gadflyjl.org/stable/gallery/geometries/#[Geom.rect](@ref),-[Geom.rectbin](@ref)-1
The text was updated successfully, but these errors were encountered: