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

Problem with slickR + shiny, when the xmlSVG-file becomes to large. #67

Open
RobertOpitz opened this issue Aug 31, 2022 · 2 comments
Open

Comments

@RobertOpitz
Copy link

RobertOpitz commented Aug 31, 2022

Hi there!

I'm using slickR with shiny, and I'm happy that this package exists. Unfortunatly, I encountered a strange error, when the necessary xml-Files become large. I traced the error down to the function slick_div_chr. There, it is tested if the input x is a regular file using utils::file_test('-f', x) . Here, x is the (by slickR processed) xml-Input, which is in this case a long string. If that string is to long (>= 1e5 characters) the underlying function file.info throws an error: Error in file.info(x, extra_cols = FALSE) : file name conversion problem -- name too long?.

As I can see, if the xml-Input is short enough, and processed by functions as_svg_character and hash_encode_url, then utils::file_test('-f', x) will always return FALSE, indicating the function file_test is only necessary with certain inputs.

As the function file_test is for a if-statement, maybe this can be solved by adding and extra argument, checking if file_test is actually necessary?

Best regards!

@yonicd
Copy link
Owner

yonicd commented Aug 31, 2022

thanks for pointing this out. you are welcome to submit a PR and I'll merge it into the main branch

@RobertOpitz
Copy link
Author

I think, i solved the problem. I changed the function slick_div_chr in file dom_utils.R by adding and using an extra flag, wether the input x is a file. I also changed the function slick_div.xml_document and slick_div.character in file slick_div.R accordingly. I installed the changed package at my computer, and it worked there. You might find the files here: slickR_repair

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