Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add fix for hover event #110

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions docs/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ source "https://rubygems.org"
#
# This will help ensure the proper Jekyll version is running.
# Happy Jekylling!
gem "jekyll", "~> 3.8.5"
gem "jekyll"

# This is the default theme for new Jekyll sites. You may change this to anything you like.
gem "minima", "~> 2.0"
gem "minima"

# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`.
Expand All @@ -28,3 +28,5 @@ gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby]
# Performance-booster for watching directories on Windows
gem "wdm", "~> 0.1.0" if Gem.win_platform?


gem "webrick", "~> 1.7"
70 changes: 39 additions & 31 deletions docs/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,69 +4,77 @@ GEM
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
colorator (1.1.0)
concurrent-ruby (1.1.9)
em-websocket (0.5.2)
concurrent-ruby (1.1.10)
em-websocket (0.5.3)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0.6.0)
http_parser.rb (~> 0)
eventmachine (1.2.7)
ffi (1.15.3)
ffi (1.15.5)
forwardable-extended (2.6.0)
http_parser.rb (0.6.0)
i18n (0.9.5)
http_parser.rb (0.8.0)
i18n (1.12.0)
concurrent-ruby (~> 1.0)
jekyll (3.8.7)
jekyll (4.2.2)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
i18n (~> 0.7)
jekyll-sass-converter (~> 1.0)
i18n (~> 1.0)
jekyll-sass-converter (~> 2.0)
jekyll-watch (~> 2.0)
kramdown (~> 1.14)
kramdown (~> 2.3)
kramdown-parser-gfm (~> 1.0)
liquid (~> 4.0)
mercenary (~> 0.3.3)
mercenary (~> 0.4.0)
pathutil (~> 0.9)
rouge (>= 1.7, < 4)
rouge (~> 3.0)
safe_yaml (~> 1.0)
jekyll-feed (0.13.0)
terminal-table (~> 2.0)
jekyll-feed (0.16.0)
jekyll (>= 3.7, < 5.0)
jekyll-sass-converter (1.5.2)
sass (~> 3.4)
jekyll-seo-tag (2.6.1)
jekyll (>= 3.3, < 5.0)
jekyll-sass-converter (2.2.0)
sassc (> 2.0.1, < 3.0)
jekyll-seo-tag (2.8.0)
jekyll (>= 3.8, < 5.0)
jekyll-watch (2.2.1)
listen (~> 3.0)
kramdown (1.17.0)
kramdown (2.4.0)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
liquid (4.0.3)
listen (3.5.0)
listen (3.7.1)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.3.6)
mercenary (0.4.0)
minima (2.5.1)
jekyll (>= 3.5, < 5.0)
jekyll-feed (~> 0.9)
jekyll-seo-tag (~> 2.1)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (4.0.6)
rb-fsevent (0.11.0)
public_suffix (4.0.7)
rb-fsevent (0.11.1)
rb-inotify (0.10.1)
ffi (~> 1.0)
rouge (3.26.0)
rexml (3.2.5)
rouge (3.29.0)
safe_yaml (1.0.5)
sass (3.7.4)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
sassc (2.4.0)
ffi (~> 1.9)
terminal-table (2.0.0)
unicode-display_width (~> 1.1, >= 1.1.1)
unicode-display_width (1.8.0)
webrick (1.7.0)

PLATFORMS
ruby

DEPENDENCIES
jekyll (~> 3.8.5)
jekyll
jekyll-feed (~> 0.6)
minima (~> 2.0)
minima
tzinfo-data
webrick (~> 1.7)

BUNDLED WITH
2.1.4
2.3.18
131 changes: 81 additions & 50 deletions docs/assets/scripts/hedwig-main.umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -7094,6 +7094,42 @@
transition.prototype.attrs = transition_attrs;
transition.prototype.styles = transition_styles;

function styleInject(css, ref) {
if ( ref === void 0 ) ref = {};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file needs to be uncommitted as it gets created when we build the application.

var insertAt = ref.insertAt;

if (!css || typeof document === 'undefined') { return; }

var head = document.head || document.getElementsByTagName('head')[0];
var style = document.createElement('style');
style.type = 'text/css';

if (insertAt === 'top') {
if (head.firstChild) {
head.insertBefore(style, head.firstChild);
} else {
head.appendChild(style);
}
} else {
head.appendChild(style);
}

if (style.styleSheet) {
style.styleSheet.cssText = css;
} else {
style.appendChild(document.createTextNode(css));
}
}

var css_248z = "div.tooltip {\n opacity: 0;\n position : absolute;\n text-align : center;\n padding:.3rem;\n font-family: \"Open Sans\", \"Roboto\", \"Helvetica Neue\", \"Helvetica\", \"Arial\", sans-serif;\n background:#EEEEEE;\n pointer-events:none;\n color:black;\n border-radius: 5px;\n}\n.color-box span {\n padding: 3px;\n padding-left: 5px;\n margin: 0px;\n margin-right: 5px;\n border-radius: 3px;\n }\n .color-box {\n padding: 4px;\n border-radius: 2px;\n }\n .paddingleft {\n padding-left: 1rem;\n }\n \n \n\n\n";
var stylesheet="div.tooltip {\n opacity: 0;\n position : absolute;\n text-align : center;\n padding:.3rem;\n font-family: \"Open Sans\", \"Roboto\", \"Helvetica Neue\", \"Helvetica\", \"Arial\", sans-serif;\n background:#EEEEEE;\n pointer-events:none;\n color:black;\n border-radius: 5px;\n}\n.color-box span {\n padding: 3px;\n padding-left: 5px;\n margin: 0px;\n margin-right: 5px;\n border-radius: 3px;\n }\n .color-box {\n padding: 4px;\n border-radius: 2px;\n }\n .paddingleft {\n padding-left: 1rem;\n }\n \n \n\n\n";
styleInject(css_248z);

var styleSheet = /*#__PURE__*/Object.freeze({
'default': css_248z,
stylesheet: stylesheet
});

class Utils {
/**
* Convert bytes to largest unit
Expand Down Expand Up @@ -7190,6 +7226,16 @@
}
}

static randomColor() {
var arr = [];

for (var i = 0; i <= 70; i++) {
arr.push("#" + ((1 << 24) * Math.random() | 0).toString(16));
}

return arr;
}

static roundUnitsValue(measurmentUnit, value) {
switch (measurmentUnit) {
case measurmentUnit === 'bytes':
Expand Down Expand Up @@ -7222,7 +7268,7 @@
case measurmentUnit === 'octets':
return this.roundOffValue(value) + ' ' + measurmentUnit;

case measurmentUnit == '%':
case measurmentUnit == 'percent':
return this.roundOffValue(value) + ' %';

default:
Expand All @@ -7232,42 +7278,6 @@

}

function styleInject(css, ref) {
if ( ref === void 0 ) ref = {};
var insertAt = ref.insertAt;

if (!css || typeof document === 'undefined') { return; }

var head = document.head || document.getElementsByTagName('head')[0];
var style = document.createElement('style');
style.type = 'text/css';

if (insertAt === 'top') {
if (head.firstChild) {
head.insertBefore(style, head.firstChild);
} else {
head.appendChild(style);
}
} else {
head.appendChild(style);
}

if (style.styleSheet) {
style.styleSheet.cssText = css;
} else {
style.appendChild(document.createTextNode(css));
}
}

var css_248z = "div.tooltip {\n opacity: 0;\n position : absolute;\n text-align : center;\n padding:.3rem;\n font-family: \"Open Sans\", \"Roboto\", \"Helvetica Neue\", \"Helvetica\", \"Arial\", sans-serif;\n background:#EEEEEE;\n pointer-events:none;\n color:black;\n border-radius: 5px;\n}\n.color-box span {\n padding: 3px;\n padding-left: 5px;\n margin: 0px;\n margin-right: 5px;\n border-radius: 3px;\n }\n .color-box {\n padding: 4px;\n border-radius: 2px;\n }\n .paddingleft {\n padding-left: 1rem;\n }\n \n \n\n\n";
var stylesheet="div.tooltip {\n opacity: 0;\n position : absolute;\n text-align : center;\n padding:.3rem;\n font-family: \"Open Sans\", \"Roboto\", \"Helvetica Neue\", \"Helvetica\", \"Arial\", sans-serif;\n background:#EEEEEE;\n pointer-events:none;\n color:black;\n border-radius: 5px;\n}\n.color-box span {\n padding: 3px;\n padding-left: 5px;\n margin: 0px;\n margin-right: 5px;\n border-radius: 3px;\n }\n .color-box {\n padding: 4px;\n border-radius: 2px;\n }\n .paddingleft {\n padding-left: 1rem;\n }\n \n \n\n\n";
styleInject(css_248z);

var styleSheet = /*#__PURE__*/Object.freeze({
'default': css_248z,
stylesheet: stylesheet
});

const spclCharRegx = /[&\/\\#, +()$~%.'":*?<>{}]/g;
/**
* @name LineGraph
Expand Down Expand Up @@ -7318,6 +7328,7 @@
return requestBody.map((item, i) => {
let pointsArray = [];
let group = Utils.findByProp(item.data, grouping);
let metric_name = item.data.metricName;
let valuesArray = Object.keys(item.data.values); // loop through each time property

for (const obj of valuesArray) {
Expand All @@ -7328,6 +7339,7 @@
}

return {
metric_name,
group,
datapoints: pointsArray,
color: this.lineColor[i]
Expand All @@ -7343,9 +7355,8 @@
getDataLineColor(colors) {
var arr = [];
var arrColor;
var defaults = new Defaults();
colors.split(',').map(value => arr.push(value));
arrColor = [...arr, ...defaults.schemeCategory10Color];
arrColor = [...arr, ...Utils.randomColor()];
this.lineColor.push.apply(this.lineColor, arrColor);
}
/**
Expand All @@ -7370,7 +7381,8 @@
var margin = JSON.parse(this.dataset.margin);
var height = parseInt(this.dataset.height);
var width = parseInt(this.dataset.width);
var unit = this.dataset.unit; // Create X time scale
var unit = this.dataset.unit;
if (unit === 'undefined') unit = ""; // Create X time scale

var xScale = time().domain(extent(Utils.maxTime(data))).range([0, width - margin.bottom]); // Create Y linear scale

Expand Down Expand Up @@ -7412,6 +7424,7 @@
}).each((d, i) => {
// loop through datapoints to fetch time and value to create tooltip hover events with value.
var toltipDat = {
metric_name: d.metric_name,
group: d.group,
color: d.color,
unit
Expand Down Expand Up @@ -7479,10 +7492,15 @@


setLegend(svg, height, data) {
var j = -1;
// These variables are used to create legends and also adjust distance between different legends
var j = 6;
var k = 12;
var l = -1;
var l = 6;
var m = 12;
var n = 18;
var o = 24;
var p = 18;
var q = 24;
var legend = svg.append("g").attrs({
"class": "legend",
'transform': `translate(0,${height - 40})`
Expand Down Expand Up @@ -7523,13 +7541,20 @@
}

if (i >= 6 && i < 12) {
j = j + 2;
return (i - j) * 20 + 30;
}

if (i >= 12 && i < 18) {
return (i - k) * 20 + 30;
}

if (i >= 18 && i < 24) {
return (i - p) * 20 + 30;
}

if (i >= 24 && i < 30) {
return (i - q) * 20 + 30;
}
},
"width": 10,
"height": 10
Expand Down Expand Up @@ -7569,25 +7594,31 @@
}

if (i >= 6 && i < 12) {
l = l + 2;
return (i - l) * 20 + 39;
}

if (i >= 12 && i < 18) {
return (i - m) * 20 + 39;
}

if (i >= 18 && i < 24) {
return (i - n) * 20 + 39;
}

if (i >= 24 && i < 30) {
return (i - o) * 20 + 39;
}
}
}).text(d => {
if (d.group) {
let spltdGro = d.group.split('/');
let nwgrp = spltdGro[spltdGro.length - 1];
let nwgrp = spltdGro[spltdGro.length - 1]; // taking Last part of legend if "/" exist

if (nwgrp.length >= 20) return nwgrp.substring(0, 20) + '...';else return nwgrp;
} else {
let spltdGro = this.dataset.field.split('/');
let nwgrp = spltdGro[spltdGro.length - 1];
if (nwgrp.length >= 20) return nwgrp.substring(0, 20) + '...';else {
return nwgrp;
}
if (nwgrp.length >= 20) return nwgrp.substring(0, 20) + '...';else return nwgrp;
}
}) // Legend text Click
.on('click', function (d, i) {
Expand Down Expand Up @@ -7640,7 +7671,7 @@
</tr>
<tr>
<td class="color-box">
<span style="background:${ttlD.color}"></span> ${ttlD.group}
<span style="background:${ttlD.color}"></span> ${ttlD.group || ttlD.metric_name}
</td>
<td class="color-box">
${Utils.roundUnitsValue(ttlD.unit, d.value)}
Expand All @@ -7654,7 +7685,7 @@
customElements.define('line-graph', LineGraph);

var unit$1 = {
percentage: "%",
percent: "%",
bytes: "b",
"packets/sec": "packets/s",
kilobytes: "kb",
Expand Down
Loading