Explorar o código

HUE-5074 [chart] Timeline tooltip can make the graph flicker

Enrico Berti %!s(int64=9) %!d(string=hai) anos
pai
achega
4a7dc796ae

+ 2 - 2
desktop/core/src/desktop/static/desktop/css/hue3.css

@@ -3106,7 +3106,7 @@ input[type='password']::-ms-reveal {
 }
 
 .ui-widget {
-  font-family: Arial, Helvetica, sans-serif;
+  font-family: Roboto,Arial,sans-serif;
   font-size: 1em;
 }
 
@@ -3118,7 +3118,7 @@ input[type='password']::-ms-reveal {
 .ui-widget select,
 .ui-widget textarea,
 .ui-widget button {
-  font-family: Arial, Helvetica, sans-serif;
+  font-family: Roboto,Arial,sans-serif;
   font-size: 1em;
 }
 

+ 14 - 0
desktop/core/src/desktop/static/desktop/css/nv.d3.css

@@ -55,3 +55,17 @@ svg:not(.leaflet-zoom-animated) {
   width: 100%;
   height: 100%
 }
+
+.nvtooltip {
+  font-family: Roboto,Arial,sans-serif;
+}
+
+.nvtooltip h3 {
+  line-height: 13px;
+  font-size: 13px;
+  font-weight: bold;
+}
+
+.nvtooltip p {
+  font-size: 12px;
+}

+ 1 - 1
desktop/core/src/desktop/static/desktop/js/hue.colors.js

@@ -123,7 +123,7 @@ var HueColors = {
     });
 
     // optimal visual sequence by contrasting colors
-    var sequence = ['blue-gray', 'pink', 'blue', 'lime', 'steel', 'purple', 'teal', 'red', 'orange', 'green'],
+    var sequence = ['blue', 'lime', 'blue-gray', 'pink', 'steel', 'purple', 'teal', 'red', 'orange', 'green'],
       wholeSpectrum = [],
       sequenceHalfLength = sequence.length / 2;
 

+ 1 - 1
desktop/core/src/desktop/static/desktop/js/hue.utils.js

@@ -117,7 +117,7 @@ Array.prototype.diff = function (a) {
   };
 
   hueUtils.html2text = function (value){
-    return $('<div/>').html(value).text();
+    return $('<div/>').html(value).text().replace(/\u00A0/g, ' ');
   };
 
   hueUtils.goFullScreen = function () {

+ 3 - 1
desktop/core/src/desktop/static/desktop/js/nv.d3.js

@@ -722,6 +722,7 @@ window.nv.tooltip.* also has various helper methods.
            pos[1] = pos[1] - parentContainer.scrollTop;
         }
         nv.tooltip.calcTooltipPosition(pos, gravity, dist, container);
+
   };
 
   //Looks up the ancestry of a DOM element, and returns the first NON-svg node.
@@ -820,6 +821,7 @@ window.nv.tooltip.* also has various helper methods.
                 top = pos[1] - height - dist;
                 var tLeft = tooltipLeft(container);
                 var tTop = tooltipTop(container);
+                windowWidth = nv.tooltip.findTotalOffsetLeft(container.parentElement, 0) + container.parentElement.scrollWidth;
                 if (tLeft < scrollLeft) left = scrollLeft + 5;
                 if (tLeft + width > windowWidth) left = left - width/2 + 5;
                 if (scrollTop > tTop) top = scrollTop;
@@ -836,7 +838,7 @@ window.nv.tooltip.* also has various helper methods.
             container.style.left = left+'px';
             container.style.top = Math.max(top, 0)+'px';
             container.style.opacity = 1;
-            container.style.position = 'absolute'; 
+            container.style.position = 'absolute';
 
             return container;
     };

+ 1 - 1
desktop/libs/notebook/src/notebook/templates/editor_components.mako

@@ -2745,7 +2745,7 @@ ${ hueIcons.symbols() }
           $(rawDatum.counts()).each(function (cnt, item) {
             _data.push({
               series: _plottedSerie,
-              x: new Date(moment(hueUtils.html2text(item[_idxLabel]).valueOf())),
+              x: new Date(moment(hueUtils.html2text(item[_idxLabel])).valueOf()),
               y: item[_idxValue] * 1,
               color: colors[_plottedSerie % colors.length],
               obj: item