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

Column sizing issue with pkgdown and listviewer in view mode #37

Open
kscrawfo opened this issue Aug 24, 2020 · 1 comment
Open

Column sizing issue with pkgdown and listviewer in view mode #37

kscrawfo opened this issue Aug 24, 2020 · 1 comment

Comments

@kscrawfo
Copy link

kscrawfo commented Aug 24, 2020

Hi @timelyportfolio,

I don't think this is specific to your package...but I think it might be related to htmlwidgets and you might have some ideas? I would really appreciate any thoughts - also feel free to delete this issue if its too off topic... Thanks!

I am working on an R package and using pkgdown to build the documentation. I have a multi-level list that I'd like to view and am using the listviewer package with listviewer::jsonedit to display the list. In view mode (also form mode), the list appears to have some sort of sizing issue - the width of the list dynamically resizes, but is not wide enough to display the contents of the list appropriately. This appears to only be an issue when used in view mode with pkgdown (knitr renders fine in the markdown preview, it displays fine in the RStudio viewer fine, no issue with tree or other modes besides view and form). I have not modified any of the pkgdown defaults. I tried inspecting the HTML, but couldn't figure out what was controlling the column widths...

Given the above, I think there may be something going on specifically with pkgdown or htmlwidgets?

Any ideas on why this might be happening?

reprex:

    ---
    title: "test_vignette"
    output: rmarkdown::html_vignette
    vignette: >
      %\VignetteIndexEntry{test_vignette}
      %\VignetteEngine{knitr::rmarkdown}
      %\VignetteEncoding{UTF-8}
    ---
    
    ```{r out.width = 800}
    
    test_list = list(
        a = list(
          a1 = 'a1 text',
          a2 = list(
            a2a = 'a2a text',
            a2b = 'a2b text',
            a2c = list(
              a2c1 = 'a2c1 text',
              a2c2 = 'a2c2 text'
              )
          )
        ),
        b = list(
          b1 = 'b1 text',
          b2 = list(
            b2a = 'b2a text',
            b2b = 'b2b text',
            b2c = list(
              b2c1 = 'b2c1 text',
              b2c2 = 'b2c2 text'
              )
          )
        )
    )
    
    listviewer::jsonedit(test_list,
                         mode = 'view')
    ```

Pkgdown vignette (list collapsed) - not good:
image

Pkgdown vignette (list expanded) - not good:
image

RStudio viewer (similar for knitr) - good:
image

@kscrawfo kscrawfo changed the title Column sizing issue with pkgdown and listviewer in view mode User error - please delete Aug 24, 2020
@kscrawfo kscrawfo changed the title User error - please delete Column sizing issue with pkgdown and listviewer in view mode Aug 24, 2020
@kscrawfo
Copy link
Author

kscrawfo commented Aug 24, 2020

After spending some more time on this, I've found that I can get the view mode to somewhat work...if I indent the entire block of r code 4 spaces. I say somewhat because the listviewer window now appears 'inside' a code block...but it has a scrollbar inside the listviewer window (regardless of how wide I set the output).

indented 4 spaces

    ```{r}
    listviewer::jsonedit(test_list,
                         mode = 'view')
    ``` 

image

not indented 4 spaces
    
```{r}
listviewer::jsonedit(test_list,
                     mode = 'view')

image

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

1 participant