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

Document type hierarchy? #421

Open
tbenst opened this issue May 13, 2021 · 1 comment
Open

Document type hierarchy? #421

tbenst opened this issue May 13, 2021 · 1 comment

Comments

@tbenst
Copy link
Contributor

tbenst commented May 13, 2021

As part of trying to understand #420, I went to console:

Click for full output
help?> table
search: table mutable struct ismutable coeftable CoefTable iswritable isimmutable Patchable bytesavailable

  No documentation found.

  Summary
  ≡≡≡≡≡≡≡≡≡

  mutable struct Compose.Table <: Compose.ContainerPromise

  Fields
  ≡≡≡≡≡≡≡≡

  children      :: Matrix{Vector{Context}}
  x_focus       :: UnitRange{Int64}
  y_focus       :: UnitRange{Int64}
  x_prop        :: Union{Nothing, Vector{Float64}}
  y_prop        :: Union{Nothing, Vector{Float64}}
  aspect_ratio  :: Union{Nothing, Float64}
  fixed_configs :: Vector{T} where T
  units         :: Union{Nothing, UnitBox}
  order         :: Int64
  withjs        :: Bool
  withoutjs     :: Bool

  Supertype Hierarchy
  ≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡

  Compose.Table <: Compose.ContainerPromise <: Compose.Container <: Compose.ComposeNode <: Any

I'm not sure how to learn more about Table, ContainerPromise, Container, and ComposeNode.

Something like the diagrams type reference documentation that explains how the pieces fit together would be phenomenal! Right now it's a bit hard to figure how things fit together, even though I can appreciate that the overall architecture looks really tidy :)

@Mattriks
Copy link
Member

Mattriks commented May 14, 2021

I started expanding the Compose docs in #303, and it's an ongoing process 😀.
To learn more, you can find examples of the outer constructors of those types in Gadfly.jl e.g. in Gadfly

  • table is used by Geom.subplot_grid
  • ctxpromise() is widely used in the text-related Guides to setup the possibility of horizontal or vertical text (if orientation=:auto), and in render_discrete_key() to setup a discrete key with an unknown number of columns.
  • Later, Guide.layout_guides also uses table, which uses an optimization algorithm to decide among all the possibilities which one maximizes the plot space, under the constraint that the text (or key) needs to fit into the absolute plot area.

Point 3 is known as the "table layout problem".

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