@eric-emg/symphiq-components 1.2.0
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 +179 -0
- package/fesm2022/symphiq-components.mjs +3036 -0
- package/fesm2022/symphiq-components.mjs.map +1 -0
- package/index.d.ts +166 -0
- package/index.d.ts.map +1 -0
- package/package.json +55 -0
- package/src/styles.css +1 -0
- package/styles.css +1403 -0
package/README.md
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
# Funnel Analysis Library
|
|
2
|
+
|
|
3
|
+
A comprehensive Angular library for building funnel analysis dashboards with performance visualization and metrics analysis.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
### From NPM (once published)
|
|
8
|
+
```bash
|
|
9
|
+
npm install funnel-analysis-lib
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
### Local Development (from this workspace)
|
|
13
|
+
```bash
|
|
14
|
+
# Build the library
|
|
15
|
+
npm run build:lib:prod
|
|
16
|
+
|
|
17
|
+
# The library will be available at dist/funnel-analysis-lib
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
### Import Components
|
|
23
|
+
```typescript
|
|
24
|
+
import { DashboardComponent } from 'funnel-analysis-lib';
|
|
25
|
+
import { CommonModule } from '@angular/common';
|
|
26
|
+
|
|
27
|
+
@Component({
|
|
28
|
+
selector: 'app-root',
|
|
29
|
+
standalone: true,
|
|
30
|
+
imports: [CommonModule, DashboardComponent],
|
|
31
|
+
template: `
|
|
32
|
+
<lib-dashboard [data]="performanceData"></lib-dashboard>
|
|
33
|
+
`
|
|
34
|
+
})
|
|
35
|
+
export class AppComponent {
|
|
36
|
+
performanceData = { /* your performance data */ };
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Import Models and Interfaces
|
|
41
|
+
```typescript
|
|
42
|
+
import {
|
|
43
|
+
PerformanceOverviewStructuredV3Interface,
|
|
44
|
+
GradeEnum,
|
|
45
|
+
MetricStatusEnum
|
|
46
|
+
} from 'funnel-analysis-lib';
|
|
47
|
+
|
|
48
|
+
const assessment: PerformanceOverviewStructuredV3Interface = {
|
|
49
|
+
// your data structure
|
|
50
|
+
};
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Import Services
|
|
54
|
+
```typescript
|
|
55
|
+
import { ModalService, FunnelOrderService } from 'funnel-analysis-lib';
|
|
56
|
+
|
|
57
|
+
@Injectable()
|
|
58
|
+
export class MyService {
|
|
59
|
+
constructor(
|
|
60
|
+
private modalService: ModalService,
|
|
61
|
+
private funnelOrderService: FunnelOrderService
|
|
62
|
+
) {}
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Features
|
|
67
|
+
|
|
68
|
+
- **Dashboard Component**: Main visualization component for funnel analysis
|
|
69
|
+
- **Metric Cards**: Individual metric display components
|
|
70
|
+
- **Insight Cards**: Actionable insights from funnel data
|
|
71
|
+
- **Breakdown Sections**: Detailed breakdowns by various dimensions (device, channel, etc.)
|
|
72
|
+
- **Overall Assessment**: Summary assessment of funnel health
|
|
73
|
+
- **Modal Management**: Built-in modal service for notifications and dialogs
|
|
74
|
+
- **Funnel Ordering**: Service for organizing and prioritizing funnel items
|
|
75
|
+
|
|
76
|
+
## Styling
|
|
77
|
+
|
|
78
|
+
The library uses **Tailwind CSS** for all styling. To use this library in your project, follow these steps:
|
|
79
|
+
|
|
80
|
+
### Step 1: Install Tailwind CSS (if not already installed)
|
|
81
|
+
```bash
|
|
82
|
+
npm install -D tailwindcss postcss autoprefixer
|
|
83
|
+
npx tailwindcss init -p
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Step 2: Configure Tailwind to scan the library files
|
|
87
|
+
|
|
88
|
+
**IMPORTANT**: Update your `tailwind.config.js` to include the library's compiled files:
|
|
89
|
+
|
|
90
|
+
```js
|
|
91
|
+
/** @type {import('tailwindcss').Config} */
|
|
92
|
+
module.exports = {
|
|
93
|
+
content: [
|
|
94
|
+
"./src/**/*.{html,ts}",
|
|
95
|
+
"./node_modules/@eric-emg/funnel-analysis-lib/**/*.{js,mjs}", // ← ADD THIS LINE
|
|
96
|
+
],
|
|
97
|
+
theme: {
|
|
98
|
+
extend: {},
|
|
99
|
+
},
|
|
100
|
+
plugins: [],
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
**Note**: The path `./node_modules/@eric-emg/funnel-analysis-lib/**/*.{js,mjs}` tells Tailwind to scan the compiled library files for class names.
|
|
105
|
+
|
|
106
|
+
### Step 3: Import Tailwind CSS in your global styles
|
|
107
|
+
|
|
108
|
+
```css
|
|
109
|
+
/* In your global styles.css or main.css */
|
|
110
|
+
@tailwind base;
|
|
111
|
+
@tailwind components;
|
|
112
|
+
@tailwind utilities;
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Custom Colors
|
|
116
|
+
If you want to use the library's custom color palette, add to your `tailwind.config.js`:
|
|
117
|
+
|
|
118
|
+
```js
|
|
119
|
+
theme: {
|
|
120
|
+
extend: {
|
|
121
|
+
colors: {
|
|
122
|
+
'symphiq-blue': '#1a56db',
|
|
123
|
+
'symphiq-dark': '#0f172a',
|
|
124
|
+
'symphiq-gray': '#64748b',
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Building the Library
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
# Build for production
|
|
134
|
+
npm run build:lib:prod
|
|
135
|
+
|
|
136
|
+
# Build for development
|
|
137
|
+
npm run build:lib
|
|
138
|
+
|
|
139
|
+
# Build everything (library + demo)
|
|
140
|
+
npm run build:all
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## Testing
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
# Run library tests
|
|
147
|
+
ng test funnel-analysis-lib
|
|
148
|
+
|
|
149
|
+
# Run library tests with watch mode
|
|
150
|
+
ng test funnel-analysis-lib --watch
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## Development
|
|
154
|
+
|
|
155
|
+
To develop and test the library:
|
|
156
|
+
|
|
157
|
+
1. Start the demo application which imports the library:
|
|
158
|
+
```bash
|
|
159
|
+
npm start
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
2. The demo app will hot-reload when you make changes to both the library and demo app
|
|
163
|
+
|
|
164
|
+
## Publishing to NPM
|
|
165
|
+
|
|
166
|
+
1. Update the version in `projects/funnel-analysis-lib/package.json`
|
|
167
|
+
2. Build the library:
|
|
168
|
+
```bash
|
|
169
|
+
npm run build:lib:prod
|
|
170
|
+
```
|
|
171
|
+
3. Publish from the dist folder:
|
|
172
|
+
```bash
|
|
173
|
+
cd dist/funnel-analysis-lib
|
|
174
|
+
npm publish
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## License
|
|
178
|
+
|
|
179
|
+
MIT
|