How to bind a tooltip effect on a Control instance like Zoom? - tooltip

How can I bind a tooltip effect on a Control instance like Zoom?
Leaflet supports Layers to bind L.Tooltip effect, but want bind a L.Tooltip to my custom L.Control element.

Related

Is there a way to change position of transformer anchors so that I can interact with transformer using mousemove but from outside of transformer box?

For example need to use rotate anchor from another position then default top center of transformer
I have tried to create new Konva.Rect and pass its 'mousedown' and 'mousemove' events to transformer _handleMouseMove but didn't find appropriate way for it to work correctly.

Change bokeh python hovertool tooltip layout

Is there a way to change the layout of the hovertool's tooltips? I mean, bokeh shows the standard square with some information, close to the point and linked by a small triangle.. Is there a way to change this triangle and put a line that connects the tooltip to the point but at some distance (like an annotation), but dynamic as a hovertool tooltip?
Thanks for all!!
standard tooltip
New tooltip type
It is possible but it requires quite some work. You have to create a custom subclass of Tooltip that renders the tooltip the way you want and a custom subclass of HoverTool that uses that tooltip class.

Custom SVG marker, dependent on data

I can add a custom SVG element to a chart like the wind arrows in the meteogram example. Note how the look of each individual wind arrow is customized with the parameters (a) wind speed and (b) direction.
I can also place custom SVG markers on to a series like the cross in the custom markers demo.
The latter approach has the advantage that if I have a zoom-able chart (Highstock) the markers will stay where they are supposed to be when zooming/panning. However, the latter example does not allow parameter dependent customization of the SVG marker!
Is there a way to combine these two? As in, I want custom SVG markers, that are bound to the series but whose shape is determined by other external parameters.

Mapbox.js tooltips - position over marker, but don't follow mouse

Is there a way to get Mapbox.js tooltips to show when you're hovering over a marker without following the mouse around? I just want it to stay put when I hover.
I am using the following code on my map:
var map = L.map("impact-map")
.setView([20, 80], 3)
.addLayer(L.mapbox.tileLayer("hotchkissmade.in_impact", {
detectRetina: true
}));
var myGridLayer = L.mapbox.gridLayer('hotchkissmade.in_impact').addTo( map );
var myGridControl = L.mapbox.gridControl(myGridLayer, {
follow: true
}).addTo( map );
I am using the follow:true from the example here.
Disclaimer: I know there may be more flexibility outside of gridControl but I like having my tooltips from Tilemill as I don't want to load the data in the browser twice, since I'm basing the tooltip data off the layer making the markers on my map in Tilemill
This isn't possible with a gridControl - you can have tooltips either follow the mouse or stay in a specific location, but unlike L.mapbox.featureLayer, there is no actual marker, polygon, or feature you're hovering over - the geometry is not pushed to the client - so, there would be no 'anchor' for the tooltip to stay on.

Google charts: is it possible to display tooltips when hovering areas in stacked area chart?

I have a stacked area chart using google charts. An example is here: https://code.google.com/apis/ajax/playground/?type=visualization#area_chart
The problem is, when I hover the cursor over an area, no tooltip is displayed. I need to hover the boundary of two neighboring areas to display the tooltip.
Is it possible to display tooltips when hovering areas? If not, do you know of some workaround?
You can use a SteppedAreaChart for this. Set isStacked to true, and by default the tooltips will be shown on hovering over an area.
No, you can't spawn the tooltips by hovering over the area. There is no way easy way to work around this, as the Visualization API does not trigger mouse events on the areas.
If you want to put the effort into this, you can create custom mouse event handlers on the chart's SVG/VML code. It might be possible to extrapolate which area the mouse is in, and given that, you can extrapolate the x-axis position from the mouse coordinates using the ChartLayoutInterface, and spawn a custom tooltip based on that information. Be aware that any solution involving the chart's SVG/VML code could break at any time, as the internal structure of the charts is not guaranteed to be stable from version to version.

Resources