Giter Site home page Giter Site logo

Comments (16)

bhaskarvk avatar bhaskarvk commented on May 29, 2024 1

OK I just confirmed that this is indeed a bug caused by the recent fix for blogdown.
It works correctly if you're storing the dependencies externally like in this example https://raw.githubusercontent.com/bhaskarvk/widgetframe/master/inst/examples/rmarkdown/knitr_example.Rmd

but I'll fix it to make sure that it works even with inlined dependencies it works. In the mean time please use self_contained:FALSE like in my example.

Thanks for reporting!

from widgetframe.

bhaskarvk avatar bhaskarvk commented on May 29, 2024 1

Another option is to explicitly set

knitr::opts_chunk$set(widgetframe_widgetsdir = 'widgets')

In the chunk options, with that your wigdets will be stored in a widgets directory, and you don't really need to specify self_contained:FALSE.

from widgetframe.

bhaskarvk avatar bhaskarvk commented on May 29, 2024

I'll investigate, did it break after upgrading from 0.2 ?

from widgetframe.

charliejhadley avatar charliejhadley commented on May 29, 2024

Sorry for slow reply, I've been in lovely mountainous(ish) Wales.

Downgraded to 0.2.0 using devtools and have the same issue. widgetframe was previously working for me on this machine, I can try downgrading my entire R installation later this week to help diagnose if needed.

from widgetframe.

bhaskarvk avatar bhaskarvk commented on May 29, 2024

I think this is something defi. messed up in your R install. I am not able to replicate this at my end.

from widgetframe.

charliejhadley avatar charliejhadley commented on May 29, 2024

Okay, I've completely removed and reinstalled R and RStudio from my machine and still have the same issue.

I vote for closing this issue (so I have) and if I ever figure out what went wrong I'll post an update here in case it helps others.

from widgetframe.

bhaskarvk avatar bhaskarvk commented on May 29, 2024

Do you have any other m/c you can try this on ?
Also in an R session, what happens when you do widgetframe::frameWidget(leaflet::leaflet()) ?

Let's keep this open till we figure out what exactly broke.

from widgetframe.

charliejhadley avatar charliejhadley commented on May 29, 2024

I'll check on my partner's machine when they're next about.

On my machine your example code successfully displays a leaflet object in the Viewer: r widgetframe::frameWidget(leaflet::leaflet())

It's only in knitted output that I get errors like this: /rmd_output/0/widgetframe_files/figure-html//widgets/widget_01.html?initialWidth=910&childId=htmlwidget-8727e046b480be0bf5d4&parentTitle=html-document&parentUrl=http%3A%2F%2F127.0.0.1%3A21438%2Frmd_output%2F0%2F not found

from widgetframe.

bhaskarvk avatar bhaskarvk commented on May 29, 2024

Could you upload a minimal reproducible Rmd on gist and link here?
Also is the error displayed while the document is knitted or when you try to display the knitted HTML ?

from widgetframe.

charliejhadley avatar charliejhadley commented on May 29, 2024

Here's a gist with the .Rmd and .html as my machine generates it https://gist.github.com/martinjhnhadley/20cf9a102fcf870a558f64c05a02505d

RStudio's RMarkdown pane doesn't report any errors, but the " not found" error shows in the resultant html file.

from widgetframe.

bhaskarvk avatar bhaskarvk commented on May 29, 2024

Looking at your Rmd file
https://gist.githubusercontent.com/martinjhnhadley/20cf9a102fcf870a558f64c05a02505d/raw/df824cad077f1cad3d742e894361c166a7fe9429/widgetframe-not-found.Rmd

Why does it have this in the Rmd ?

### failure: /rmd_output/1/html-document_files/figure-html//widgets/widget_01.html?initialWidth=910&childId=htmlwidget-56f76eccd2ad2dfccf35&parentTitle=html-document&parentUrl=http%3A%2F%2F127.0.0.1%3A37852%2Frmd_output%2F1%2F not found

from widgetframe.

charliejhadley avatar charliejhadley commented on May 29, 2024

Oversight on my part, removed now.

from widgetframe.

bhaskarvk avatar bhaskarvk commented on May 29, 2024

I am not able to reproduce this. Could you render it and zip up the whole thing and upload it on box/dropbox? I need to look at the generated files.

from widgetframe.

charliejhadley avatar charliejhadley commented on May 29, 2024

Ohh, github supports dragging files into comments - here you go:
widgetframe-bug.zip

from widgetframe.

jl5000 avatar jl5000 commented on May 29, 2024

I think I'm having this same problem...do you know if a fix is likely to be made for being self-contained? I'm making a training document and it would be nice to show off some htmlwidgets.

from widgetframe.

zlkrvsm avatar zlkrvsm commented on May 29, 2024

Yup, can confirm I have a similar problem to @jl5000.

Although in my case I was fiddling with directories, which is probably a mistake on my part. It's better to keep everything in the same directory.

It's interesting to note something broken in this example, although I can't be sure it's the same issue.

I've managed to workaround the issue with the information present here. Maybe something to include in the vignette?

from widgetframe.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.