4

I'm looking for the ggvis equivalent of this ggplot2 function call: theme(text=element_text(size=20))

Let's take a simple graph made with ggvis:

mtcars %>% 
  add_rownames() %>% 
  ggvis(~mpg, ~disp, fill = ~vs) %>% 
  layer_text(text := ~rowname)

enter image description here

There are font sizes for axis titles, tick labels, the text layer, the legend title, and the legend tick labels. In the SVG, all of these font sizes are set in the element:

Here, for example, is one of the labels in the legend:

<text x="3" y="36" text-anchor="start" dy=".9em" style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-family: sans-serif; fill: #000000; opacity: 1;">0.0</text>

Notice font-size: 10px;. This prevents me from modifying the font size via CSS in the page where the svg will be embedded.

Is there any global way of stripping ALL fontSizes from the elements, so I can use CSS? Or is there a way to increase all fontSizes via ggvis?

1

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.