Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove interactivity-utils #90

Open
wants to merge 21 commits into
base: dev
Choose a base branch
from
Open

Remove interactivity-utils #90

wants to merge 21 commits into from

Conversation

adiletelf
Copy link

No description provided.

.vscode/launch.json Outdated Show resolved Hide resolved
src/behavior.ts Outdated Show resolved Hide resolved
src/utils.ts Outdated Show resolved Hide resolved
src/utils.ts Outdated Show resolved Hide resolved
src/visual.ts Outdated Show resolved Hide resolved
src/behavior.ts Outdated Show resolved Hide resolved
src/visual.ts Outdated Show resolved Hide resolved
test/visualTest.ts Outdated Show resolved Hide resolved
test/visualTest.ts Outdated Show resolved Hide resolved
src/behavior.ts Outdated Show resolved Hide resolved
src/visual.ts Outdated Show resolved Hide resolved
Copy link

@AleksSavelev AleksSavelev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would also good not to only fix the tests, but to increase the coverage of the visual with new unit tests. You can start at least with parts that you've changed.

src/asterPlotColumns.ts Outdated Show resolved Hide resolved
src/behavior.ts Outdated
Comment on lines 142 to 149
this.options.legendItems.on("contextmenu", (event: MouseEvent, dataPoint: LegendDataPoint) => {
event.preventDefault();
event.stopPropagation();
this.selectionManager.showContextMenu(dataPoint.identity, {
x: event.clientX,
y: event.clientY
});
});

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can create a callback that gets the identity and event as params and call it here and on the lines 151 and 132

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you did it below with emptyContextMenu

Copy link
Author

@adiletelf adiletelf Dec 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The callback is the same for selections and outerline d3-selections, but the legendItems has a little different dataPoint. Identity is retrieved from dataPoint.identity for LegendDataPoint and dataPoint.data.identity for d3PieArcDatum<AsterDataPoint>.

Therefore, I created a callback for d3PieArcDatum as it's duplicated, but leave the callback for LegendDataPoint as it is.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is why I said that you can pass an identity instead of dataPoint, so it won't affect on it

src/services/asterPlotConverterService.ts Outdated Show resolved Hide resolved
src/services/dataRenderService.ts Outdated Show resolved Hide resolved
src/services/dataRenderService.ts Outdated Show resolved Hide resolved
src/visual.ts Outdated Show resolved Hide resolved
test/visualTest.ts Outdated Show resolved Hide resolved
src/visual.ts Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants