Implementation of facet_wrap(..., dir="v")
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 2.7k
- Forks
- 641
- PR merge metrics
- No merged PRs in 30d
Description
ggplot2 has the dir option that allows facets to be filled by columns, rather than rows. However, it does not display properly in plotly.
library(ggplot2)
library(plotly)
data <- data.frame(
x = seq(1:100),
y = sample(1:1000, 100),
z = factor(sample(1:4, 100, replace = T))
)
plot <- ggplot(data, aes(x, y)) +
facet_wrap(~ z, dir = "v") +
geom_point()
plot
ggplotly(plot)
ggplot works properly and fills the facets from top to bottom, left to right.

Using the current dev version of plotly, ggplotly doesn't display all the facets, and still orders them from left to right, top to bottom.

Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the issue's R example with facet_wrap(~ z, dir = "v") and ggplotly(plot), then trace how ggplotly converts the facet layout and ordering. Compare the result with ggplot's top-to-bottom, left-to-right layout; done means all facets display in the requested vertical order.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100