How to change fa-icon size in flexdashboard value box? - r

Is it possible to change the size of the fa-icons in a a flexdashboard? The caption text overlaps with the icon and is even more of an issue when a numeric value is of the order 10^4 or greater.
It's not a huge issue but I think it will be more aesthetically pleasing if I can reduce the icon size somehow? I have tried to introduce a line break to the caption using \n but this does not work. I would rather reduce icon size than value size.
Screenshot attached. Thanks.

I have just used different icons instead. I have gone with narrower icons that do not overlap with any caption or value characters. Seems like the easiest solution for now.

Related

Autosizing Text Marks in Vega

I'm currently developing my own Metrics in Vega. Here is an example...
I am just using text marks, here is the source code for a very similar example to mine. In the example height and width are specified. However, I'm looking for the text to be autosized - that is, height and width are determined from the space the marks take up. The usual global setting to do this would be, autosize: pad or autosize: fit but these don't seem to correctly fit text marks on their own.
I'm reaching out to anyone who knows how to do this. Since I am using these in a Kibana dashboard, the autofitting would allow us to scale these metrics to any size we'd like, independent of any amount of text.
Many thanks.
To answer my own question,
I defined a 100x100 grid using scales and axes in Vega. And then plotted my words to fit inside this grid - since you can specify the x,y positions of the words.
After this the autofit applied correctly. I made sure to scale the fontsize (which is height of text in pixels) to the height of the panel (external signal).
Finally I had to hide the axes. So inside the axes I added this labels: false, domain: false. With a few extra additions this was my result. This is totally resizable within Kibana.

Codenameone : How to set MaxLines and MinLines in SpanLabel?

Label in CN1 is limited to being a Single line.
Now that we have to use SpanLabel for anything that can take more than 1 line,
we face one issue.
When we have a strict design that uses consistent height for a list item, we have to give max/min lines allowed for the SpanLabel (At least that's how it works in Android And Flutter).
When I searched for anything that says line in SpanLabel file, I only found that word in one place, that too in a comment.
It did not feel right using fixed height/width property to a SpanLabel as they will vary with fonts and font sizes. The hight should be calculated with respect to the number of lines of the text & font config like font size, line spacing, padding, etc.
What is the right way to achieve consistent height across various SpanLabel despite the varied length of the text they display?
The "right way" would be the layout manager as it would allocate the right amount of space to the span label and everything else. E.g. if you use TableLayout you can allocate the height as percentage.
SpanLabel is technically a TextArea that's encapsulated. It has that distinction between rows/lines which isn't exposed within SpanLabel. But you can manipulate the underlying text area by using getTextComponent().

Using data line widths in bokeh

Is there a way to provide line width in bokeh in data space, or alternatively can the line width be fixed in a way that zooming does not alter it?
I am trying to draw lines right next to one another without clashes or gaps between them.
Currently, I am using a mapping from line width to coordinate width and change the line widths and line coords in sync to achieve this, but as soon as I zoom the line width is adapted.
Is there a way to provide line width in bokeh in data space
No, but feature requests are welcome!
can the line width be fixed in a way that zooming does not alter it?
Line width is set in screen units - zooming does not alter it by default.
It seems like the problem is that you change your line width in response to the range changes, and zooming does change ranges.

dc.bar-chart margin and axis label size adjustment

I found my yAxis label too big to be shown--it was truncated by the left border.
I tried increasing the left margin, with no success. It seems that the label text is left-aligned. So increasing the margin only gets the label further away from the ticks text.
Please see the attached screenshots. The one with wider gap is margin.left=70. The other one is with margin.left=40. No matter which case, the 'Expenditures' seems to be truncated on the left side.
Is there anywhere in the dc.css that I can change this configuration?
Thank you!!
You can adjust where the axis labels are placed relative to the edge by using the second parameter when you call the .xAxisLabel() and .yAxisLabel() methods. This sets the "padding" (actually the offset from the left/bottom).
coordinateGridMixin.xAxisLabel docs
coordinateGridMixin.yAxisLabel docs
It's confusing that the text size gets set through the stylesheet but the positioning can't be. I'm not sure if there's any way around this, though

Keeping same distance between Text and Icon fonts

I have a collapsing tab with Css Icon fonts, i want to keep the same distance between the Title and the Icon font arrow.
Here the example
http://jsfiddle.net/2D3V5/2/
If the Text on the left has the same length, the Icon font arrow keep the same distance and it's ok, but this is not going to happen in my tabs because obviously the texts are gonna be different, so i need to find out how to keep the Arrow Icon at the same distance from the text independently from the length of the text.
Hope the explanation is clear.
Thanks
You can float the images to right. That's a simple way to manage the equal distance.
Plus, the images of the rest of division are inverted. Do change their classes.
Here is the edited fiddle : Fiddle
See http://jsfiddle.net/2D3V5/3/
If you want to keep the Arrow Icon at the same distance from the text, but you want the arrows aligned too, you have to place the arrows at the left of your titles.

Resources