Files
purple-explorer/public/js/jqplot.highlighter.min.js
T

1 line
6.9 KiB
JavaScript
Raw Normal View History

2020-11-23 20:15:40 -07:00
!function(t){t.jqplot.eventListenerHooks.push(["jqplotMouseMove",function(t,i,e,o,l){var h=l.plugins.highlighter,n=l.plugins.cursor;if(h.show)if(null==o&&h.isHighlighting){var a=jQuery.Event("jqplotHighlighterUnhighlight");l.target.trigger(a);var g=h.highlightCanvas._ctx;g.clearRect(0,0,g.canvas.width,g.canvas.height),h.fadeTooltip?h._tooltipElem.fadeOut(h.tooltipFadeSpeed):h._tooltipElem.hide(),h.bringSeriesToFront&&l.restorePreviousSeriesOrder(),h.isHighlighting=!1,h.currentNeighbor=null,g=null}else if(null!=o&&l.series[o.seriesIndex].showHighlight&&!h.isHighlighting){var a=jQuery.Event("jqplotHighlighterHighlight");a.which=t.which,a.pageX=t.pageX,a.pageY=t.pageY;var p=[o.seriesIndex,o.pointIndex,o.data,l];l.target.trigger(a,p),h.isHighlighting=!0,h.currentNeighbor=o,h.showMarker&&s(l,o),!l.series[o.seriesIndex].show||!h.showTooltip||n&&n._zoom.started||r(l,l.series[o.seriesIndex],o),h.bringSeriesToFront&&l.moveSeriesToFront(o.seriesIndex)}else if(null!=o&&h.isHighlighting&&h.currentNeighbor!=o&&l.series[o.seriesIndex].showHighlight){var g=h.highlightCanvas._ctx;g.clearRect(0,0,g.canvas.width,g.canvas.height),h.isHighlighting=!0,h.currentNeighbor=o,h.showMarker&&s(l,o),!l.series[o.seriesIndex].show||!h.showTooltip||n&&n._zoom.started||r(l,l.series[o.seriesIndex],o),h.bringSeriesToFront&&l.moveSeriesToFront(o.seriesIndex)}}]),t.jqplot.Highlighter=function(i){this.show=t.jqplot.config.enablePlugins,this.markerRenderer=new t.jqplot.MarkerRenderer({shadow:!1}),this.showMarker=!0,this.lineWidthAdjust=2.5,this.sizeAdjust=5,this.showTooltip=!0,this.tooltipLocation="nw",this.fadeTooltip=!0,this.tooltipFadeSpeed="fast",this.tooltipOffset=2,this.tooltipAxes="both",this.tooltipSeparator=", ",this.tooltipContentEditor=null,this.useAxesFormatters=!0,this.tooltipFormatString="%.5P",this.formatString=null,this.yvalues=1,this.bringSeriesToFront=!1,this._tooltipElem,this.isHighlighting=!1,this.currentNeighbor=null,t.extend(!0,this,i)};var i=["nw","n","ne","e","se","s","sw","w"],e={nw:0,n:1,ne:2,e:3,se:4,s:5,sw:6,w:7},o=["se","s","sw","w","nw","n","ne","e"];function s(i,e){var o=i.plugins.highlighter,s=i.series[e.seriesIndex],r=s.markerRenderer,l=o.markerRenderer;l.style=r.style,l.lineWidth=r.lineWidth+o.lineWidthAdjust,l.size=r.size+o.sizeAdjust;var h=t.jqplot.getColorComponents(r.color),n=[h[0],h[1],h[2]],a=h[3]>=.6?.6*h[3]:h[3]*(2-h[3]);l.color="rgba("+n[0]+","+n[1]+","+n[2]+","+a+")",l.init(),l.draw(s.gridData[e.pointIndex][0],s.gridData[e.pointIndex][1],o.highlightCanvas._ctx)}function r(s,r,l){var h=s.plugins.highlighter,n=h._tooltipElem,a=r.highlighter||{},g=t.extend(!0,{},h,a);if(g.useAxesFormatters){for(var p=r._xaxis._ticks[0].formatter,d=r._yaxis._ticks[0].formatter,f=r._xaxis._ticks[0].formatString,u=r._yaxis._ticks[0].formatString,c=p(f,l.data[0]),m=[],j=1;j<g.yvalues+1;j++)m.push(d(u,l.data[j]));if("string"==typeof g.formatString)switch(g.tooltipAxes){case"both":case"xy":m.unshift(c),m.unshift(g.formatString),v=t.jqplot.sprintf.apply(t.jqplot.sprintf,m);break;case"yx":m.push(c),m.unshift(g.formatString),v=t.jqplot.sprintf.apply(t.jqplot.sprintf,m);break;case"x":v=t.jqplot.sprintf.apply(t.jqplot.sprintf,[g.formatString,c]);break;case"y":m.unshift(g.formatString),v=t.jqplot.sprintf.apply(t.jqplot.sprintf,m);break;default:m.unshift(c),m.unshift(g.formatString),v=t.jqplot.sprintf.apply(t.jqplot.sprintf,m)}else switch(g.tooltipAxes){case"both":case"xy":v=c;for(j=0;j<m.length;j++)v+=g.tooltipSeparator+m[j];break;case"yx":v="";for(j=0;j<m.length;j++)v+=m[j]+g.tooltipSeparator;v+=c;break;case"x":v=c;break;case"y":v=m.join(g.tooltipSeparator);break;default:v=c;for(j=0;j<m.length;j++)v+=g.tooltipSeparator+m[j]}}else{var v;"string"==typeof g.formatString?v=t.jqplot.sprintf.apply(t.jqplot.sprintf,[g.formatString].concat(l.data)):"both"==g.tooltipAxes||"xy"==g.tooltipAxes?v=t.jqplot.sprintf(g.tooltipFormatString,l.data[0])+g.tooltipSeparator+t.jqplot.sprintf(g.tooltipFormatString,l.data[1]):"yx"==g.tooltipAxes?v=t.jqplot.sprintf(g.tooltipFormatString,l.data[1])+g.tooltipSeparator+t.jqplot.sprintf(g.tooltipFormatString,l.data[0]):"x"==