Skip to content

fix(data-analysis): charts update functionality and extras update#3614

Merged
zdrawku merged 1 commit intomasterfrom
dTsvekov/fix-data-analysis-sample-master
Feb 28, 2025
Merged

fix(data-analysis): charts update functionality and extras update#3614
zdrawku merged 1 commit intomasterfrom
dTsvekov/fix-data-analysis-sample-master

Conversation

@dobromirts
Copy link
Copy Markdown
Contributor

Related to #3599

@zdrawku zdrawku merged commit a8fb886 into master Feb 28, 2025
6 of 7 checks passed
@zdrawku zdrawku deleted the dTsvekov/fix-data-analysis-sample-master branch February 28, 2025 15:34
this.selectedCharts[c] = this.chartIntegration.chartFactory(c, null, this.selectedCharts[c]);
} else {
chartHost.viewContainerRef.clear();
this.selectedCharts[c] = this.chartIntegration.chartFactory(c, chartHost.viewContainerRef);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Export the this.selectedCharts[c] into a constant. This is the third usage in few lines.

}

public createChartCommonLogic() {
if (Object.keys(this.selectedCharts).length !== 0) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This if is not needed.
Together with the settimeout on next line brings unnecessary complexity that is not even understandable why the code is like this.

Drop the if and document the setTimeout usage.

this.chartIntegration.disableCharts(this.allCharts);
} else {
args.chartsAvailability.forEach((isAvailable, chart) => {
if (args.chartsForCreation.indexOf(chart) === -1) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

That's just style preference - maybe includes would be easier to read.

} else {
args.chartsAvailability.forEach((isAvailable, chart) => {
if (args.chartsForCreation.indexOf(chart) === -1) {
this.chartIntegration.disableCharts([chart]);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Am not sure what is the implementation of disable/enableCharts function in chartIntegration package. Possibly it would be more effective and concise, if the method is called once for all charts to enable/disable.

(click)="createChart(chart)"
title="{{chart}}"
[ngClass]="{'disabled': allCharts.indexOf(chart) === -1, 'selected': chart | hastDuplicateLayouts: dock.layout: selectedCharts}"
[ngClass]="{'disabled': availableCharts.indexOf(chart) === -1, 'selected': chart | hastDuplicateLayouts: dock.layout: selectedCharts}"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Possibly use includes, better readibility in the template

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants