bokeh taptool selection colours - bokeh

I am using the TapTool in bokeh to select some circles which I have drawn on top of a gmap. Currently, the selected circle is in the foreground and the rest fade into the map background.
Is there a way to change this default behaviour? I would like, for example, to give a different colour boundary to the selected circle and keep the rest the same. Is there a way to change the rendering of the selected and unselected objects?

The Styling Visual Attributes chapter of the User's Guide has a section specifically for Selected and Unselected Glyphs. The easiest way is to use the convenience paramters that can be passed to the glyph methods:
plot.circle([1, 2, 3, 4, 5], [2, 5, 8, 2, 7], size=50,
# set visual properties for selected glyphs
selection_color="firebrick",
# set visual properties for non-selected glyphs
nonselection_fill_alpha=0.2,
nonselection_fill_color="blue",
nonselection_line_color="firebrick",
nonselection_line_alpha=1.0)

Related

D3, Change the style of collapsible tree attribute

Im trying to do an OrgChart using d3 , i decided to use this tree Collapsible tree, so i want to remove the circles and apply my own style on the tree like adding borders to each title, change background color and so on...
Is there is any way i can do it ? if not do you suggest any other approach to create interactive organizational chart?
You cannot add borders and backgrounds to text, at least directly.
You can add some rectangles behind the text elements and style them as you want.
The issue with this approach is that you need to compute the text size for each element, so you size the rectangles properly.
You can make it a try and post your specific questions here.

JavaFX TreeTableView dynamic styling without css

I am new to JavaFX and I don't know how to set cell styles dynamically in a TreeTableView.
For example, I wish to set a cell's background color on the fly based on user input. The user may specify a range (e.g. dark red to light red). I would calculate the appropriate value for a specific cell and then set the background color based on the calculation result.
I am familiar with JTable's approach of writing a cell renderer but JavaFX appears to handle things quite differently.

Is it possible to overflow column labels in wxpython grid?

I'd like to know if it is possible to overflow column labels in wxpython grid. I can overflow cells over multiple columns following way:
self.SetCellSize(0, 0, 3, 1)
But how to overflow column labels?
I don't believe that this is currently supported. There was a "sort of" recent addition called the gridlabelrenderer that allows the developer to add colors and font styles to the columns and rows. See the wxPython demo for an example. It uses a wx.DC to do the custom drawing. To me, I would think you could take that code an extend it (i.e. subclass) to make it draw where you wanted...although I don't know how that would affect column size changes.

mschart: Different background colors for different y-value ranges?

Is there any way I can create a line chart using mschart where the chart area's background color changes for different ranges of y values?
For instance, a line chart would have a green background for y values 0 - 10, a yellow background for y values 10 - 20 and a red background for y values 20 - 30.
A gradient will not work, the colors must be solid.
I might have to use a background image, but I think there might be a better way. Unfortunately, web searches haven't turned anything up.
I've decided the only way to do this is to use a background image. Where needed I can use GDI+ to create the image at runtime with the proper height and width.
you can also use custom labels feature of MSchart.
int element = Chart1.ChartAreas["Default"].AxisY.CustomLabels.Add(0, 10,"Low");
element = Chart1.ChartAreas["Default"].AxisY.CustomLabels.Add(10, 20, "Medium");
element = Chart1.ChartAreas["Default"].AxisY.CustomLabels.Add(20,30,"High");

Why does the FLEX 4 LineChart Legend stop displaying colors when LineSeries's lineStroke attribute changes?

I am implementing a LineChart in FLEX 4. I have the chart working well except I do not like the default colors and cannot use them, as they do not relate to my data very well. For instance, Orange is not a great default color for my data column "Outdoor temperature". I would rather override it and use a green color if possible.
When I explicitly specify the SolidColorStroke, like so, this breaks the LineChart Legend:
<mx:SolidColorStroke id = "s1" color="haloGreen" weight="2"/>
<mx:LineSeries yField="v1" form="curve" displayName="Indoor Temp" lineStroke="{s1}"/>
^ With this code, The LineChart Legend stops displaying the color for that specific LineSeries, and only displays in black.
How can I override the LineSeries stroke color and persist those colors to the Legend's display?
Is this a FLEX 4 bug? I noticed in FLEX 3 examples (even on Adobe's FLEX 3 Help website) you can override the stroke colors and it persists to the Chart Legend.
Any help is appreciated!
Apparently (from what I can gather), this is a known bug in FLEX 4, and apparently Adobe is working on fixing this in their next release. Lame, I know.
To fix this, you must use the deprecated "Stroke" object, which produces compiler warnings in FLEX 4.

Resources