@carbon/charts-vue 1.6.1 → 1.6.2
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/CHANGELOG.md +8 -0
- package/charts-vue.common.js +19 -8
- package/charts-vue.common.js.map +1 -1
- package/charts-vue.umd.js +19 -8
- package/charts-vue.umd.js.map +1 -1
- package/charts-vue.umd.min.js +1 -1
- package/charts-vue.umd.min.js.map +1 -1
- package/package.json +2 -2
package/charts-vue.umd.js
CHANGED
|
@@ -20765,7 +20765,6 @@ var legend_Legend = /** @class */ (function (_super) {
|
|
|
20765
20765
|
var truncationThreshold = tools_Tools.getProperty(truncationOptions, 'threshold');
|
|
20766
20766
|
var truncationNumCharacter = tools_Tools.getProperty(truncationOptions, 'numCharacter');
|
|
20767
20767
|
var addedLegendItemsText = svg.selectAll('div.legend-item p');
|
|
20768
|
-
var self = this;
|
|
20769
20768
|
// Add an ID for the checkbox to use through `aria-labelledby`
|
|
20770
20769
|
addedLegendItemsText.attr('id', function (d, i) {
|
|
20771
20770
|
var elementToReference = this.parentNode.querySelector('div.checkbox') ||
|
|
@@ -20792,7 +20791,7 @@ var legend_Legend = /** @class */ (function (_super) {
|
|
|
20792
20791
|
var svg = this.getComponentContainer();
|
|
20793
20792
|
var options = this.getOptions();
|
|
20794
20793
|
var legendOptions = tools_Tools.getProperty(options, 'legend');
|
|
20795
|
-
var
|
|
20794
|
+
var truncation = tools_Tools.getProperty(legendOptions, 'truncation');
|
|
20796
20795
|
svg.selectAll('div.legend-item')
|
|
20797
20796
|
.on('mouseover', function (event) {
|
|
20798
20797
|
self.services.events.dispatchEvent(Events.Legend.ITEM_HOVER, {
|
|
@@ -20800,8 +20799,10 @@ var legend_Legend = /** @class */ (function (_super) {
|
|
|
20800
20799
|
});
|
|
20801
20800
|
var hoveredItem = src_select(this);
|
|
20802
20801
|
hoveredItem.select('div.checkbox').classed('hovered', true);
|
|
20802
|
+
// Show tooltip if character length is greater than threshold & there is no truncation
|
|
20803
20803
|
var hoveredItemData = hoveredItem.datum();
|
|
20804
|
-
if (hoveredItemData.name.length >
|
|
20804
|
+
if (hoveredItemData.name.length > truncation.threshold &&
|
|
20805
|
+
truncation.type !== TruncationTypes.NONE) {
|
|
20805
20806
|
self.services.events.dispatchEvent(Events.Tooltip.SHOW, {
|
|
20806
20807
|
event: event,
|
|
20807
20808
|
hoveredElement: hoveredItem,
|
|
@@ -20810,9 +20811,14 @@ var legend_Legend = /** @class */ (function (_super) {
|
|
|
20810
20811
|
}
|
|
20811
20812
|
})
|
|
20812
20813
|
.on('mousemove', function (event) {
|
|
20813
|
-
|
|
20814
|
-
|
|
20815
|
-
|
|
20814
|
+
// Emit tooltip move event only if tooltip is shown
|
|
20815
|
+
var hoveredItemData = src_select(this).datum();
|
|
20816
|
+
if (hoveredItemData.name.length > truncation.threshold &&
|
|
20817
|
+
truncation.type !== TruncationTypes.NONE) {
|
|
20818
|
+
self.services.events.dispatchEvent(Events.Tooltip.MOVE, {
|
|
20819
|
+
event: event,
|
|
20820
|
+
});
|
|
20821
|
+
}
|
|
20816
20822
|
})
|
|
20817
20823
|
.on('click', function () {
|
|
20818
20824
|
self.services.events.dispatchEvent(Events.Legend.ITEM_CLICK, {
|
|
@@ -20825,7 +20831,12 @@ var legend_Legend = /** @class */ (function (_super) {
|
|
|
20825
20831
|
.on('mouseout', function () {
|
|
20826
20832
|
var hoveredItem = src_select(this);
|
|
20827
20833
|
hoveredItem.select('div.checkbox').classed('hovered', false);
|
|
20828
|
-
|
|
20834
|
+
// Emit tooltip hide event only if tooltip is shown
|
|
20835
|
+
var hoveredItemData = hoveredItem.datum();
|
|
20836
|
+
if (hoveredItemData.name.length > truncation.threshold &&
|
|
20837
|
+
truncation.type !== TruncationTypes.NONE) {
|
|
20838
|
+
self.services.events.dispatchEvent(Events.Tooltip.HIDE);
|
|
20839
|
+
}
|
|
20829
20840
|
self.services.events.dispatchEvent(Events.Legend.ITEM_MOUSEOUT, {
|
|
20830
20841
|
hoveredElement: hoveredItem,
|
|
20831
20842
|
});
|
|
@@ -20853,7 +20864,7 @@ var legend_Legend = /** @class */ (function (_super) {
|
|
|
20853
20864
|
svg.selectAll('g.additional-item').on('mouseover', function (event) {
|
|
20854
20865
|
var hoveredItem = src_select(this);
|
|
20855
20866
|
var hoveredItemData = hoveredItem.datum();
|
|
20856
|
-
if (hoveredItemData.name.length >
|
|
20867
|
+
if (hoveredItemData.name.length > truncation.threshold) {
|
|
20857
20868
|
self.services.events.dispatchEvent(Events.Tooltip.SHOW, {
|
|
20858
20869
|
event: event,
|
|
20859
20870
|
hoveredElement: hoveredItem,
|