@inb/oeb_visualizations 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +11 -0
- package/README.md +3 -0
- package/dist/oeb-visualizations.esm.js +1 -0
- package/dist/oeb-visualizations.min.js +1 -0
- package/dist/oeb-visualizations.umd.js +1 -0
- package/package.json +54 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Released under MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2013 Mark Otto.
|
|
4
|
+
|
|
5
|
+
Copyright (c) 2017 Andrew Fong.
|
|
6
|
+
|
|
7
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
8
|
+
|
|
9
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
10
|
+
|
|
11
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function normalizeComponent(e,t,r,a,n,i,o,s,l,u){"boolean"!=typeof o&&(l=s,s=o,o=!1);var c="function"==typeof r?r.options:r;e&&e.render&&(c.render=e.render,c.staticRenderFns=e.staticRenderFns,c._compiled=!0,n&&(c.functional=!0)),a&&(c._scopeId=a);var _;if(i?(_=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,l(e)),e&&e._registeredComponents&&e._registeredComponents.add(i)},c._ssrRegister=_):t&&(_=o?function(){t.call(this,u(this.$root.$options.shadowRoot))}:function(e){t.call(this,s(e))}),_)if(c.functional){var d=c.render;c.render=function(e,t){return _.call(t),d(e,t)}}else{var p=c.beforeCreate;c.beforeCreate=p?[].concat(p,_):[_]}return r}import Plotly from"plotly.js-dist";for(var moment=require("moment"),dates=[],i=0;i<30;i++){var date=moment().add(i,"days").format("YYYY-MM-DD");dates.push(date)}dates.sort(function(e,t){return e.localeCompare(t)}),console.log(dates);for(var numbers=[],status=[],i$1=0;i$1<30;i$1++){var number=Math.floor(81*Math.random())+20;number>30&&number<90?status.push("up"):number>=90?(status.push("NA"),number=null):(status.push("down"),number=null),numbers.push(number)}var data={date:dates,uptime:numbers,status:status},script={name:"accessibilityPlot",mounted:function(){var e=this.buildTimeTraces(data);e=e.concat(this.buildBarTraces(data));var t=data.uptime.filter(function(e){return null!==e}),r=t.reduce(function(e,t){return e+t},0)/t.length,a=new Date(data.date[0]);a.setDate(a.getDate()-1);var n=new Date(data.date[data.date.length-1]);n.setDate(n.getDate()+1),console.log(r);var i={x:[a,n],y:[r,r],name:"Average access time",showlegend:!0,mode:"lines",type:"scatter",line:{color:"rgba(111, 176, 129,.6)",width:1.5,dash:"4px"},marker:{size:5}};e.push(i);var o={bargap:0,barmode:"stack",showlegend:!0,autosize:!0,height:400,margin:{l:50,r:50,b:70,t:70,pad:4},xaxis:{type:"date",font:{size:8},tickfont:{size:8},tickmode:"linear",tick0:Math.min(data.x),dtick:2592e5,tickangle:45,tickformat:"%d %b",ticklabelmode:"period"},yaxis:{title:"Access time (ms)",titlefont:{size:10},tickfont:{size:8}},template:"plotly_white",legend:{orientation:"h",yanchor:"bottom",y:1.02,xanchor:"right",x:1,font:{size:8}}};Plotly.newPlot("plot",e,o)},methods:{generateColor:function(e,t){for(var r=[],a=0;a<30;a++)switch(e[a]){case"up":r.push("rgba(218, 247, 223,0)");break;case"down":r.push("rgba(255, 153, 145,"+t+")");break;case"NA":r.push("rgba(204,204,204,"+t+")")}return console.log(r),r},extractSubarraysBetweenNullValues:function(e){for(var t=[],r=[],a=[],n=[],i=0;i<e.uptime.length;i++)null===e.uptime[i]?a.length>0&&(t.push(a),r.push(n),a=[],n=[]):(a.push(e.uptime[i]),n.push(e.date[i]));return a.length>0&&(t.push(a),r.push(n)),{uptime:t,date:r}},buildTimeTraces:function(e){for(var t=this.extractSubarraysBetweenNullValues(e),r=[],a=0;a<t.uptime.length;a++){var n=t.uptime[a],i={x:t.date[a],y:n,name:"Online",legendgroup:"up",showlegend:0===a,mode:"markers+lines",type:"scatter",fill:"tozeroy",fillcolor:"rgba(218, 247, 223,.4)",connectgaps:!1,line:{color:"rgba(111, 176, 129,.8)",width:1.5},marker:{size:5}};r.push(i)}return r},extractSubarraysOfNullValues:function(e,t){for(var r=[],a=0;a<e.uptime.length;a++)null===e.uptime[a]&&e.status[a]===t&&r.push(e.date[a]);return r},buildBarTraces:function(e){var t=[],r=this.extractSubarraysOfNullValues(e,"down");console.log(r);var a=Array(r.length).fill(2).concat(Array(r.length).fill(120)),n=Array(r.length).fill("rgba(255, 153, 145,.8)").concat(Array(r.length).fill("rgba(255, 153, 145,.2)"));r=r.concat(r);var i=this.extractSubarraysOfNullValues(e,"NA"),o=Array(i.length).fill(2).concat(Array(i.length).fill(120)),s=Array(i.length).fill("rgba(204,204,204,.8)").concat(Array(i.length).fill("rgba(204,204,204,.2)"));i=i.concat(i);var l={x:r,y:a,marker:{color:n},name:"Offline",type:"bar"};t.push(l);var u={x:i,y:o,marker:{color:s},name:"No information captured",type:"bar"};return t.push(u),t}}},normalizeComponent_1=normalizeComponent,__vue_script__=script,__vue_render__=function(){var e=this,t=e.$createElement;return(e._self._c||t)("div",{attrs:{id:"plot"}})},__vue_staticRenderFns__=[],__vue_inject_styles__=void 0,__vue_scope_id__=void 0,__vue_module_identifier__=void 0,__vue_is_functional_template__=!1,accessibilityPlot=normalizeComponent_1({render:__vue_render__,staticRenderFns:__vue_staticRenderFns__},__vue_inject_styles__,__vue_script__,__vue_scope_id__,__vue_is_functional_template__,__vue_module_identifier__,void 0,void 0);export{accessibilityPlot};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var oeb_visualizations=function(e,t){"use strict";function r(e,t,r,a,n,o,i,l,s,u){"boolean"!=typeof i&&(s=l,l=i,i=!1);var c="function"==typeof r?r.options:r;e&&e.render&&(c.render=e.render,c.staticRenderFns=e.staticRenderFns,c._compiled=!0,n&&(c.functional=!0)),a&&(c._scopeId=a);var d;if(o?(d=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,s(e)),e&&e._registeredComponents&&e._registeredComponents.add(o)},c._ssrRegister=d):t&&(d=i?function(){t.call(this,u(this.$root.$options.shadowRoot))}:function(e){t.call(this,l(e))}),d)if(c.functional){var h=c.render;c.render=function(e,t){return d.call(t),h(e,t)}}else{var p=c.beforeCreate;c.beforeCreate=p?[].concat(p,d):[d]}return r}t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t;for(var a=require("moment"),n=[],o=0;o<30;o++){var i=a().add(o,"days").format("YYYY-MM-DD");n.push(i)}n.sort(function(e,t){return e.localeCompare(t)}),console.log(n);for(var l=[],s=[],u=0;u<30;u++){var c=Math.floor(81*Math.random())+20;c>30&&c<90?s.push("up"):c>=90?(s.push("NA"),c=null):(s.push("down"),c=null),l.push(c)}var d={date:n,uptime:l,status:s},h=r({render:function(){var e=this,t=e.$createElement;return(e._self._c||t)("div",{attrs:{id:"plot"}})},staticRenderFns:[]},void 0,{name:"accessibilityPlot",mounted:function(){var e=this.buildTimeTraces(d);e=e.concat(this.buildBarTraces(d));var r=d.uptime.filter(function(e){return null!==e}),a=r.reduce(function(e,t){return e+t},0)/r.length,n=new Date(d.date[0]);n.setDate(n.getDate()-1);var o=new Date(d.date[d.date.length-1]);o.setDate(o.getDate()+1),console.log(a);var i={x:[n,o],y:[a,a],name:"Average access time",showlegend:!0,mode:"lines",type:"scatter",line:{color:"rgba(111, 176, 129,.6)",width:1.5,dash:"4px"},marker:{size:5}};e.push(i);var l={bargap:0,barmode:"stack",showlegend:!0,autosize:!0,height:400,margin:{l:50,r:50,b:70,t:70,pad:4},xaxis:{type:"date",font:{size:8},tickfont:{size:8},tickmode:"linear",tick0:Math.min(d.x),dtick:2592e5,tickangle:45,tickformat:"%d %b",ticklabelmode:"period"},yaxis:{title:"Access time (ms)",titlefont:{size:10},tickfont:{size:8}},template:"plotly_white",legend:{orientation:"h",yanchor:"bottom",y:1.02,xanchor:"right",x:1,font:{size:8}}};t.newPlot("plot",e,l)},methods:{generateColor:function(e,t){for(var r=[],a=0;a<30;a++)switch(e[a]){case"up":r.push("rgba(218, 247, 223,0)");break;case"down":r.push("rgba(255, 153, 145,"+t+")");break;case"NA":r.push("rgba(204,204,204,"+t+")")}return console.log(r),r},extractSubarraysBetweenNullValues:function(e){for(var t=[],r=[],a=[],n=[],o=0;o<e.uptime.length;o++)null===e.uptime[o]?a.length>0&&(t.push(a),r.push(n),a=[],n=[]):(a.push(e.uptime[o]),n.push(e.date[o]));return a.length>0&&(t.push(a),r.push(n)),{uptime:t,date:r}},buildTimeTraces:function(e){for(var t=this.extractSubarraysBetweenNullValues(e),r=[],a=0;a<t.uptime.length;a++){var n=t.uptime[a],o={x:t.date[a],y:n,name:"Online",legendgroup:"up",showlegend:0===a,mode:"markers+lines",type:"scatter",fill:"tozeroy",fillcolor:"rgba(218, 247, 223,.4)",connectgaps:!1,line:{color:"rgba(111, 176, 129,.8)",width:1.5},marker:{size:5}};r.push(o)}return r},extractSubarraysOfNullValues:function(e,t){for(var r=[],a=0;a<e.uptime.length;a++)null===e.uptime[a]&&e.status[a]===t&&r.push(e.date[a]);return r},buildBarTraces:function(e){var t=[],r=this.extractSubarraysOfNullValues(e,"down");console.log(r);var a=Array(r.length).fill(2).concat(Array(r.length).fill(120)),n=Array(r.length).fill("rgba(255, 153, 145,.8)").concat(Array(r.length).fill("rgba(255, 153, 145,.2)"));r=r.concat(r);var o=this.extractSubarraysOfNullValues(e,"NA"),i=Array(o.length).fill(2).concat(Array(o.length).fill(120)),l=Array(o.length).fill("rgba(204,204,204,.8)").concat(Array(o.length).fill("rgba(204,204,204,.2)"));o=o.concat(o);var s={x:r,y:a,marker:{color:n},name:"Offline",type:"bar"};t.push(s);var u={x:o,y:i,marker:{color:l},name:"No information captured",type:"bar"};return t.push(u),t}}},void 0,!1,void 0,void 0,void 0);return e.accessibilityPlot=h,e}({},Plotly);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("plotly.js-dist")):"function"==typeof define&&define.amd?define(["exports","plotly.js-dist"],t):(e=e||self,t(e.oeb_visualizations={},e.Plotly))}(this,function(e,t){"use strict";function r(e,t,r,a,n,o,i,l,s,u){"boolean"!=typeof i&&(s=l,l=i,i=!1);var c="function"==typeof r?r.options:r;e&&e.render&&(c.render=e.render,c.staticRenderFns=e.staticRenderFns,c._compiled=!0,n&&(c.functional=!0)),a&&(c._scopeId=a);var d;if(o?(d=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,s(e)),e&&e._registeredComponents&&e._registeredComponents.add(o)},c._ssrRegister=d):t&&(d=i?function(){t.call(this,u(this.$root.$options.shadowRoot))}:function(e){t.call(this,l(e))}),d)if(c.functional){var p=c.render;c.render=function(e,t){return d.call(t),p(e,t)}}else{var f=c.beforeCreate;c.beforeCreate=f?[].concat(f,d):[d]}return r}t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t;for(var a=require("moment"),n=[],o=0;o<30;o++){var i=a().add(o,"days").format("YYYY-MM-DD");n.push(i)}n.sort(function(e,t){return e.localeCompare(t)}),console.log(n);for(var l=[],s=[],u=0;u<30;u++){var c=Math.floor(81*Math.random())+20;c>30&&c<90?s.push("up"):c>=90?(s.push("NA"),c=null):(s.push("down"),c=null),l.push(c)}var d={date:n,uptime:l,status:s},p=r({render:function(){var e=this,t=e.$createElement;return(e._self._c||t)("div",{attrs:{id:"plot"}})},staticRenderFns:[]},void 0,{name:"accessibilityPlot",mounted:function(){var e=this.buildTimeTraces(d);e=e.concat(this.buildBarTraces(d));var r=d.uptime.filter(function(e){return null!==e}),a=r.reduce(function(e,t){return e+t},0)/r.length,n=new Date(d.date[0]);n.setDate(n.getDate()-1);var o=new Date(d.date[d.date.length-1]);o.setDate(o.getDate()+1),console.log(a);var i={x:[n,o],y:[a,a],name:"Average access time",showlegend:!0,mode:"lines",type:"scatter",line:{color:"rgba(111, 176, 129,.6)",width:1.5,dash:"4px"},marker:{size:5}};e.push(i);var l={bargap:0,barmode:"stack",showlegend:!0,autosize:!0,height:400,margin:{l:50,r:50,b:70,t:70,pad:4},xaxis:{type:"date",font:{size:8},tickfont:{size:8},tickmode:"linear",tick0:Math.min(d.x),dtick:2592e5,tickangle:45,tickformat:"%d %b",ticklabelmode:"period"},yaxis:{title:"Access time (ms)",titlefont:{size:10},tickfont:{size:8}},template:"plotly_white",legend:{orientation:"h",yanchor:"bottom",y:1.02,xanchor:"right",x:1,font:{size:8}}};t.newPlot("plot",e,l)},methods:{generateColor:function(e,t){for(var r=[],a=0;a<30;a++)switch(e[a]){case"up":r.push("rgba(218, 247, 223,0)");break;case"down":r.push("rgba(255, 153, 145,"+t+")");break;case"NA":r.push("rgba(204,204,204,"+t+")")}return console.log(r),r},extractSubarraysBetweenNullValues:function(e){for(var t=[],r=[],a=[],n=[],o=0;o<e.uptime.length;o++)null===e.uptime[o]?a.length>0&&(t.push(a),r.push(n),a=[],n=[]):(a.push(e.uptime[o]),n.push(e.date[o]));return a.length>0&&(t.push(a),r.push(n)),{uptime:t,date:r}},buildTimeTraces:function(e){for(var t=this.extractSubarraysBetweenNullValues(e),r=[],a=0;a<t.uptime.length;a++){var n=t.uptime[a],o={x:t.date[a],y:n,name:"Online",legendgroup:"up",showlegend:0===a,mode:"markers+lines",type:"scatter",fill:"tozeroy",fillcolor:"rgba(218, 247, 223,.4)",connectgaps:!1,line:{color:"rgba(111, 176, 129,.8)",width:1.5},marker:{size:5}};r.push(o)}return r},extractSubarraysOfNullValues:function(e,t){for(var r=[],a=0;a<e.uptime.length;a++)null===e.uptime[a]&&e.status[a]===t&&r.push(e.date[a]);return r},buildBarTraces:function(e){var t=[],r=this.extractSubarraysOfNullValues(e,"down");console.log(r);var a=Array(r.length).fill(2).concat(Array(r.length).fill(120)),n=Array(r.length).fill("rgba(255, 153, 145,.8)").concat(Array(r.length).fill("rgba(255, 153, 145,.2)"));r=r.concat(r);var o=this.extractSubarraysOfNullValues(e,"NA"),i=Array(o.length).fill(2).concat(Array(o.length).fill(120)),l=Array(o.length).fill("rgba(204,204,204,.8)").concat(Array(o.length).fill("rgba(204,204,204,.2)"));o=o.concat(o);var s={x:r,y:a,marker:{color:n},name:"Offline",type:"bar"};t.push(s);var u={x:o,y:i,marker:{color:l},name:"No information captured",type:"bar"};return t.push(u),t}}},void 0,!1,void 0,void 0,void 0);e.accessibilityPlot=p,Object.defineProperty(e,"__esModule",{value:!0})});
|
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@inb/oeb_visualizations",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Collection of Vue components for data visualization in OpenEBench.",
|
|
5
|
+
"author": "evamart",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"vue",
|
|
9
|
+
"nuxt",
|
|
10
|
+
"plotly"
|
|
11
|
+
],
|
|
12
|
+
"homepage": "https://github.com/inab/oeb-visualizations#readme",
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/inab/oeb-visualizations.git"
|
|
16
|
+
},
|
|
17
|
+
"main": "dist/oeb-visualizations.umd.js",
|
|
18
|
+
"module": "dist/oeb-visualizations.esm.js",
|
|
19
|
+
"unpkg": "dist/oeb-visualizations.min.js",
|
|
20
|
+
"browser": {
|
|
21
|
+
"./sfc": "src/oeb-visualizations.vue"
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"dist/*"
|
|
25
|
+
],
|
|
26
|
+
"vetur": {
|
|
27
|
+
"tags": "tags.json",
|
|
28
|
+
"attributes": "attributes.json"
|
|
29
|
+
},
|
|
30
|
+
"scripts": {
|
|
31
|
+
"build": "npm run build:unpkg & npm run build:es & npm run build:umd",
|
|
32
|
+
"build:umd": "rollup --config build/rollup.config.js --format umd --file dist/oeb-visualizations.umd.js",
|
|
33
|
+
"build:es": "rollup --config build/rollup.config.js --format es --file dist/oeb-visualizations.esm.js",
|
|
34
|
+
"build:unpkg": "rollup --config build/rollup.config.js --format iife --file dist/oeb-visualizations.min.js"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"moment": "^2.29.4",
|
|
38
|
+
"plotly.js-dist": "^2.27.1",
|
|
39
|
+
"vue": "^2.6.10"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"minimist": "^1.2.0",
|
|
43
|
+
"rollup": "^1.14.4",
|
|
44
|
+
"rollup-plugin-buble": "^0.19.6",
|
|
45
|
+
"rollup-plugin-commonjs": "^9.3.4",
|
|
46
|
+
"rollup-plugin-replace": "^2.2.0",
|
|
47
|
+
"rollup-plugin-uglify-es": "0.0.1",
|
|
48
|
+
"rollup-plugin-vue": "^4.7.2",
|
|
49
|
+
"vue-template-compiler": "^2.6.10"
|
|
50
|
+
},
|
|
51
|
+
"bugs": {
|
|
52
|
+
"url": "https://github.com/inab/oeb-visualizations/issues"
|
|
53
|
+
}
|
|
54
|
+
}
|