This is an automated email from the ASF dual-hosted git repository. gengliang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push: new 04f04e0 [SPARK-31420][WEBUI] Infinite timeline redraw in job details page 04f04e0 is described below commit 04f04e0ea74fd26a7bd39e833752ce277997f4dc Author: Kousuke Saruta <saru...@oss.nttdata.com> AuthorDate: Mon Apr 13 23:23:00 2020 -0700 [SPARK-31420][WEBUI] Infinite timeline redraw in job details page ### What changes were proposed in this pull request? Upgrade vis.js to fix an infinite re-drawing issue. As reported here, old releases of vis.js have that issue. Fortunately, the latest version seems to resolve the issue. With the latest release of vis.js, there are some performance issues with the original `timeline-view.js` and `timeline-view.css` so I also changed them. ### Why are the changes needed? For better UX. ### Does this PR introduce any user-facing change? No. Appearance and functionalities are not changed. ### How was this patch tested? I confirmed infinite redrawing doesn't happen with a JobPage which I had reproduced the issue. With the original version of vis.js, I reproduced the issue with the following conditions. * Use history server and load core/src/test/resources/spark-events. * Visit the JobPage for job2 in application_1553914137147_0018. * Zoom out to 80% on Safari / Chrome / Firefox. Maybe, it depends on OS and the version of browsers. Closes #28192 from sarutak/upgrade-visjs. Authored-by: Kousuke Saruta <saru...@oss.nttdata.com> Signed-off-by: Gengliang Wang <gengliang.w...@databricks.com> --- .../org/apache/spark/ui/static/timeline-view.css | 12 ----- .../org/apache/spark/ui/static/timeline-view.js | 29 ++++++++--- .../spark/ui/static/vis-timeline-graph2d.min.css | 2 + .../ui/static/vis-timeline-graph2d.min.css.map | 1 + .../spark/ui/static/vis-timeline-graph2d.min.js | 60 ++++++++++++++++++++++ .../ui/static/vis-timeline-graph2d.min.js.map | 1 + .../org/apache/spark/ui/static/vis.min.css | 1 - .../org/apache/spark/ui/static/vis.min.js | 45 ---------------- .../main/scala/org/apache/spark/ui/UIUtils.scala | 5 +- .../org/apache/spark/ui/UISeleniumSuite.scala | 2 +- dev/.rat-excludes | 6 ++- licenses-binary/LICENSE-vis-timeline.txt | 23 +++++++++ licenses-binary/LICENSE-vis.txt | 22 -------- licenses/LICENSE-vis-timeline.txt | 23 +++++++++ licenses/LICENSE-vis.txt | 22 -------- 15 files changed, 140 insertions(+), 114 deletions(-) diff --git a/core/src/main/resources/org/apache/spark/ui/static/timeline-view.css b/core/src/main/resources/org/apache/spark/ui/static/timeline-view.css index 3f31403..c9bf83c 100644 --- a/core/src/main/resources/org/apache/spark/ui/static/timeline-view.css +++ b/core/src/main/resources/org/apache/spark/ui/static/timeline-view.css @@ -238,18 +238,6 @@ tr.corresponding-item-hover > td, tr.corresponding-item-hover > th { background-color: #D6FFE4 !important; } -#application-timeline.collapsed { - display: none; -} - -#job-timeline.collapsed { - display: none; -} - -#task-assignment-timeline.collapsed { - display: none; -} - .control-panel { margin-bottom: 5px; } diff --git a/core/src/main/resources/org/apache/spark/ui/static/timeline-view.js b/core/src/main/resources/org/apache/spark/ui/static/timeline-view.js index b2cd616..a63ee86 100644 --- a/core/src/main/resources/org/apache/spark/ui/static/timeline-view.js +++ b/core/src/main/resources/org/apache/spark/ui/static/timeline-view.js @@ -26,7 +26,7 @@ function drawApplicationTimeline(groupArray, eventObjArray, startTime, offset) { editable: false, align: 'left', showCurrentTime: false, - min: startTime, + start: startTime, zoomable: false, moment: function (date) { return vis.moment(date).utcOffset(offset); @@ -50,7 +50,7 @@ function drawApplicationTimeline(groupArray, eventObjArray, startTime, offset) { }; $(this).click(function() { - var jobPagePath = $(getSelectorForJobEntry(this)).find("a.name-link").attr("href") + var jobPagePath = $(getSelectorForJobEntry(this)).find("a.name-link").attr("href"); window.location.href = jobPagePath }); @@ -75,6 +75,9 @@ function drawApplicationTimeline(groupArray, eventObjArray, startTime, offset) { $("#application-timeline").toggleClass('collapsed'); + var visibilityState = status ? "" : "none"; + $("#application-timeline").css("display", visibilityState); + // Switch the class of the arrow from open to closed. $(this).find('.expand-application-timeline-arrow').toggleClass('arrow-open'); $(this).find('.expand-application-timeline-arrow').toggleClass('arrow-closed'); @@ -89,6 +92,8 @@ $(function () { // Set it to false so that the click function can revert it window.localStorage.setItem("expand-application-timeline", "false"); $("span.expand-application-timeline").trigger('click'); + } else { + $("#application-timeline").css("display", "none"); } }); @@ -103,7 +108,7 @@ function drawJobTimeline(groupArray, eventObjArray, startTime, offset) { editable: false, align: 'left', showCurrentTime: false, - min: startTime, + start: startTime, zoomable: false, moment: function (date) { return vis.moment(date).utcOffset(offset); @@ -152,6 +157,9 @@ function drawJobTimeline(groupArray, eventObjArray, startTime, offset) { $("#job-timeline").toggleClass('collapsed'); + var visibilityState = status ? "" : "none"; + $("#job-timeline").css("display", visibilityState); + // Switch the class of the arrow from open to closed. $(this).find('.expand-job-timeline-arrow').toggleClass('arrow-open'); $(this).find('.expand-job-timeline-arrow').toggleClass('arrow-closed'); @@ -166,13 +174,15 @@ $(function () { // Set it to false so that the click function can revert it window.localStorage.setItem("expand-job-timeline", "false"); $("span.expand-job-timeline").trigger('click'); + } else { + $("#job-timeline").css("display", "none"); } }); function drawTaskAssignmentTimeline(groupArray, eventObjArray, minLaunchTime, maxFinishTime, offset) { var groups = new vis.DataSet(groupArray); var items = new vis.DataSet(eventObjArray); - var container = $("#task-assignment-timeline")[0] + var container = $("#task-assignment-timeline")[0]; var options = { groupOrder: function(a, b) { return a.value - b.value @@ -181,15 +191,15 @@ function drawTaskAssignmentTimeline(groupArray, eventObjArray, minLaunchTime, ma align: 'left', selectable: false, showCurrentTime: false, - min: minLaunchTime, - max: maxFinishTime, + start: minLaunchTime, + end: maxFinishTime, zoomable: false, moment: function (date) { return vis.moment(date).utcOffset(offset); } }; - var taskTimeline = new vis.Timeline(container) + var taskTimeline = new vis.Timeline(container); taskTimeline.setOptions(options); taskTimeline.setGroups(groups); taskTimeline.setItems(items); @@ -220,6 +230,9 @@ function drawTaskAssignmentTimeline(groupArray, eventObjArray, minLaunchTime, ma $("#task-assignment-timeline").toggleClass("collapsed"); + var visibilityState = status ? "" : "none"; + $("#task-assignment-timeline").css("display", visibilityState); + // Switch the class of the arrow from open to closed. $(this).find(".expand-task-assignment-timeline-arrow").toggleClass("arrow-open"); $(this).find(".expand-task-assignment-timeline-arrow").toggleClass("arrow-closed"); @@ -234,6 +247,8 @@ $(function () { // Set it to false so that the click function can revert it window.localStorage.setItem("expand-task-assignment-timeline", "false"); $("span.expand-task-assignment-timeline").trigger('click'); + } else { + $("#task-assignment-timeline").css("display", "none"); } }); diff --git a/core/src/main/resources/org/apache/spark/ui/static/vis-timeline-graph2d.min.css b/core/src/main/resources/org/apache/spark/ui/static/vis-timeline-graph2d.min.css new file mode 100644 index 0000000..d22a9ac --- /dev/null +++ b/core/src/main/resources/org/apache/spark/ui/static/vis-timeline-graph2d.min.css @@ -0,0 +1,2 @@ +.vis [class*=span]{min-height:0;width:auto}.vis .overlay{position:absolute;top:0;left:0;width:100%;height:100%;z-index:10}.vis-active{box-shadow:0 0 10px #86d5f8}div.vis-configuration{position:relative;display:block;float:left;font-size:12px}div.vis-configuration-wrapper{display:block;width:700px}div.vis-configuration-wrapper:after{clear:both;content:"";display:block}div.vis-configuration.vis-config-option-container{display:block;width:495px;background-color:#fff;border:2px solid #f7f8fa [...] +/*# sourceMappingURL=vis-timeline-graph2d.min.css.map */ \ No newline at end of file diff --git a/core/src/main/resources/org/apache/spark/ui/static/vis-timeline-graph2d.min.css.map b/core/src/main/resources/org/apache/spark/ui/static/vis-timeline-graph2d.min.css.map new file mode 100644 index 0000000..3c165a7 --- /dev/null +++ b/core/src/main/resources/org/apache/spark/ui/static/vis-timeline-graph2d.min.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["bootstrap.css","activator.css","configuration.css","tooltip.css","panel.css","currenttime.css","customtime.css","timeline.css","pathStyles.css","dataaxis.css","itemset.css","labelset.css","timeaxis.css","item.css"],"names":[],"mappings":"AAEA,mBACE,YAAa,CACb,UACF,CCLA,cACE,iBAAkB,CAClB,KAAM,CACN,MAAO,CACP,UAAW,CACX,WAAY,CAGZ,UACF,CAEA,YACE,2BACF,CCbA,sBACI,iBAAiB,CACjB,aAAa,CACb,UAAU,CACV,cACJ,CAEA,8BACI,aAAa,CACb,WACJ,CAEA,oCACE,UAAW,CACX,UAAW,CACX,aACF,CAEA,kDA [...] \ No newline at end of file diff --git a/core/src/main/resources/org/apache/spark/ui/static/vis-timeline-graph2d.min.js b/core/src/main/resources/org/apache/spark/ui/static/vis-timeline-graph2d.min.js new file mode 100644 index 0000000..df73040 --- /dev/null +++ b/core/src/main/resources/org/apache/spark/ui/static/vis-timeline-graph2d.min.js @@ -0,0 +1,60 @@ +/** + * vis-timeline and vis-graph2d + * https://visjs.github.io/vis-timeline/ + * + * Create a fully customizable, interactive timeline with items and ranges. + * + * @version 7.3.4 + * @date 2020-03-18T17:03:58.105Z + * + * @copyright (c) 2011-2017 Almende B.V, http://almende.com + * @copyright (c) 2017-2019 visjs contributors, https://github.com/visjs + * + * @license + * vis.js is dual licensed under both + * + * 1. The Apache 2.0 License + * http://www.apache.org/licenses/LICENSE-2.0 + * + * and + * + * 2. The MIT License + * http://opensource.org/licenses/MIT + * + * vis.js may be distributed under either license. + */ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).vis=t.vis||{})}(this,(function(t){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function i(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}function n(t,e){return t(e={exports:{}} [...] +/** + * vis-util + * https://github.com/visjs/vis-util + * + * utilitie collection for visjs + * + * @version 4.0.0 + * @date 2020-02-29T15:35:13.178Z + * + * @copyright (c) 2011-2017 Almende B.V, http://almende.com + * @copyright (c) 2017-2019 visjs contributors, https://github.com/visjs + * + * @license + * vis.js is dual licensed under both + * + * 1. The Apache 2.0 License + * http://www.apache.org/licenses/LICENSE-2.0 + * + * and + * + * 2. The MIT License + * http://opensource.org/licenses/MIT + * + * vis.js may be distributed under either license. + */ +function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return qo(e.length?e:[Jo()])},HSVToHex:xs,HSVToRGB:ys,RGBToHSV:gs,RGBToHex:fs,addClassName:function(t,e){var i=t.className.split(" "),n=e.split(" ");i=Pn(i).call(i,En(n).call(n,(function(t){return Fo(i).call(i,t)<0}))),t.className=i.join(" ")},addCssText:function(t,e){var i=function(t){for(var e=1;e<arguments.length;e++){var i,n=null!=arguments[e]?arguments[e]:{};if(e%2)mn(i=Ko(Object(n),!0)).call(i,(funct [...] +/*! Hammer.JS - v2.0.17-rc - 2019-12-16 + * http://naver.github.io/egjs + * + * Forked By Naver egjs + * Copyright (c) hammerjs + * Licensed under the MIT license */ +function yl(){return(yl=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t}).apply(this,arguments)}function xl(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function wl(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var _l,kl="function"!=typeof Object.assign?function(t){if(null= [...] +//# sourceMappingURL=vis-timeline-graph2d.min.js.map diff --git a/core/src/main/resources/org/apache/spark/ui/static/vis-timeline-graph2d.min.js.map b/core/src/main/resources/org/apache/spark/ui/static/vis-timeline-graph2d.min.js.map new file mode 100644 index 0000000..779880d --- /dev/null +++ b/core/src/main/resources/org/apache/spark/ui/static/vis-timeline-graph2d.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"vis-timeline-graph2d.min.js","sources":["../../node_modules/moment/moment.js","../../node_modules/core-js-pure/internals/global.js","../../node_modules/moment/locale/de.js","../../node_modules/moment/locale/es.js","../../node_modules/moment/locale/fr.js","../../node_modules/moment/locale/it.js","../../node_modules/moment/locale/ja.js","../../node_modules/moment/locale/nl.js","../../node_modules/moment/locale/pl.js","../../node_modules/moment/locale/ru.js","../../node [...] \ No newline at end of file diff --git a/core/src/main/resources/org/apache/spark/ui/static/vis.min.css b/core/src/main/resources/org/apache/spark/ui/static/vis.min.css deleted file mode 100644 index 40d182cf..0000000 --- a/core/src/main/resources/org/apache/spark/ui/static/vis.min.css +++ /dev/null @@ -1 +0,0 @@ -.vis-background,.vis-labelset,.vis-timeline{overflow:hidden}.vis .overlay{position:absolute;top:0;left:0;width:100%;height:100%;z-index:10}.vis-active{box-shadow:0 0 10px #86d5f8}.vis [class*=span]{min-height:0;width:auto}div.vis-configuration{position:relative;display:block;float:left;font-size:12px}div.vis-configuration-wrapper{display:block;width:700px}div.vis-configuration-wrapper::after{clear:both;content:"";display:block}div.vis-configuration.vis-config-option-container{display:blo [...] \ No newline at end of file diff --git a/core/src/main/resources/org/apache/spark/ui/static/vis.min.js b/core/src/main/resources/org/apache/spark/ui/static/vis.min.js deleted file mode 100644 index 92b8ed7..0000000 --- a/core/src/main/resources/org/apache/spark/ui/static/vis.min.js +++ /dev/null @@ -1,45 +0,0 @@ -/** - * vis.js - * https://github.com/almende/vis - * - * A dynamic, browser-based visualization library. - * - * @version 4.16.1 - * @date 2016-04-18 - * - * @license - * Copyright (C) 2011-2016 Almende B.V, http://almende.com - * - * Vis.js is dual licensed under both - * - * * The Apache 2.0 License - * http://www.apache.org/licenses/LICENSE-2.0 - * - * and - * - * * The MIT License - * http://opensource.org/licenses/MIT - * - * Vis.js may be distributed under either license. - */ -"use strict";!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.vis=e():t.vis=e()}(this,function(){return function(t){function e(o){if(i[o])return i[o].exports;var n=i[o]={exports:{},id:o,loaded:!1};return t[o].call(n.exports,n,n.exports,e),n.loaded=!0,n.exports}var i={};return e.m=t,e.c=i,e.p="",e(0)}([function(t,e,i){var o=i(1);o.extend(e,i(7)),o.extend(e,i(24)),o.extend [...] -i.milliseconds=+e-+t.clone().add(i.months,"M"),i}function ae(t,e){var i;return t.isValid()&&e.isValid()?(e=Vt(e,t),t.isBefore(e)?i=re(t,e):(i=re(e,t),i.milliseconds=-i.milliseconds,i.months=-i.months),i):{milliseconds:0,months:0}}function he(t){return 0>t?-1*Math.round(-1*t):Math.round(t)}function de(t,e){return function(i,o){var n,s;return null===o||isNaN(+o)||(x(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period)."),s=i,i=o,o=s),i="string"==typeof [...] -r.xOffset&&(t+=r.xOffset),r.yOffset&&(i+=r.yOffset),r.content&&(h.textContent=r.content),r.className&&h.setAttributeNS(null,"class",r.className+" vis-label"),h.setAttributeNS(null,"x",t),h.setAttributeNS(null,"y",i)}return a},e.drawBar=function(t,i,o,n,s,r,a,h){if(0!=n){0>n&&(n*=-1,i-=n);var d=e.getSVGElement("rect",r,a);d.setAttributeNS(null,"x",t-.5*o),d.setAttributeNS(null,"y",i),d.setAttributeNS(null,"width",o),d.setAttributeNS(null,"height",n),d.setAttributeNS(null,"class",s),h&&d.s [...] -m.strokeStyle=this.axisColor,m.beginPath(),m.moveTo(t.x,t.y),m.lineTo(e.x,e.y),m.stroke(),t=this._convert3Dto2D(new c(this.xMax,i.getCurrent(),this.zMin)),e=this._convert3Dto2D(new c(this.xMax-y,i.getCurrent(),this.zMin)),m.strokeStyle=this.axisColor,m.beginPath(),m.moveTo(t.x,t.y),m.lineTo(e.x,e.y),m.stroke()),s=Math.sin(w)>0?this.xMin:this.xMax,n=this._convert3Dto2D(new c(s,i.getCurrent(),this.zMin)),Math.cos(2*w)<0?(m.textAlign="center",m.textBaseline="top",n.y+=b):Math.sin(2*w)>0?(m. [...] -i.isFirst=!!s,i.isFinal=!!r,s&&(t.session={}),i.eventType=e,E(t,i),t.emit("hammer.input",i),t.recognize(i),t.session.prevInput=i}function E(t,e){var i=t.session,o=e.pointers,n=o.length;i.firstInput||(i.firstInput=N(e)),n>1&&!i.firstMultiple?i.firstMultiple=N(e):1===n&&(i.firstMultiple=!1);var s=i.firstInput,r=i.firstMultiple,a=r?r.center:s.center,h=e.center=R(o);e.timeStamp=gt(),e.deltaTime=e.timeStamp-s.timeStamp,e.angle=B(a,h),e.distance=A(a,h),P(i,e),e.offsetDirection=L(e.deltaX,e.del [...] -var o=t[0],n=t[1],s=t[2],r=t[3],a=document.createElement("input");a.className="vis-configuration vis-config-range";try{a.type="range",a.min=n,a.max=s}catch(h){}a.step=r;var d="",l=0;if(void 0!==e){var c=1.2;0>e&&n>e*c?(a.min=Math.ceil(e*c),l=a.min,d="range increased"):n>e/c&&(a.min=Math.ceil(e/c),l=a.min,d="range increased"),e*c>s&&1!==s&&(a.max=Math.ceil(e*c),l=a.max,d="range increased"),a.value=e}else a.value=o;var u=document.createElement("input");u.className="vis-configuration vis-co [...] -this.startToFront=0>=1-e,this.endToFront=0>=e-1;var h=d.snapAwayFromHidden(this.body.hiddenDates,r,1-e,!0),l=d.snapAwayFromHidden(this.body.hiddenDates,a,e-1,!0);h==r&&l==a||(this.props.touch.start=h,this.props.touch.end=l,this.scaleOffset=1-t.scale,r=h,a=l),this.setRange(r,a,!1,!0),this.startToFront=!1,this.endToFront=!0}},o.prototype._isInsideRange=function(t){var e=t.center?t.center.x:t.clientX;if(this.options.rtl)var i=e-r.getAbsoluteLeft(this.body.dom.centerContainer);else var i=r.g [...] -this.lastVisibleInterval=h,this.props.lastWidth=this.props.width;var l=this.stackDirty,c=this._firstGroup(),u={item:t.item,axis:t.axis},p={item:t.item,axis:t.item.vertical/2},f=0,m=t.axis+t.item.vertical;return this.groups[y].redraw(e,p,l),r.forEach(this.groups,function(t){var i=t==c?u:p,o=t.redraw(e,i,l);s=o||s,f+=t.height}),f=Math.max(f,m),this.stackDirty=!1,a.style.height=i(f),this.props.width=a.offsetWidth,this.props.height=f,this.dom.axis.style.top=i("top"==n?this.body.domProps.top. [...] -return d>t?-1:l>=t?0:1};if(e.length>0)for(s=0;s<e.length;s++)this._checkIfVisibleWithReference(e[s],r,a,i);var u=n.binarySearchCustom(t.byStart,c,"data","start");if(this._traceVisible(u,t.byStart,r,a,function(t){return t.data.start<d||t.data.start>l}),1==this.checkRangedItems)for(this.checkRangedItems=!1,s=0;s<t.byEnd.length;s++)this._checkIfVisibleWithReference(t.byEnd[s],r,a,i);else{var p=n.binarySearchCustom(t.byEnd,c,"data","end");this._traceVisible(p,t.byEnd,r,a,function(t){return t [...] -}),t.stopPropagation()}},o.prototype._onDragEnd=function(t){this.eventParams.dragging&&(this.body.emitter.emit("timechanged",{id:this.options.id,time:new Date(this.customTime.valueOf())}),t.stopPropagation())},o.customTimeFromTarget=function(t){for(var e=t.target;e;){if(e.hasOwnProperty("custom-time"))return e["custom-time"];e=e.parentNode}return null},t.exports=o},function(t,e){e.en={current:"current",time:"time"},e.en_EN=e.en,e.en_US=e.en,e.nl={current:"huidige",time:"tijd"},e.nl_NL=e. [...] -this.props.height=this.body.domProps.right.height),t=this._redrawLabels(),t=this._isResized()||t,this.options.icons===!0?this._redrawGroupIcons():this._cleanupIcons(),this._redrawTitle(s)}return t},o.prototype._redrawLabels=function(){var t=this,e=!1;s.prepareElements(this.DOMelements.lines),s.prepareElements(this.DOMelements.labels);var i=this.options.orientation,o=void 0!=this.options[i].range?this.options[i].range:{},n=!0;void 0!=o.max&&(this.range.end=o.max,n=!1);var r=!0;void 0!=o.m [...] -},functions:{createNode:function(){},createEdge:function(){},getPointer:function(){}},modules:{},view:{scale:1,translation:{x:0,y:0}}},this.bindEventListeners(),this.images=new r["default"](function(){return o.body.emitter.emit("_requestRedraw")}),this.groups=new h["default"],this.canvas=new w["default"](this.body),this.selectionHandler=new D["default"](this.body,this.canvas),this.interactionHandler=new O["default"](this.body,this.canvas,this.selectionHandler),this.view=new x["default"]( [...] -this._drawBackground(t),this._drawText(t,o,e,i,n))}}},{key:"_drawBackground",value:function(t){if(void 0!==this.fontOptions.background&&"none"!==this.fontOptions.background){t.fillStyle=this.fontOptions.background;var e=2;if(this.isEdgeLabel)switch(this.fontOptions.align){case"middle":t.fillRect(.5*-this.size.width,.5*-this.size.height,this.size.width,this.size.height);break;case"top":t.fillRect(.5*-this.size.width,-(this.size.height+e),this.size.width,this.size.height);break;case"bottom [...] -value:function(t,e){return this._distanceToBorder(t,e)}}]),e}(d["default"]);e["default"]=l},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Sup [...] -m=p-f,!(Math.abs(m)<v));)m>0?a>0?s=g:r=g:a>0?r=g:s=g,d++;return c.t=g,c}},{key:"getLineWidth",value:function(t,e){return t===!0?Math.max(this.selectionWidth,.3/this.body.view.scale):e===!0?Math.max(this.hoverWidth,.3/this.body.view.scale):Math.max(this.options.width,.3/this.body.view.scale)}},{key:"getColor",value:function(t,e,i){var o=this.options.color;if(o.inherit!==!1){if("both"===o.inherit&&this.from.id!==this.to.id){var n=t.createLinearGradient(this.from.x,this.from.y,this.to.x,thi [...] -e.lineTo(t.range.minX,t.range.maxY),e.stroke(),e.beginPath(),e.moveTo(t.range.minX,t.range.maxY),e.lineTo(t.range.minX,t.range.minY),e.stroke()}}]),t}();e["default"]=n},function(t,e){function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProp [...] -this.frame.canvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}else{var e=document.createElement("DIV");e.style.color="red",e.style.fontWeight="bold",e.style.padding="10px",e.innerHTML="Error: your browser does not support HTML canvas",this.frame.canvas.appendChild(e)}this.body.container.appendChild(this.frame),this.body.view.scale=1,this.body.view.translation={x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight},this._bindHammer()}},{key:"_bi [...] -return o.length>0?e===!0?this.body.nodes[o[o.length-1]]:o[o.length-1]:void 0}},{key:"_getEdgesOverlappingWith",value:function(t,e){for(var i=this.body.edges,o=0;o<this.body.edgeIndices.length;o++){var n=this.body.edgeIndices[o];i[n].isOverlappingWith(t)&&e.push(n)}}},{key:"_getAllEdgesOverlappingWith",value:function(t){var e=[];return this._getEdgesOverlappingWith(t,e),e}},{key:"getEdgeAt",value:function(t){var e=arguments.length<=1||void 0===arguments[1]?!0:arguments[1],i=this._pointerT [...] -if(i.x=e.x,i.y=e.y,2!==this.options.editNode.length)throw new Error("The function for edit does not support two arguments (data, callback)");this.options.editNode(i,function(e){null!==e&&void 0!==e&&"editNode"===t.inMode&&t.body.data.nodes.getDataSet().update(e),t.showManipulatorToolbar()})}else alert(this.options.locales[this.options.locale].editClusterError||this.options.locales.en.editClusterError)}else this.showManipulatorToolbar()}},{key:"addEdgeMode",value:function(){if(this.editMo [...] -this.lineTo(t+n,e-s),this.lineTo(t-n,e-s),this.lineTo(t,e+(r-s)),this.closePath()},CanvasRenderingContext2D.prototype.star=function(t,e,i){this.beginPath(),i*=.82,e+=.1*i;for(var o=0;10>o;o++){var n=o%2===0?1.3*i:.5*i;this.lineTo(t+n*Math.sin(2*o*Math.PI/10),e-n*Math.cos(2*o*Math.PI/10))}this.closePath()},CanvasRenderingContext2D.prototype.diamond=function(t,e,i){this.beginPath(),this.lineTo(t,e+i),this.lineTo(t+i,e),this.lineTo(t,e-i),this.lineTo(t-i,e),this.closePath()},CanvasRendering [...] -//# sourceMappingURL=vis.map diff --git a/core/src/main/scala/org/apache/spark/ui/UIUtils.scala b/core/src/main/scala/org/apache/spark/ui/UIUtils.scala index c84bc1f..9016785 100644 --- a/core/src/main/scala/org/apache/spark/ui/UIUtils.scala +++ b/core/src/main/scala/org/apache/spark/ui/UIUtils.scala @@ -225,13 +225,14 @@ private[spark] object UIUtils extends Logging { <meta name="viewport" content="width=device-width, initial-scale=1" /> <link rel="stylesheet" href={prependBaseUri(request, "/static/bootstrap.min.css")} type="text/css"/> - <link rel="stylesheet" href={prependBaseUri(request, "/static/vis.min.css")} type="text/css"/> + <link rel="stylesheet" + href={prependBaseUri(request, "/static/vis-timeline-graph2d.min.css")} type="text/css"/> <link rel="stylesheet" href={prependBaseUri(request, "/static/webui.css")} type="text/css"/> <link rel="stylesheet" href={prependBaseUri(request, "/static/timeline-view.css")} type="text/css"/> <script src={prependBaseUri(request, "/static/sorttable.js")} ></script> <script src={prependBaseUri(request, "/static/jquery-3.4.1.min.js")}></script> - <script src={prependBaseUri(request, "/static/vis.min.js")}></script> + <script src={prependBaseUri(request, "/static/vis-timeline-graph2d.min.js")}></script> <script src={prependBaseUri(request, "/static/bootstrap.bundle.min.js")}></script> <script src={prependBaseUri(request, "/static/initialize-tooltips.js")}></script> <script src={prependBaseUri(request, "/static/table.js")}></script> diff --git a/core/src/test/scala/org/apache/spark/ui/UISeleniumSuite.scala b/core/src/test/scala/org/apache/spark/ui/UISeleniumSuite.scala index 9f0cdea..757e03b 100644 --- a/core/src/test/scala/org/apache/spark/ui/UISeleniumSuite.scala +++ b/core/src/test/scala/org/apache/spark/ui/UISeleniumSuite.scala @@ -47,7 +47,7 @@ import org.apache.spark.status.api.v1.{JacksonMessageWriter, RDDDataDistribution private[spark] class SparkUICssErrorHandler extends DefaultCssErrorHandler { - private val cssWhiteList = List("bootstrap.min.css", "vis.min.css") + private val cssWhiteList = List("bootstrap.min.css", "vis-timeline-graph2d.min.css") private def isInWhileList(uri: String): Boolean = cssWhiteList.exists(uri.endsWith) diff --git a/dev/.rat-excludes b/dev/.rat-excludes index b1a8494..473551f 100644 --- a/dev/.rat-excludes +++ b/dev/.rat-excludes @@ -31,8 +31,10 @@ d3.min.js dagre-d3.min.js graphlib-dot.min.js sorttable.js -vis.min.js -vis.min.css +vis-timeline-graph2d.min.js +vis-timeline-graph2d.min.js.map +vis-timeline-graph2d.min.css +vis-timeline-graph2d.min.css.map dataTables.bootstrap4.1.10.20.min.css dataTables.bootstrap4.1.10.20.min.js dataTables.rowsGroup.js diff --git a/licenses-binary/LICENSE-vis-timeline.txt b/licenses-binary/LICENSE-vis-timeline.txt new file mode 100644 index 0000000..d343783 --- /dev/null +++ b/licenses-binary/LICENSE-vis-timeline.txt @@ -0,0 +1,23 @@ +vis-timeline and vis-graph2d +https://visjs.github.io/vis-timeline/ + +Create a fully customizable, interactive timeline with items and ranges. + +@version 7.3.4 +@date 2020-03-18T17:03:58.105Z + +@copyright (c) 2011-2017 Almende B.V, http://almende.com +@copyright (c) 2017-2019 visjs contributors, https://github.com/visjs + +@license +vis.js is dual licensed under both + + 1. The Apache 2.0 License + http://www.apache.org/licenses/LICENSE-2.0 + + and + + 2. The MIT License + http://opensource.org/licenses/MIT + +vis.js may be distributed under either license. diff --git a/licenses-binary/LICENSE-vis.txt b/licenses-binary/LICENSE-vis.txt deleted file mode 100644 index 18b7323..0000000 --- a/licenses-binary/LICENSE-vis.txt +++ /dev/null @@ -1,22 +0,0 @@ -vis.js -https://github.com/almende/vis - -A dynamic, browser-based visualization library. - -@version 4.16.1 -@date 2016-04-18 - -@license -Copyright (C) 2011-2016 Almende B.V, http://almende.com - -Vis.js is dual licensed under both - -* The Apache 2.0 License - http://www.apache.org/licenses/LICENSE-2.0 - -and - -* The MIT License - http://opensource.org/licenses/MIT - -Vis.js may be distributed under either license. \ No newline at end of file diff --git a/licenses/LICENSE-vis-timeline.txt b/licenses/LICENSE-vis-timeline.txt new file mode 100644 index 0000000..d343783 --- /dev/null +++ b/licenses/LICENSE-vis-timeline.txt @@ -0,0 +1,23 @@ +vis-timeline and vis-graph2d +https://visjs.github.io/vis-timeline/ + +Create a fully customizable, interactive timeline with items and ranges. + +@version 7.3.4 +@date 2020-03-18T17:03:58.105Z + +@copyright (c) 2011-2017 Almende B.V, http://almende.com +@copyright (c) 2017-2019 visjs contributors, https://github.com/visjs + +@license +vis.js is dual licensed under both + + 1. The Apache 2.0 License + http://www.apache.org/licenses/LICENSE-2.0 + + and + + 2. The MIT License + http://opensource.org/licenses/MIT + +vis.js may be distributed under either license. diff --git a/licenses/LICENSE-vis.txt b/licenses/LICENSE-vis.txt deleted file mode 100644 index 18b7323..0000000 --- a/licenses/LICENSE-vis.txt +++ /dev/null @@ -1,22 +0,0 @@ -vis.js -https://github.com/almende/vis - -A dynamic, browser-based visualization library. - -@version 4.16.1 -@date 2016-04-18 - -@license -Copyright (C) 2011-2016 Almende B.V, http://almende.com - -Vis.js is dual licensed under both - -* The Apache 2.0 License - http://www.apache.org/licenses/LICENSE-2.0 - -and - -* The MIT License - http://opensource.org/licenses/MIT - -Vis.js may be distributed under either license. \ No newline at end of file --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org