daattali / timevis

📅 Create interactive timeline visualizations in R
http://daattali.com/shiny/timevis-demo/
Other
650 stars 157 forks source link

Local images in content of timevis item no longer works #118

Closed ecodiv closed 1 year ago

ecodiv commented 2 years ago

In timevis it used to be possible to include html in the content of an item, as shown in the "matches of the 2014 World Cup" timeline demo. This, however, does not work anymore. This seems to be a change in the vis.js, because when replacing visjs-7.4.9/vis-timeline-graph2d.min.js with a library from an earlier version, like vis-4.16.1/vis.min.js, the html inside the item content is picked up.

daattali commented 2 years ago

I just tried html content in timevis and it seems to work.

Example:

timevis(
  data.frame(id = 1:2,
             content = c("one", "two<br><h3>HTML is supported</h3>"),
             start = c("2016-01-10", "2016-01-18"),
             end = c("2016-01-14", NA),
             style = c(NA, "color: red;")
  )
)

If you believe there's a bug with html content please provide a minimal reproducible example

daattali commented 2 years ago

I think I found the issue you meant. It looks like local images don't work inside timevis anymore. I'm not sure when that happened and what's the root cause of this

MacBurt commented 1 year ago

In timevis it used to be possible to include html in the content of an item, as shown in the "matches of the 2014 World Cup" timeline demo. This, however, does not work anymore. This seems to be a change in the vis.js, because when replacing visjs-7.4.9/vis-timeline-graph2d.min.js with a library from an earlier version, like vis-4.16.1/vis.min.js, the html inside the item content is picked up.

I tried this for my html bugs.....and it did not work for me. I posted another example. Timevis developers, I hope you can take a look.

daattali commented 1 year ago

This seems to be caused by https://github.com/visjs/vis-timeline/issues/1515 - it worked until timelins version 7.4.3 but in 7.4.4 they added some XSS security features which caused local images to stop working. I'm closing this issue as there isn't anything to do from the timevis side.

dprizznick commented 1 year ago

Hi Dean, thanks for your work on this package. It's wonderful! I am currently using it in an enterprise R shiny project. Is there a work-around to the local image issue? I have images on my server that I would like to use but I ran into this issue.

daattali commented 1 year ago

As far as I know, they deliberately disallowed local images for security vulnerabilities. You'll have to put those images in a place that's publicly available.