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

Metrics Table #805

Merged
merged 16 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# Change Log

## [v26.0.0-beta.1](https://github.com/gisaia/ARLAS-wui-toolkit/tree/v26.0.0-beta.1) (2024-07-15)
## [v26.0.0-beta.2](https://github.com/gisaia/ARLAS-wui-toolkit/tree/v26.0.0-beta.2) (2024-07-18)

[Full Changelog](https://github.com/gisaia/ARLAS-wui-toolkit/compare/v25.1.2...v26.0.0-beta.2)

[Full Changelog](https://github.com/gisaia/ARLAS-wui-toolkit/compare/v25.1.2...v26.0.0-beta.1)
## [v25.1.2](https://github.com/gisaia/ARLAS-wui-toolkit/tree/v25.1.2) (2024-07-18)

## [v25.1.2](https://github.com/gisaia/ARLAS-wui-toolkit/tree/v25.1.2) (2024-07-12)
[Full Changelog](https://github.com/gisaia/ARLAS-wui-toolkit/compare/v26.0.0-beta.1...v25.1.2)

## [v26.0.0-beta.1](https://github.com/gisaia/ARLAS-wui-toolkit/tree/v26.0.0-beta.1) (2024-07-15)

[Full Changelog](https://github.com/gisaia/ARLAS-wui-toolkit/compare/v25.1.1...v25.1.2)
[Full Changelog](https://github.com/gisaia/ARLAS-wui-toolkit/compare/v25.1.1...v26.0.0-beta.1)

## [v25.1.1](https://github.com/gisaia/ARLAS-wui-toolkit/tree/v25.1.1) (2024-07-12)

Expand Down
46 changes: 23 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "arlas-wui-toolkit",
"version": "25.2.0-dev0",
"version": "26.1.0-dev0",
"description": "Tool Kit Library for ARLAS wui web App",
"author": "gisaia",
"license": "Apache-2.0",
Expand Down Expand Up @@ -43,9 +43,9 @@
"ajv-keywords": "5.1.0",
"angular-oauth2-oidc": "~14.0.1",
"angular-oauth2-oidc-jwks": "~14.0.1",
"arlas-iam-api": "25.0.0",
"arlas-permissions-api": "25.0.0",
"arlas-persistence-api": "25.0.0",
"arlas-iam-api": "26.0.0-rc.1",
"arlas-permissions-api": "26.0.0-rc.1",
"arlas-persistence-api": "26.0.0-rc.1",
"arlas-tagger-api": "25.0.0-beta.2",
"arlas-web-components": "26.0.0-rc.2",
"arlas-web-contributors": "26.0.0-rc.1",
Expand Down
8 changes: 4 additions & 4 deletions projects/arlas-toolkit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "arlas-wui-toolkit",
"version": "25.1.2",
"version": "26.0.0-beta.2",
"description": "Tool Kit Library for ARLAS wui web App",
"author": "gisaia",
"license": "Apache-2.0",
Expand Down Expand Up @@ -41,9 +41,9 @@
"ajv-keywords": "5.1.0",
"angular-oauth2-oidc": "~14.0.1",
"angular-oauth2-oidc-jwks": "~14.0.1",
"arlas-iam-api": "25.0.0",
"arlas-permissions-api": "25.0.0",
"arlas-persistence-api": "25.0.0",
"arlas-iam-api": "26.0.0-rc.1",
"arlas-permissions-api": "26.0.0-rc.1",
"arlas-persistence-api": "26.0.0-rc.1",
"arlas-tagger-api": "25.0.0-beta.2",
"arlas-web-components": "26.0.0-rc.2",
"arlas-web-contributors": "26.0.0-rc.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</section>
<div *ngIf="isOpen" class="separator"></div>
<section *ngIf="isOpen" class="content" [style.width.px]="titleWidth > shortcutWidth + 10 ? titleWidth - 10 : shortcutWidth">
<arlas-tool-widget
<arlas-tool-widget style="width:100%"
id="{{'shortcut-widget-' + shortcut.uuid}}"
[componentType]="shortcut.component.componentType"
[contributorId]="shortcut.component?.contributorId"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export class ShortcutFiltersHandlerComponent implements OnInit, OnDestroy {

if (this.labels.length > 0) {
this.firstLabel = this.labels[0];
if (this.widgetType === 'powerbars') {
if (this.widgetType === 'powerbars' || this.widgetType === 'metricstable') {
this.showMore = !this.displayFilterFirstValue || this.labels.length > 1;
/** hide list when there is one label left */
if (this.displayFilterFirstValue && this.labels.length <= 1) {
Expand Down Expand Up @@ -181,7 +181,7 @@ export class ShortcutFiltersHandlerComponent implements OnInit, OnDestroy {
private setLabels(widgetType: string, expression: Expression) {
this.rawLabels = expression.value.split(',');

if (widgetType === 'powerbars') {
if (widgetType === 'powerbars' || this.widgetType === 'metricstable') {
this.labels = expression.value.split(',');
if (expression.op === Expression.OpEnum.Ne) {
this.labels = this.labels.map(l => '≠' + l);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,19 @@

</arlas-metric>
</div>

<div *ngIf="componentType === 'metricstable'">
<arlas-metrics-table
[metricsTable]="contributor?.data"
[defaultSelection]="contributor?.selectedTerms"
[filterOperator]="graphParam?.filterOperator"
[useColorService]="graphParam?.useColorService"
[applyColorTo]="graphParam?.applyColorTo"
[showRowField]="graphParam?.showRowField"
[selectWithCheckbox]="graphParam?.selectWithCheckbox"
[headerDisplayMode]="graphParam?.headerDisplayMode"
[normaliseBy]="graphParam?.normaliseBy"
(onSelect)="contributor?.onRowSelect($event)"
(filterOperatorEvent)="changeMetricsTableOperator($event)"
></arlas-metrics-table>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { ArlasExportCsvService } from '../../services/export-csv/export-csv.serv
import { SpinnerOptions, ArlasOverlayRef } from '../../tools/utils';
import { ARLASDonutTooltip } from 'arlas-d3';
import { ArlasOverlayService } from '../../services/overlays/overlay.service';
import { ComputeConfig, TreeContributor } from 'arlas-web-contributors';
import { ComputeConfig, MetricsTableContributor, TreeContributor } from 'arlas-web-contributors';
import { Expression } from 'arlas-api';
import { DEFAULT_SPINNER_OPTIONS } from '../progress-spinner/progress-spinner.component';

Expand Down Expand Up @@ -149,6 +149,7 @@ export class WidgetComponent implements OnInit {
public ngOnInit() {
this.contributorType = this.getContirbutorType();
this.contributor = this.arlasStartupService.contributorRegistry.get(this.contributorId);
console.log(this.contributor);
if (this.componentType === 'swimlane') {
this.swimlanes = this.contributor.getConfigValue('swimlanes');
if (this.swimlanes) {
Expand All @@ -162,9 +163,15 @@ export class WidgetComponent implements OnInit {
this.setComponentInput(this.graphParam);
/** Init filter operator (include/exclude) of powerbars */
if (this.contributor instanceof TreeContributor) {
this.setPowerbarsFilterOperator((this.contributor as TreeContributor).getFilterOperator());
this.setFilterOperator((this.contributor as TreeContributor).getFilterOperator());
this.contributor.operatorChangedEvent.subscribe(op => {
this.setPowerbarsFilterOperator(op);
this.setFilterOperator(op);
});
}
if (this.contributor instanceof MetricsTableContributor) {
this.setFilterOperator((this.contributor as MetricsTableContributor).getFilterOperator());
this.contributor.operatorChanged$.subscribe(op => {
this.setFilterOperator(op);
});
}
}
Expand Down Expand Up @@ -226,6 +233,16 @@ export class WidgetComponent implements OnInit {
(this.contributor as TreeContributor).selectedNodesListChanged((this.contributor as TreeContributor).selectedNodesPathsList);
}

public changeMetricsTableOperator(op: 'Neq' | 'Eq'): void {
if (op === 'Neq') {
(this.contributor as MetricsTableContributor).setFilterOperator(Expression.OpEnum.Ne, /** emit */ true);
} else {
(this.contributor as MetricsTableContributor).setFilterOperator(Expression.OpEnum.Eq, /** emit */ true);
}
(this.contributor as MetricsTableContributor)
.onRowSelect(new Set((this.contributor as MetricsTableContributor).selectedTerms));
}


private getContirbutorType() {
const contributor = this.arlasStartupService.contributorRegistry.get(this.contributorId);
Expand Down Expand Up @@ -266,7 +283,7 @@ export class WidgetComponent implements OnInit {
}
}

private setPowerbarsFilterOperator(filterOperatorEnum: Expression.OpEnum) {
private setFilterOperator(filterOperatorEnum: Expression.OpEnum) {
if (filterOperatorEnum === Expression.OpEnum.Ne) {
if (!!this.graphParam.filterOperator) {
this.graphParam.filterOperator.value = 'Neq';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
"resultlist",
"swimlane",
"tree",
"metric"
"metric",
"metricstable"
]
}
}
Expand Down Expand Up @@ -155,6 +156,19 @@
"then": {
"$ref": "computeContributorConf.schema.json#"
}
},
{
"if": {
"type": "object",
"properties": {
"type": {
"const": "metricstable"
}
}
},
"then": {
"$ref": "metricsTableContributorConf.schema.json#"
}
}
]
}
Expand Down Expand Up @@ -224,7 +238,8 @@
"swimlane",
"resultlist",
"donut",
"metric"
"metric",
"metricstable"
]
},
"title": {
Expand Down Expand Up @@ -343,6 +358,23 @@
]
}
}
},
{
"properties": {
"componentType": {
"enum": [
"metricstable"
]
},
"input": {
"description": "Input of metrics table component.",
"allOf": [
{
"$ref": "metrics-table.schema.json#"
}
]
}
}
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ import {
ComputeContributor,
TreeContributor,
ChipsSearchContributor,
MapContributor
MapContributor,
MetricsTableContributor
} from 'arlas-web-contributors';
import { ArlasConfigService, ArlasCollaborativesearchService } from './startup.service';
import { ArlasSettingsService } from '../settings/arlas.settings.service';
Expand Down Expand Up @@ -109,6 +110,9 @@ export class ContributorBuilder {
groupIdToValues
);
break;
case 'metricstable':
contributor = new MetricsTableContributor(identifier, collaborativesearchService, configService);
break;
}
contributor.updateData = false;
return contributor;
Expand Down
Loading
Loading