natsuokawai commented on code in PR #21390:
URL: https://github.com/apache/echarts/pull/21390#discussion_r2596107619
##########
src/component/matrix/MatrixView.ts:
##########
@@ -339,26 +345,41 @@ function createMatrixCell(
}
// Set silent
+ const triggerEvent = matrixModel.get('triggerEvent');
if (cellText) {
let labelSilent = _tmpCellLabelModel.get('silent');
- // auto, tooltip of text cells need silient: false, but non-text cells
- // do not need a special cursor in most cases.
+ // By default, silent: false is needed for triggerEvent or tooltip
interaction.
if (labelSilent == null) {
- labelSilent = !tooltipOptionShow;
+ labelSilent = !(triggerEvent || tooltipOptionShow);
}
cellText.silent = labelSilent;
cellText.ignoreHostSilent = true;
}
let rectSilent = _tmpCellModel.get('silent');
if (rectSilent == null) {
- rectSilent = (
- // If no background color in cell, set `rect.silent: false` will
cause that only
- // the border response to mouse hovering, which is probably weird.
+ // If no background color in cell, set `rect.silent: false` will cause
that only
+ // the border response to mouse hovering, which is probably weird.
+ rectSilent = !(triggerEvent || tooltipOptionShow) || (
!cellRect.style || cellRect.style.fill === 'none' ||
!cellRect.style.fill
);
}
cellRect.silent = rectSilent;
+ if (triggerEvent) {
+ const eventData = {
+ componentType: 'matrix' as const,
+ componentIndex: matrixModel.componentIndex,
+ matrixIndex: matrixModel.componentIndex,
+ targetType: targetType,
+ name: textValue != null ? textValue + '' : null,
+ coord: xyLocator.slice()
+ };
+ getECData(cellRect).eventData = eventData;
Review Comment:
@Ovilia
Sorry, you're right. I've removed the eventData from cellRect. Fixed in
1a12a50
##########
src/component/matrix/MatrixView.ts:
##########
@@ -339,26 +345,41 @@ function createMatrixCell(
}
// Set silent
+ const triggerEvent = matrixModel.get('triggerEvent');
if (cellText) {
let labelSilent = _tmpCellLabelModel.get('silent');
- // auto, tooltip of text cells need silient: false, but non-text cells
- // do not need a special cursor in most cases.
+ // By default, silent: false is needed for triggerEvent or tooltip
interaction.
if (labelSilent == null) {
- labelSilent = !tooltipOptionShow;
+ labelSilent = !(triggerEvent || tooltipOptionShow);
}
cellText.silent = labelSilent;
cellText.ignoreHostSilent = true;
}
let rectSilent = _tmpCellModel.get('silent');
if (rectSilent == null) {
- rectSilent = (
- // If no background color in cell, set `rect.silent: false` will
cause that only
- // the border response to mouse hovering, which is probably weird.
+ // If no background color in cell, set `rect.silent: false` will cause
that only
+ // the border response to mouse hovering, which is probably weird.
+ rectSilent = !(triggerEvent || tooltipOptionShow) || (
!cellRect.style || cellRect.style.fill === 'none' ||
!cellRect.style.fill
);
}
cellRect.silent = rectSilent;
+ if (triggerEvent) {
+ const eventData = {
+ componentType: 'matrix' as const,
+ componentIndex: matrixModel.componentIndex,
+ matrixIndex: matrixModel.componentIndex,
+ targetType: targetType,
+ name: textValue != null ? textValue + '' : null,
+ coord: xyLocator.slice()
+ };
+ getECData(cellRect).eventData = eventData;
Review Comment:
@Ovilia
Sorry, you're right. I've removed the eventData from cellRect. Fixed in
1a12a50
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]