It is a very strange problem witch course if I hover over a Link.
As I looked at the onLinkMouseEnter, onLinkMouseLeave event and logging the variables all variables are looking good except for the var linkwhich becomes undefined?
actions.js
exports.onLinkMouseEnter = function (_a) {
var linkId = _a.linkId;
return function (chart) {
// Set the link to hover
var link = chart.links[linkId];
// Set the connected ports to hover
console.log(chart,linkId,link) // π
if (link.to.nodeId && link.to.portId) { // β error throw because of the undefined variable?
My console log reviled:
var chart:
var linkId: "9c55afc7-7047-41da-82e1-6927ab2a54f1"
var link: undefined
I made a workaround by checking the variable link if it is undefined, but I am still interested that the problem is.
actions.js
exports.onLinkMouseEnter = function (_a) {
var linkId = _a.linkId;
return function (chart) {
// Set the link to hover
var link = chart.links[linkId];
// Set the connected ports to hover
++ if(link !== undefined) {
if (link.to.nodeId && link.to.portId) {
if (chart.hovered.type !== 'link' || chart.hovered.id !== linkId) {
chart.hovered = {
type: 'link',
id: linkId,
};
}
}
++ }
return chart;
};
};
exports.onLinkMouseLeave = function (_a) {
var linkId = _a.linkId;
return function (chart) {
var link = chart.links[linkId];
// Set the connected ports to hover
++ if(link !== undefined) {
if (link.to.nodeId && link.to.portId) {
chart.hovered = {};
}
++ }
return chart;
};
};
It is a very strange problem witch course if I hover over a Link.![image](https://user-images.githubusercontent.com/10784826/94143860-aff3bc80-fe70-11ea-97a8-94ff8ec1ddc5.png)
As I looked at the
onLinkMouseEnter, onLinkMouseLeave
event and logging the variables all variables are looking good except for thevar link
which becomes undefined?actions.js
My console log reviled:
var chart
:var linkId
: "9c55afc7-7047-41da-82e1-6927ab2a54f1"var link
: undefinedI made a workaround by checking the variable link if it is undefined, but I am still interested that the problem is.
actions.js