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

Big variable names overlapping in output #7

Closed
sillasgonzaga opened this issue Feb 5, 2016 · 6 comments
Closed

Big variable names overlapping in output #7

sillasgonzaga opened this issue Feb 5, 2016 · 6 comments

Comments

@sillasgonzaga
Copy link

This is how big are the variable names I'm talking about:

> head(df2)
                                       sequencia volume
1 Critica Pedido-Alçada: CAF-Cód.Crítica: 000001     15
2 Critica Pedido-Alçada: CAF-Cód.Crítica: 000002     10
3 Critica Pedido-Alçada: CAF-Cód.Crítica: 000013      4
4 Critica Pedido-Alçada: CAF-Cód.Crítica: 000051      1
5 Critica Pedido-Alçada: CAF-Cód.Crítica: 000154     10
6 Critica Pedido-Alçada: ETP-Cód.Crítica: 000152     34
> tail(df2)
                                                                 sequencia volume
39 Devolução-Resp: 000008 - TRANSPORTADORA -Motivo: 000083 - PROPRIETARIO       7
40 Devolução-Resp: 000008 - TRANSPORTADORA -Motivo: 000087 - TEMPO INSUFIC     24
41 Devolução-Resp: 000008 - TRANSPORTADORA -Motivo: 000089 - PDV FECHADO A      4
42                                                            Falta Real--    120
43                                         Pedido Orfão-Orfão Faturamento-      4
44                                         Pedido Orfão-Orfão Roterização-      6

What happens is when I output this data.frame in sunburstR, the variable names overlap in the output and I can't see the percent result of that piece of the sequence, as I try to show in the image below:

http://imgur.com/LEeFZU8

Is there a workaround for this or should I use shorter strings for the variables?

@timelyportfolio
Copy link
Owner

I had not previously exposed the breadcrumb trail to customization. I'll look into it to see how easy it might be. I seem to remember this being a variable.

@timelyportfolio
Copy link
Owner

Thanks @sillasgonzaga, in 778cded I added an argument breadcrumb to customize the size of the breadcrumb. The issue though is the breadcrumb is set up as SVG and text-wrapping is difficult, so the trail will easily exceed the size of the page.

sunburst(sequences, breadcrumb = list(w = 200))

I will try to think of other strategies.

@timelyportfolio
Copy link
Owner

@sillasgonzaga I just added tasks functionality, which would allow styling with a smaller font-size.

sb <- sunburst(sequences,breadcrumb = list(w = 50))
sb$x$tasks <- htmlwidgets::JS(
  'function(){d3.select(this.el).select("#" + this.el.id + "-trail").style("font-size","60%")}'
)
sb

Again, not optimal but potentially helpful.

If you were ok with dumping the text and just using color in the breadcrumb, you could do something like this.

sb <- sunburst(sequences,breadcrumb = list(w = 10))
sb$x$tasks <- list(htmlwidgets::JS(
  'function(){d3.select(this.el).select("#" + this.el.id + "-trail").style("font-size","0")}'
))
sb

image

@sillasgonzaga
Copy link
Author

Both the breadcrumb argument and the tasks functionality are wonderful additions to sunburstR. By using them and changing the parameters of sb$sizingPolicy$padding and sb$sizingPolicy$knitr$figure = FALSE I managed to arrange my messed dataset into an outstanding visualization in a knitr document.

Many thanks for the quick fix.

If you allow me to make you a suggestion, I would include the default values of the breadcrumb argument in the ?sunburst output

@timelyportfolio
Copy link
Owner

Will close for now? Feel free to reopen.

@timelyportfolio
Copy link
Owner

@sillasgonzaga pulls #13 and #14 should help with this if you want to give it a whirl. Would love testing.

@voxnonecho voxnonecho mentioned this issue Aug 17, 2016
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