@naniteninja/profile-comparison-lib 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +79 -0
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -6,6 +6,85 @@ Angular library that renders a side-by-side profile comparison (two profile imag
|
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
+
## Quick start (copy-paste)
|
|
10
|
+
|
|
11
|
+
### 1. Install
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install @naniteninja/profile-comparison-lib @tensorflow/tfjs @tensorflow-models/universal-sentence-encoder
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### 2. Wire up the module and backend URL
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
import { NgModule } from '@angular/core';
|
|
21
|
+
import { HttpClientModule } from '@angular/common/http';
|
|
22
|
+
import {
|
|
23
|
+
ProfileComparisonLibModule,
|
|
24
|
+
PROFILE_COMPARISON_API_BASE_URL,
|
|
25
|
+
} from '@naniteninja/profile-comparison-lib';
|
|
26
|
+
|
|
27
|
+
@NgModule({
|
|
28
|
+
imports: [HttpClientModule, ProfileComparisonLibModule],
|
|
29
|
+
providers: [
|
|
30
|
+
{ provide: PROFILE_COMPARISON_API_BASE_URL, useValue: 'http://localhost:3000/api' },
|
|
31
|
+
],
|
|
32
|
+
})
|
|
33
|
+
export class AppModule {}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### 3. Add the component to a template
|
|
37
|
+
|
|
38
|
+
```html
|
|
39
|
+
<lib-profile-comparison
|
|
40
|
+
[config]="profileConfig"
|
|
41
|
+
[fadeAllEdges]="false"
|
|
42
|
+
(matrixDataChange)="onMatrixData($event)"
|
|
43
|
+
(rawLLMOutputChange)="onRawLLM($event)"
|
|
44
|
+
(viewProfileClick)="onViewProfile($event)"
|
|
45
|
+
></lib-profile-comparison>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### 4. Provide config data in the component
|
|
49
|
+
|
|
50
|
+
```typescript
|
|
51
|
+
import { IProfileConfig } from '@naniteninja/profile-comparison-lib';
|
|
52
|
+
|
|
53
|
+
profileConfig: IProfileConfig = {
|
|
54
|
+
person1Interests: [
|
|
55
|
+
'Gaming', 'Programming', 'AI/ML', 'Startups',
|
|
56
|
+
'Blockchain', 'Cybersecurity', 'Web Development', 'Data Science',
|
|
57
|
+
],
|
|
58
|
+
person2Interests: [
|
|
59
|
+
'AI machine learning', 'Mobile Games', 'Hardware',
|
|
60
|
+
'Data Science', 'Entrepreneurship', 'Design Thinking', 'Blockchain',
|
|
61
|
+
],
|
|
62
|
+
person3Interests: ['Board Games', 'Machine Learning'],
|
|
63
|
+
user1Image: './assets/user1.jpg', // data URL or asset path
|
|
64
|
+
user2Image: './assets/user2.jpg',
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
onMatrixData(data: any) { console.log('Matrix:', data); }
|
|
68
|
+
onRawLLM(raw: string) { console.log('LLM:', raw); }
|
|
69
|
+
onViewProfile(e: { side: 'left' | 'right' }) {
|
|
70
|
+
console.log('View profile:', e.side);
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### 5. Start the backend and run
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
# Terminal 1 — backend (profile-comparison-server repo)
|
|
78
|
+
cd ../profile-comparison-server && npm install && npm start
|
|
79
|
+
|
|
80
|
+
# Terminal 2 — your app
|
|
81
|
+
ng serve
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
The component renders two profile images with a draggable center shape, semantically aligned interest lists on each side, and a "View Profile" link per side. If the backend is unreachable, a **"Configure backend"** message appears instead.
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
9
88
|
## Quickstart
|
|
10
89
|
|
|
11
90
|
1. **Install the package and peer dependencies** (including TensorFlow; required for Vite and other bundlers):
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@naniteninja/profile-comparison-lib",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": "^20.0.0",
|
|
6
|
-
"@angular/core": "^20.0.0"
|
|
7
|
-
"@tensorflow-models/universal-sentence-encoder": "^1.3.3",
|
|
8
|
-
"@tensorflow/tfjs": "^4.22.0"
|
|
6
|
+
"@angular/core": "^20.0.0"
|
|
9
7
|
},
|
|
10
8
|
"dependencies": {
|
|
11
|
-
"tslib": "^2.3.0"
|
|
9
|
+
"tslib": "^2.3.0",
|
|
10
|
+
"@tensorflow-models/universal-sentence-encoder": "^1.3.3",
|
|
11
|
+
"@tensorflow/tfjs": "^4.22.0"
|
|
12
12
|
},
|
|
13
13
|
"module": "fesm2022/naniteninja-profile-comparison-lib.mjs",
|
|
14
14
|
"typings": "index.d.ts",
|