@datarailsshared/dr_renderer 1.2.351 → 1.2.355
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/package.json
CHANGED
@@ -144,7 +144,6 @@ const FEATURES = {
|
|
144
144
|
ENABLE_SERVER_TOTALS_CALCULATION: 'enable_server_totals_calculation',
|
145
145
|
FORMAT_AXIS: 'use_default_table_format_for_axis',
|
146
146
|
FORMAT_DATES_AS_OTHER_AXIS_TYPES: 'format_dates_as_other_axis_types',
|
147
|
-
DASHBOARD_INSIGHT_TOOLTIP_RELATIVE_POSITION: 'dashboard_insight_tooltip_relative_position',
|
148
147
|
MULTIPLE_DIMENSION_TAGS: 'multiple_dimension_tags',
|
149
148
|
USE_NEW_SCENARIO_TAG: 'use_new_scenario_tag',
|
150
149
|
}
|
@@ -168,6 +167,19 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
168
167
|
}
|
169
168
|
}
|
170
169
|
|
170
|
+
// remove highcharts tooltip from the dom instead of hiding if option is passed
|
171
|
+
Highcharts.wrap(Highcharts.Tooltip.prototype, 'hide', function(proceed, delay) {
|
172
|
+
if (!this.options.destroyWhenHiding) {
|
173
|
+
proceed.call(this, delay);
|
174
|
+
} else {
|
175
|
+
Highcharts.clearTimeout(this.hideTimer);
|
176
|
+
delay = Highcharts.pick(delay, this.options.hideDelay);
|
177
|
+
this.hideTimer = Highcharts.syncTimeout(() => {
|
178
|
+
this.destroy();
|
179
|
+
}, delay);
|
180
|
+
}
|
181
|
+
});
|
182
|
+
|
171
183
|
if(!moment_lib){
|
172
184
|
moment_lib = moment;
|
173
185
|
}
|
@@ -179,7 +191,6 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
179
191
|
|
180
192
|
highchartsRenderer.useTotalsCalculation = false;
|
181
193
|
highchartsRenderer.enabledNewWidgetValueFormatting = false;
|
182
|
-
highchartsRenderer.relativePositionForInsightTooltips = false;
|
183
194
|
let disableAnimation = false;
|
184
195
|
|
185
196
|
highchartsRenderer.hasFeature = function(featureFlagKey) {
|
@@ -190,7 +201,6 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
190
201
|
highchartsRenderer.useTotalsCalculation = highchartsRenderer.hasFeature(FEATURES.ENABLE_SERVER_TOTALS_CALCULATION);
|
191
202
|
disableAnimation = document.ReportHippo.user.organization && document.ReportHippo.user.organization.settings && document.ReportHippo.user.organization.settings.disable_animation
|
192
203
|
highchartsRenderer.enabledNewWidgetValueFormatting = highchartsRenderer.hasFeature(FEATURES.ENABLE_NEW_WIDGET_VALUE_FORMATTING);
|
193
|
-
highchartsRenderer.relativePositionForInsightTooltips = highchartsRenderer.hasFeature(FEATURES.DASHBOARD_INSIGHT_TOOLTIP_RELATIVE_POSITION);
|
194
204
|
}
|
195
205
|
|
196
206
|
// fix issue of use tootip.stickOnContact with tooltip.outside , source: https://github.com/highcharts/highcharts/pull/15960
|
@@ -695,7 +705,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
695
705
|
highchartsRenderer.customFormatterTooltipInsights = function(pivotData, opts) {
|
696
706
|
return {
|
697
707
|
useHTML: true,
|
698
|
-
outside:
|
708
|
+
outside: true,
|
699
709
|
backgroundColor: 'transparent',
|
700
710
|
borderWidth: 0,
|
701
711
|
borderRadius: 0,
|
@@ -704,6 +714,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
704
714
|
padding: 0,
|
705
715
|
stickOnContact: true,
|
706
716
|
hideDelay: 1500,
|
717
|
+
destroyWhenHiding: true,
|
707
718
|
formatter: function () {
|
708
719
|
const rowKey = pivotData.rowAttrs.length ? lodash.get(this.point, 'series.name') || "" : "";
|
709
720
|
const colKey = lodash.get(this.point, 'name') || this.x.name[0] || "";
|
@@ -36,7 +36,9 @@ describe('highcharts_renderer', () => {
|
|
36
36
|
opt: {},
|
37
37
|
setOptions: function(value) {Highcharts.opt = value;},
|
38
38
|
numberFormat: function(value) { return value ;},
|
39
|
-
getOptions: function() { return Highcharts.opt; }
|
39
|
+
getOptions: function() { return Highcharts.opt; },
|
40
|
+
Tooltip: {},
|
41
|
+
wrap: () => {},
|
40
42
|
};
|
41
43
|
_window.DataFormatter = DataFormatter;
|
42
44
|
initPivotTable($, _window, _document);
|