Hi,
Quick summary of what I want the visualization to be like ...
I have multiple IHS proxys which route requests to a bunch of servers. I want to draw a parallel coordinates graph that would show the number of requests getting routed from each IHS proxy to each server. That way, if there is an imbalance in the routing logic, we would come to know. The thickness as well as opacity of the lines indicate the number of requests. This is all working fine. What is not working fine is: when I hover over a line, I want to show the number of requests represented by the line. I don't know how to achieve this.
My data:
All the IHS logs are sent to elastic. For easy sharing and simulation, I have uploaded the output of the elastic query to gist.github.com and running the visualization on that.
High Level Logic:
-
dataset
ihsdata
- Extract IHS and AppServer fields from elastic index (now gist.github json) and form a dataset. -
dataset
ihssummary
- On ihsdata, apply group by on IHS and AppServer fields -
Now
ihssummary
has dataIHS-AppServer-count
. -
dataset
distinct-ihs
- On ihssummary, apply group by on IHS -
Now
distinct-ihs
hasIHS-count
(I am interested only in IHS column - this will be used for ordinal scale later) -
dataset
distinct-appserver
- On ihssummary, apply group by on AppServer -
Now
distinct-appserver
hasAppServer-count
(I am interested only in AppServer column - this will be used for ordinal scale later) -
dataset
fields
- hardcoded values IHS and AppServer -
scale
ord
- scale on "fields" dataset - to be used to draw the parallel axes -
scale
IHS
- mapping all distinct IHS values to a range 20 to Height - to be used to plot points on IHS axis -
scale
AppServer
- mapping all distinct AppServer values to a range 20 to Height - to be used to plot points on AppServer axis -
scale
StrokeWidth
- mapping ihssummary.count to range [1-10] - to be used for strokeWidth of the lines -
scale
StrokeOpacity
- mapping ihssummary.count to range [0-1] - to be used for strokeOpacity of the lines -
draw two vertical axes (IHS and AppServer)
-
marks -
- "group" mark over dataset ihssummary
- "line" mark over dataset fields
- enter: draw line by passing appropriate x and y values by picking parent's IHS/AppServer values and mapping them with appropriate scale.
- hover: make line red
- update: make line back to steelblue
- "line" mark over dataset fields
- "group" mark over dataset ihssummary
Problem:
The above code all works fine. Now, I want to add a text that shows the number of requests on top-right when someone hovers on the line.
So, I tried to add a mouseover signal on the line.
"signals": [
{
"name": "tooltip",
"value": {},
"on": [
{"events": "line:mouseover", "update": "datum"},
{"events": "line:mouseout", "update": "{}"}
]
}
]
But the line datum has nothing useful. All it has is:
VEGA_DEBUG.view.signal("tooltip")
{data: "IHS", Symbol(vega_id): 171852}
data: "IHS"
Symbol(vega_id): 171852
__proto__: Object
I really need to get the ihssummary
data into that signal. I tried "update": "parent"
and also "update": {"parent": "count"}
, but none of those worked.
How do I get this working?
My Vega Code:
(Attaching it into first reply due to post size limit)
Thanks a lot.
-- Parag