Bokeh: Locate a widget in a picture - bokeh

In the picture, my current website is shown. At the top, there is a graph generated with bokeh. Below that is a slider. In the diagram this is the red line, which is a bokeh span. With said slider, I can move the span in the diagram. Below the slider is a picture on the left and an entry field on the right they are implemented with the following code:
#Generates a widget that holds the picture of the mill
mill_image = Div( text="""
<img src="/static/images/milling_plant.png"
alt="div_image"
width="700">""",
width=700,
height=150)
#Generates a widget that holds the entry field
text_clas_speed = TextInput(value="0",
title=_("classifier speed"),
width=100)
The input field is kind of abused, as it will not get an input, but display a value. The displayed value is the value highlighted with the red span in the diagram. It dynamically changes when the slider is moved.
All this works fine.
Now to my question: What I want to do is to place the input field somewhere in the picture. I'm thinking of setting its position with coordinates. Currently, I'm giving the position with the following code.
output = column(
p, #Graph
time_slider, #Slider
row(
mill_image, #Picture
text_clas_speed, #Input field that displays the value
widgetbox(checkbox_group), #Some checkboxes not visable in the screenshot
)
)
In the result, there is probably not the text_clas_speed in this structure and it comes with the mill_image. At the moment, I have no idea how I could get this done. Any help is much appreciated.

Bokeh's built-in layout system does not have any notion of or capability for overlapping elements, so it is not possible to overlap the control over the image with pure Bokeh. You would need to create an Jinja HTML template that somehow positions divs in an overlapping fashion, then use Bokeh's embed APIs to place individual components in your template.

Related

CSS transition animation with tiles layout is it possible to achieve?

I am trying to create a specific solution for weeks now and I have tried many things but I am just not sure if it is possible at all to achieve. I need your opinions and point me in direction o a correct approach. Following what I am trying to create:
Initially there is a tile layout in which a certain number of cards (say 12) are placed in 4x3 grid:
Now, if user clicks on a tile (Box 3), the state changes to following:
Selected tile is expanded and other tiles get aligned one below another on the right side:
Challenge is that I want to create a transition from every tile's initial state to the state where every tile is aligned one below another on the right. At the same time, when a tile is clicked it is expanded in place.
Note - there are no sudden change in positions, no reload of page and preferably no JS (I wanted to write a CSS-only solution). Everything smoothly animates to new position. From the second screen if a different tile is selected (from right), then the expanded item will shrink and go in to the right hand stack while the selected item will expand and take place of the currently expanded (B3).
If you could just point me to correct direction it would be great help.
thanks.
You should check css flexbox.
Using the "order" proprety, you could asign order of every box from 2 to 8,
and each time a box is selected, you change it's order to 1 and you also change its size and colour.
However, I don't think you can use 'click' actions with css only.
I would recommend using JS for what you are trying to achieve.
Hope it helps

Dynamic chat bubble using autolayout

I am developing an application like iMessage.I would like to UI same like iMessage chat bubble work. I developed table view cell with auto layout.I have below table cell with UIImageView and UILabel.
UIImageView contain bubble image with resizableImageWithCapInsets. Right now everything is working fine except if text is small string then chat bubble is showing throughout the screen. so I would like to set constraints in such a way that my image view width will be according to label text. So if Label text is small then it will be small width image So it will be resizable according to width of label text. Any idea?
Current output:
.
I was thinking about my problem and researching on it and found below solutions. Posting it if it helps other.
So make it dynamic width based on text I put another blank label on right hand side and add constraints with it relative to left hand side controls(image view and label). Below is my final layout of constraints. Then it's working as expected.
Output Screen shot :

r googleVis: How to control html tooltips (positioning, border and background)

I have figured out how to create custom html tooltips by using roles via googleVis. I can easily modify the content using html but I cannot understand how I can control the tooltip box itself.
My problem was generated because some of the custom tooltips I created are falling outside my chart area and I tried (unsuccessfully) to find a way to control the tooltip position. Idealy I would like to make them behave in the exact same way default tooltips behave in googleVis (always stay withinin the chart area).
When I later implemented the same concept into a line chart I found that I have another problem as well. The tooltip is falling on the line so I cannot see what is the exact point that refers to the tooltip.
Would it be possible for example to keep the callout style of default googleVis tooltip and change the content with HTML?
Additionally, do you know if there is any way to control more tooltip properties like border and background color?
i was also looking for the same
1) when laying out your data, make sure it has columns alternating between, say, data and tooltips, data and tooltips,... that way it is possible to customize tooltips for multiple columns (it does not work if you just append - à la cbind - a set of tooltips columns to your data frame).
Additionally try this http://rcharts.io/viewer/?6644957#.VHcpEkvrdbg

Unable to style a cell tooltip of ngGrid

I am trying to add a tooltip to my cells. Using the title attribute works, but the style is different from the rest of the page (bootstrap styling) http://i.stack.imgur.com/PQMmj.png
Changing the title attribute to tooltip doesn't work - it looks like it hides the tooltip under the next cell (changing the coordination of the tooltip to something within the range of the cell, made it partially visible).
(I am new so I cant post images, https://github.com/angular-ui/ng-grid/issues/800 )
Any idea whats wrong?
Thank you.

How to overlapping report items in BIRT?

For some reason I need to overlap 2 report elements in BIRT. For example I need to put 2 labels one on top of another. Is this possible in BIRT? I am using BIRT 4.3. Normally when we place elements in report designer each item is occupying one full row. Some times i need to overlap elements and sometimes i need to place elements side by side. side by side can be achieved with Grid but I am not sure how to overlap report items? Please help and thanks in advance.
You can put two labels in the same cell of a graph or table, then define when to "hide element" with the "Visibility" property.
OR
In order to have both display at the same time, you can use a grid to define where the top label will go, then add the back label as an image using the background (advanced property)

Resources