plotly.js
Version:
The open source javascript graphing library that powers plotly
18 lines (13 loc) • 532 B
JavaScript
;
module.exports = function eventData(out, pt /* , trace, cd, pointNumber */) {
// standard cartesian event data
out.x = 'xVal' in pt ? pt.xVal : pt.x;
out.y = 'yVal' in pt ? pt.yVal : pt.y;
// for funnel
if('percentInitial' in pt) out.percentInitial = pt.percentInitial;
if('percentPrevious' in pt) out.percentPrevious = pt.percentPrevious;
if('percentTotal' in pt) out.percentTotal = pt.percentTotal;
if(pt.xa) out.xaxis = pt.xa;
if(pt.ya) out.yaxis = pt.ya;
return out;
};