circlepackeR icon indicating copy to clipboard operation
circlepackeR copied to clipboard

line breaks with /n

Open bookerbn opened this issue 6 years ago • 3 comments
trafficstars

Hello, I am developing a shiny app and am using circlepackeR for a visualization. I have multiple levels and everything is working fine but it does not appear that circlepackeR supports line breaks within a circle using "/n". I am trying to input two lines of text within a single circle using the following code:

data_nested$pathString <- paste(data_nested$level1, data_nested$circle1.OI.Primary, data_nested$circle1.OI.Secondary, data_nested$circle1.FEMA, paste0(data_nested$circle1.MG.Name," ", "\nFEMA", data_nested$circle1.FEMA), sep = "/") data_nested$value=7 data_Node <- as.Node(data_nested) circle <- circlepackeR(data_Node, size = "value") circle

But it still outputs the text in a single line instead of two lines. Is there anyway to create a single circle with two lines of text?

bookerbn avatar May 07 '19 15:05 bookerbn

Hey! My guess is that the newline isn't being handled when it's being converted to JSON via the jsonlite package. It seems the jsonlite package supports unicode characters though, what happens if you replace \n with its unicode equivalent \u000d?

jeromefroe avatar May 08 '19 12:05 jeromefroe

Hi Jerome,

Thanks for you the response. Unfortunately using the Unicode text does not work either. It gives me the same output as /n

bookerbn avatar May 09 '19 14:05 bookerbn

That's a bummer. Unfortunately, I'm out of ideas then. I don't have the cycles to actively maintain this package anymore (I don't really have the opportunity to use R in my current position) but if you find the time to look into the root cause, I'd be more than happy to review and merge a PR.

jeromefroe avatar May 09 '19 18:05 jeromefroe