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

Code refactoring: Modify the project source code to enable new analysis easily integrated #104

Open
LaraMerdol opened this issue Jan 26, 2024 · 5 comments

Comments

@LaraMerdol
Copy link
Collaborator

For easier integration of new analyses into our project, we should restructure the repository to allow other developers to easily integrate their work.

@LaraMerdol LaraMerdol self-assigned this Jan 26, 2024
@LaraMerdol
Copy link
Collaborator Author

LaraMerdol commented Jan 26, 2024

The new structure of the custom folder:

/src
|-- app
|   |-- custom
|   |   |-- analyses
|   |   |-- assets
|   |   |-- customization-service
|   |   |-- config
|   |   |-- database-tab
|   |   |-- map-tab
|   |   |-- object-tab
|   |   |-- customization.module.ts
  • The analyses folder should include different analysis components.
  • The customization-service includes customization files for visual core components such as context-menu.
  • The config folder includes configuration files such as app_description.json which define each node and edge types
  • The database-tab is where new database-sub-tabs can be added to the code structure.
  • The map-tab is where new map tabs can be added to the code structure.
  • The object-tab is where new object-tabs can be added to the code structure, such as object queries or reports.

Developers should add each component to the customization.module.ts after adding them.

@LaraMerdol
Copy link
Collaborator Author

LaraMerdol commented Jan 26, 2024

For the analysis components inside the analyses folder collect the helper methods that are same for the each query component to one file called query-helper.ts

LaraMerdol added a commit that referenced this issue Jan 26, 2024
LaraMerdol added a commit that referenced this issue Jan 27, 2024
@LaraMerdol
Copy link
Collaborator Author

@LaraMerdol
Copy link
Collaborator Author

Adding query component interface and modifying all analysis components as they implement that interface.

import { TableViewInput, TableFiltering, TableData } from '../../shared/table-view/table-view-types';
import { Subject } from 'rxjs';
import { GraphResponse } from 'src/app/visuall/db-service/data-types';

export interface QueryComponent<T>  {
  tableInput: TableViewInput;
  tableFilled: Subject<boolean>;
  tableResponse: T; 
  graphResponse: GraphResponse;
  clearTableFilter: Subject<boolean>;

  ngOnInit(): void;
  prepareQuery(): void;
  loadTable(skip: number, filter?: TableFiltering): void;
  loadGraph(skip: number, filter?: TableFiltering): void;
  filterGraphResponse(x: GraphResponse): GraphResponse;
  fillTable(data: T[], totalDataCount: number | null): void;
  getDataForQueryResult(e: any): void;
  filterTable(filter: TableFiltering): void;
  filterTableResponse(x: T[], filter: TableFiltering): T[];
}

@LaraMerdol
Copy link
Collaborator Author

The structure of the custom folder changed as;

/src
|-- app
|   |-- custom
|   |   |-- analyses
|   |   |-- customization-service
|   |   |-- config
|   |   |-- operational-tabs
|   |   |-- customization.module.ts

LaraMerdol added a commit that referenced this issue Jan 28, 2024
LaraMerdol added a commit that referenced this issue Jan 31, 2024
@LaraMerdol LaraMerdol removed their assignment Apr 27, 2024
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

No branches or pull requests

1 participant