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

Node dist vis #758

Merged
merged 27 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
259f29d
initial setup of library + wc in apps
bhushankhope Sep 13, 2024
ebb73e4
create services for nodes and edges
bhushankhope Sep 17, 2024
2cd7fcb
refactor node data service
bhushankhope Sep 17, 2024
7b15f35
update peer dependencies
bhushankhope Sep 17, 2024
7664a92
create deck gl visualization component
bhushankhope Sep 19, 2024
2c275f9
update peer deps
bhushankhope Sep 19, 2024
e2310d7
improve doc coverage
bhushankhope Sep 23, 2024
2e45b9e
Merge branch 'develop' of https://github.com/hubmapconsortium/hra-ui …
axdanbol Oct 3, 2024
f2f446b
refactor: Node dist vis data format update (WIP)
axdanbol Oct 17, 2024
3c4cf48
refactor: lint fix
axdanbol Oct 17, 2024
a3cf153
refactor(node-dist-vis): Remove export
axdanbol Oct 17, 2024
861c335
Merge branch 'develop' into node-dist-vis
axdanbol Oct 18, 2024
981ab9d
Merge branch 'node-dist-vis' of https://github.com/hubmapconsortium/h…
axdanbol Oct 21, 2024
9f341bc
feat(lib:common): Create library 'common'
axdanbol Oct 21, 2024
2f8f66e
refactor(lib:common): Move file loaders into 'common/fs'
axdanbol Oct 21, 2024
c055cda
refactor(node-dist-vis): Implement data loading
axdanbol Oct 22, 2024
e677de0
chore: Lint fix
axdanbol Oct 22, 2024
b61d9e3
refactor(node-dist-vis): :coffin: Remove unused data services
axdanbol Oct 22, 2024
b03961c
refactor(node-dist-vis): Add mode logic (WIP), improve filters (WIP),…
axdanbol Oct 22, 2024
7efe04f
refactor(node-dist-vis): Implement improved node filtering & minor fixes
axdanbol Oct 23, 2024
431f0d7
fix(node-dist-vis): Fix edge filtering bug
axdanbol Oct 23, 2024
ffa51db
test(node-dist-vis): Remove test files until jest + deck.gl is figure…
axdanbol Oct 24, 2024
e7898de
test(cde-visualization): Fix a couple of imports
axdanbol Oct 24, 2024
825a3d4
Merge remote-tracking branch 'origin/cde-mvp2' into node-dist-vis
axdanbol Oct 24, 2024
f276d0c
refactor(node-dist-vis): Cleanup & code smell fixes
axdanbol Oct 24, 2024
74fac52
refactor(node-dist-vis): :memo: Add documentation & minor type and er…
axdanbol Oct 24, 2024
0851d24
refactor(node-dist-vis): Remove test data
axdanbol Oct 24, 2024
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
4 changes: 4 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@
{
"sourceTag": "project:design-system",
"onlyDependOnLibsWithTags": ["*"]
},
{
"sourceTag": "project:node-dist-vis",
"onlyDependOnLibsWithTags": ["*"]
}
]
}
Expand Down
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
"ccf-organ-info",
"design-system",
"body-ui",
"eui"
"eui",
"node-dist-vis",
"lib:common"
]
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { CommonModule } from '@angular/common';
import { ChangeDetectionStrategy, Component, inject, Injector, input, output, Type } from '@angular/core';
import { MatIconModule } from '@angular/material/icon';
import { FileLoader, FileLoaderEvent } from '@hra-ui/cde-visualization';
import { FileLoader, FileLoaderEvent } from '@hra-ui/common/fs';
import { ButtonModule } from '@hra-ui/design-system/button';
import { reduce, Subscription } from 'rxjs';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ import { Router, RouterModule } from '@angular/router';
import {
ColorMapEntry,
ColorMapFileLoaderService,
CsvFileLoaderOptions,
CsvFileLoaderService,
DEFAULT_COLOR_MAP_KEY,
DEFAULT_COLOR_MAP_VALUE_KEY,
DEFAULT_NODE_TARGET_KEY,
Expand All @@ -32,6 +30,7 @@ import { StepIndicatorComponent } from '@hra-ui/design-system/step-indicator';
import { TooltipCardComponent, TooltipContent } from '@hra-ui/design-system/tooltip-card';
import { ParseError } from 'papaparse';

import { CsvFileLoaderOptions, CsvFileLoaderService } from '@hra-ui/common/fs';
import { MarkEmptyFormControlDirective } from '../../components/empty-form-control/empty-form-control.directive';
import { FileLoadError, FileUploadComponent } from '../../components/file-upload/file-upload.component';
import { VisualizationDataService } from '../../services/visualization-data-service/visualization-data.service';
Expand Down
10 changes: 10 additions & 0 deletions apps/node-dist-vis-wc-e2e/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": ["plugin:cypress/recommended", "../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {}
}
]
}
7 changes: 7 additions & 0 deletions apps/node-dist-vis-wc-e2e/cypress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset';

import { defineConfig } from 'cypress';

export default defineConfig({
e2e: { ...nxE2EPreset(__filename, { cypressDir: 'src' }), baseUrl: 'http://localhost:4200' },
});
29 changes: 29 additions & 0 deletions apps/node-dist-vis-wc-e2e/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "node-dist-vis-wc-e2e",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"sourceRoot": "apps/node-dist-vis-wc-e2e/src",
"tags": [],
"implicitDependencies": ["node-dist-vis-wc"],
"targets": {
"e2e": {
"executor": "@nx/cypress:cypress",
"options": {
"cypressConfig": "apps/node-dist-vis-wc-e2e/cypress.config.ts",
"testingType": "e2e",
"devServerTarget": "node-dist-vis-wc:serve:development"
},
"configurations": {
"production": {
"devServerTarget": "node-dist-vis-wc:serve:production"
},
"ci": {
"devServerTarget": "node-dist-vis-wc:serve-static"
}
}
},
"lint": {
"executor": "@nx/eslint:lint"
}
}
}
13 changes: 13 additions & 0 deletions apps/node-dist-vis-wc-e2e/src/e2e/app.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { getGreeting } from '../support/app.po';

describe('node-dist-vis-wc-e2e', () => {
beforeEach(() => cy.visit('/'));

it('should display welcome message', () => {
// Custom command example, see `../support/commands.ts` file
cy.login('[email protected]', 'myPassword');

// Function helper example, see `../support/app.po.ts` file
getGreeting().contains(/Welcome/);
});
});
5 changes: 5 additions & 0 deletions apps/node-dist-vis-wc-e2e/src/fixtures/example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "Using fixtures to represent data",
"email": "[email protected]",
"body": "Fixtures are a great way to mock data for responses to routes"
}
1 change: 1 addition & 0 deletions apps/node-dist-vis-wc-e2e/src/support/app.po.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const getGreeting = () => cy.get('h1');
35 changes: 35 additions & 0 deletions apps/node-dist-vis-wc-e2e/src/support/commands.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/// <reference types="cypress" />

// ***********************************************
// This example commands.ts shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************

// eslint-disable-next-line @typescript-eslint/no-namespace
declare namespace Cypress {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
interface Chainable<Subject> {
login(email: string, password: string): void;
}
}

// -- This is a parent command --
Cypress.Commands.add('login', (email, password) => {
console.log('Custom command example: Login', email, password);
});
//
// -- This is a child command --
// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... })
//
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
17 changes: 17 additions & 0 deletions apps/node-dist-vis-wc-e2e/src/support/e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// ***********************************************************
// This example support/e2e.ts is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************

// Import commands.ts using ES2015 syntax:
import './commands';
17 changes: 17 additions & 0 deletions apps/node-dist-vis-wc-e2e/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"allowJs": true,
"outDir": "../../dist/out-tsc",
"module": "commonjs",
"types": ["cypress", "node"],
"sourceMap": false,
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true
},
"include": ["**/*.ts", "**/*.js", "cypress.config.ts", "**/*.cy.ts", "**/*.cy.js", "**/*.d.ts"]
}
33 changes: 33 additions & 0 deletions apps/node-dist-vis-wc/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts"],
"extends": ["plugin:@nx/angular", "plugin:@angular-eslint/template/process-inline-templates"],
"rules": {
"@angular-eslint/directive-selector": [
"error",
{
"type": "attribute",
"prefix": "hra",
"style": "camelCase"
}
],
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": "hra",
"style": "kebab-case"
}
]
}
},
{
"files": ["*.html"],
"extends": ["plugin:@nx/angular-template"],
"rules": {}
}
]
}
22 changes: 22 additions & 0 deletions apps/node-dist-vis-wc/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* eslint-disable */
export default {
displayName: 'node-dist-vis-wc',
preset: '../../jest.preset.js',
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
coverageDirectory: '../../coverage/apps/node-dist-vis-wc',
transform: {
'^.+\\.(ts|mjs|js|html)$': [
'jest-preset-angular',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
stringifyContentPathRegex: '\\.(html|svg)$',
},
],
},
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'],
snapshotSerializers: [
'jest-preset-angular/build/serializers/no-ng-attributes',
'jest-preset-angular/build/serializers/ng-snapshot',
'jest-preset-angular/build/serializers/html-comment',
],
};
90 changes: 90 additions & 0 deletions apps/node-dist-vis-wc/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{
"name": "node-dist-vis-wc",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"prefix": "hra",
"sourceRoot": "apps/node-dist-vis-wc/src",
"tags": ["type:app", "project:node-dist-vis"],
"targets": {
"build": {
"executor": "@angular-devkit/build-angular:application",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/apps/node-dist-vis-wc",
"index": "apps/node-dist-vis-wc/src/index.html",
"browser": "apps/node-dist-vis-wc/src/main.ts",
"polyfills": ["zone.js"],
"tsConfig": "apps/node-dist-vis-wc/tsconfig.app.json",
"inlineStyleLanguage": "scss",
"assets": [
{
"glob": "**/*",
"input": "apps/node-dist-vis-wc/public"
}
],
"styles": ["apps/node-dist-vis-wc/src/styles.scss"],
"scripts": [],
"outputHashing": "none"
},
"configurations": {
"production": {
"budgets": [
{
"type": "initial",
"maximumWarning": "1mb",
"maximumError": "2mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "4kb"
}
]
},
"development": {
"optimization": false,
"extractLicenses": false,
"sourceMap": true
}
},
"defaultConfiguration": "production"
},
"serve": {
"executor": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"buildTarget": "node-dist-vis-wc:build:production"
},
"development": {
"buildTarget": "node-dist-vis-wc:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"executor": "@angular-devkit/build-angular:extract-i18n",
"options": {
"buildTarget": "node-dist-vis-wc:build"
}
},
"lint": {
"executor": "@nx/eslint:lint"
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "apps/node-dist-vis-wc/jest.config.ts"
}
},
"serve-static": {
"executor": "@nx/web:file-server",
"options": {
"buildTarget": "node-dist-vis-wc:build",
"port": 4200,
"staticFilePath": "dist/apps/node-dist-vis-wc/browser",
"spa": true
}
}
}
}
Binary file added apps/node-dist-vis-wc/public/favicon.ico
Binary file not shown.
Empty file.
13 changes: 13 additions & 0 deletions apps/node-dist-vis-wc/src/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>node-dist-vis-wc</title>
<base href="/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" type="image/x-icon" href="favicon.ico" />
</head>
<body>
<hra-node-dist-vis></hra-node-dist-vis>
</body>
</html>
1 change: 1 addition & 0 deletions apps/node-dist-vis-wc/src/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import '@hra-ui/node-dist-vis';
5 changes: 5 additions & 0 deletions apps/node-dist-vis-wc/src/styles.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/* You can add global styles to this file, and also import other style files */

body {
margin: 0;
}
8 changes: 8 additions & 0 deletions apps/node-dist-vis-wc/src/test-setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// @ts-expect-error https://thymikee.github.io/jest-preset-angular/docs/getting-started/test-environment
globalThis.ngJest = {
testEnvironmentOptions: {
errorOnUnknownElements: true,
errorOnUnknownProperties: true,
},
};
import 'jest-preset-angular/setup-jest';
10 changes: 10 additions & 0 deletions apps/node-dist-vis-wc/tsconfig.app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"types": []
},
"files": ["src/main.ts"],
"include": ["src/**/*.d.ts"],
"exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"]
}
6 changes: 6 additions & 0 deletions apps/node-dist-vis-wc/tsconfig.editor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "./tsconfig.json",
"include": ["src/**/*.ts"],
"compilerOptions": {},
"exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"]
}
Loading
Loading