@tech4good/angular-schematics 21.5.0 → 21.7.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/CHANGELOG.md +44 -0
- package/README.md +266 -1
- package/package.json +34 -7
- package/src/component/files/__name@dasherize__/__name@dasherize__.component.spec.ts.template +4 -5
- package/src/component/files/__name@dasherize__/__name@dasherize__.component.ts.template +1 -1
- package/src/entity/files/__name@dasherize__/__name@dasherize__.mock.ts.template +16 -7
- package/src/entity/files/__name@dasherize__/__name@dasherize__.model.ts.template +13 -6
- package/src/entity/files/__name@dasherize__/__name@dasherize__.store.ts.template +18 -10
- package/src/entity/index.js +61 -49
- package/src/entity/index.js.map +1 -1
- package/src/entity/schema.json +4 -0
- package/src/guard/files/__name@dasherize__.guard.spec.ts.template +0 -1
- package/src/ng-add/files/.github/workflows/angular-github-ci.yml.template +3 -0
- package/src/ng-add/files/.gitignore.template +5 -0
- package/src/ng-add/files/analytics/datasets.js.template +206 -0
- package/src/ng-add/files/analytics/entity_sources.js.template +58 -0
- package/src/ng-add/files/analytics/entity_sources.test.js.template +57 -0
- package/src/ng-add/files/analytics/lib/api_query.js.template +87 -0
- package/src/ng-add/files/analytics/lib/api_query.test.js.template +84 -0
- package/src/ng-add/files/analytics/lib/bigquery_query_compatibility.test.js.template +53 -0
- package/src/ng-add/files/analytics/lib/dataset_schema.js.template +53 -0
- package/src/ng-add/files/analytics/lib/dataset_schema.test.js.template +34 -0
- package/src/ng-add/files/analytics/lib/entity_sync.js.template +397 -0
- package/src/ng-add/files/analytics/lib/entity_sync.test.js.template +212 -0
- package/src/ng-add/files/analytics/lib/identifier_salt.js.template +57 -0
- package/src/ng-add/files/analytics/lib/identifier_salt.test.js.template +36 -0
- package/src/ng-add/files/analytics/lib/snapshot_files.js.template +46 -0
- package/src/ng-add/files/analytics/lib/snapshot_files.test.js.template +67 -0
- package/src/ng-add/files/analytics/lib/sqlite.js.template +92 -0
- package/src/ng-add/files/analytics/lib/upload_entities.js.template +81 -0
- package/src/ng-add/files/analytics/lib/upload_entities.test.js.template +86 -0
- package/src/ng-add/files/analytics/proxy.conf.json.template +7 -0
- package/src/ng-add/files/analytics/scripts/refresh_snapshot.js.template +518 -0
- package/src/ng-add/files/analytics/scripts/start.js.template +88 -0
- package/src/ng-add/files/analytics/server/server.js.template +212 -0
- package/src/ng-add/files/angular.json.template +80 -1
- package/src/ng-add/files/bigquery/queries/active_time_by_route.sql.template +27 -8
- package/src/ng-add/files/bigquery/queries/active_user_windows.sql.template +67 -0
- package/src/ng-add/files/bigquery/queries/dashboard_route_visits.sql.template +47 -0
- package/src/ng-add/files/bigquery/queries/data_quality.sql.template +323 -0
- package/src/ng-add/files/bigquery/queries/onboarding_funnel.sql.template +512 -0
- package/src/ng-add/files/bigquery/queries/onboarding_stage_observations.sql.template +134 -0
- package/src/ng-add/files/bigquery/queries/weekly_retention_cohorts.sql.template +90 -0
- package/src/ng-add/files/bigquery/scripts/export_entities.js.template +120 -0
- package/src/ng-add/files/bigquery/scripts/init_views.js.template +57 -0
- package/src/ng-add/files/bigquery/scripts/run_query.js.template +141 -0
- package/src/ng-add/files/bigquery/views/events_flat.sql.template +27 -12
- package/src/ng-add/files/bigquery/views/logs_latest.sql.template +16 -3
- package/src/ng-add/files/docs-infra/analytics-guide.md.template +270 -25
- package/src/ng-add/files/docs-infra/analytics-workbench-guide.md.template +307 -0
- package/src/ng-add/files/docs-infra/authentication-architecture.md.template +300 -0
- package/src/ng-add/files/docs-infra/email-infrastructure.md.template +43 -0
- package/src/ng-add/files/docs-infra/firestore-index-checker.md.template +87 -0
- package/src/ng-add/files/docs-infra/infrastructure-guide.md.template +123 -38
- package/src/ng-add/files/docs-infra/load-system-architecture.md.template +15 -1
- package/src/ng-add/files/docs-infra/querying-strategy.md.template +14 -0
- package/src/ng-add/files/docs-infra/stream-system-architecture.md.template +21 -7
- package/src/ng-add/files/eslint.config.js.template +22 -3
- package/src/ng-add/files/firebase.json.template +6 -0
- package/src/ng-add/files/firestore.indexes.json.template +23 -0
- package/src/ng-add/files/firestore.rules.spec.ts.template +84 -15
- package/src/ng-add/files/firestore.rules.template +29 -17
- package/src/ng-add/files/functions/.gitignore.template +3 -0
- package/src/ng-add/files/functions/package.json.template +13 -0
- package/src/ng-add/files/functions/src/email.ts.template +23 -0
- package/src/ng-add/files/functions/src/index.ts.template +44 -0
- package/src/ng-add/files/functions/tsconfig.json.template +13 -0
- package/src/ng-add/files/jest.config.ts.template +3 -2
- package/src/ng-add/files/package.json.template +41 -16
- package/src/ng-add/files/projects/analytics/src/app/analytics-api.service.ts.template +130 -0
- package/src/ng-add/files/projects/analytics/src/app/app.component.html.template +77 -0
- package/src/ng-add/files/projects/analytics/src/app/app.component.scss.template +240 -0
- package/src/ng-add/files/projects/analytics/src/app/app.component.ts.template +96 -0
- package/src/ng-add/files/projects/analytics/src/app/app.routes.ts.template +11 -0
- package/src/ng-add/files/projects/analytics/src/app/dashboard-pages.spec.ts.template +151 -0
- package/src/ng-add/files/projects/analytics/src/app/data-quality/data-quality-page/data-quality-page.component.html.template +39 -0
- package/src/ng-add/files/projects/analytics/src/app/data-quality/data-quality-page/data-quality-page.component.scss.template +1 -0
- package/src/ng-add/files/projects/analytics/src/app/data-quality/data-quality-page/data-quality-page.component.ts.template +95 -0
- package/src/ng-add/files/projects/analytics/src/app/engagement/engagement-page/engagement-page.component.html.template +47 -0
- package/src/ng-add/files/projects/analytics/src/app/engagement/engagement-page/engagement-page.component.scss.template +1 -0
- package/src/ng-add/files/projects/analytics/src/app/engagement/engagement-page/engagement-page.component.ts.template +120 -0
- package/src/ng-add/files/projects/analytics/src/app/onboarding/onboarding-page/onboarding-page.component.html.template +40 -0
- package/src/ng-add/files/projects/analytics/src/app/onboarding/onboarding-page/onboarding-page.component.scss.template +1 -0
- package/src/ng-add/files/projects/analytics/src/app/onboarding/onboarding-page/onboarding-page.component.ts.template +98 -0
- package/src/ng-add/files/projects/analytics/src/app/overview/overview-page/overview-page.component.html.template +35 -0
- package/src/ng-add/files/projects/analytics/src/app/overview/overview-page/overview-page.component.scss.template +1 -0
- package/src/ng-add/files/projects/analytics/src/app/overview/overview-page/overview-page.component.ts.template +84 -0
- package/src/ng-add/files/projects/analytics/src/app/routes/routes-page/routes-page.component.html.template +42 -0
- package/src/ng-add/files/projects/analytics/src/app/routes/routes-page/routes-page.component.scss.template +1 -0
- package/src/ng-add/files/projects/analytics/src/app/routes/routes-page/routes-page.component.ts.template +110 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/analytics-utils.ts.template +43 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/chart-theme.ts.template +42 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/dashboard-layout.scss.template +239 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/dashboard-table/dashboard-table.component.html.template +76 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/dashboard-table/dashboard-table.component.scss.template +128 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/dashboard-table/dashboard-table.component.spec.ts.template +31 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/dashboard-table/dashboard-table.component.ts.template +153 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/funnel-chart/funnel-chart.component.html.template +16 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/funnel-chart/funnel-chart.component.scss.template +63 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/funnel-chart/funnel-chart.component.ts.template +52 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/metric-card/metric-card.component.html.template +5 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/metric-card/metric-card.component.scss.template +56 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/metric-card/metric-card.component.spec.ts.template +30 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/metric-card/metric-card.component.ts.template +15 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/quality-chart/quality-chart.component.html.template +9 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/quality-chart/quality-chart.component.scss.template +43 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/quality-chart/quality-chart.component.ts.template +62 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/route-distribution-chart/route-distribution-chart.component.html.template +9 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/route-distribution-chart/route-distribution-chart.component.scss.template +33 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/route-distribution-chart/route-distribution-chart.component.ts.template +82 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/route-traffic-chart/route-traffic-chart.component.html.template +15 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/route-traffic-chart/route-traffic-chart.component.scss.template +45 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/route-traffic-chart/route-traffic-chart.component.ts.template +55 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/status-message/status-message.component.html.template +18 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/status-message/status-message.component.scss.template +45 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/status-message/status-message.component.ts.template +15 -0
- package/src/ng-add/files/projects/analytics/src/app/vega-chart/vega-chart.component.ts.template +121 -0
- package/src/ng-add/files/projects/analytics/src/index.html.template +19 -0
- package/src/ng-add/files/projects/analytics/src/main.ts.template +16 -0
- package/src/ng-add/files/projects/analytics/src/styles.scss.template +28 -0
- package/src/ng-add/files/projects/analytics/tsconfig.app.json.template +13 -0
- package/src/ng-add/files/projects/analytics/tsconfig.spec.json.template +15 -0
- package/src/ng-add/files/src/app/admin/admin-panel/admin-panel.component.html.template +3 -1
- package/src/ng-add/files/src/app/admin/admin-panel/admin-panel.component.spec.ts.template +10 -13
- package/src/ng-add/files/src/app/admin/admin-panel/admin-panel.component.ts.template +2 -0
- package/src/ng-add/files/src/app/admin/admin-panel/admin-settings/admin-settings.component.spec.ts.template +4 -5
- package/src/ng-add/files/src/app/admin/admin-panel/admin-user-list/admin-user-list.component.spec.ts.template +11 -12
- package/src/ng-add/files/src/app/admin/admin-panel/admin-user-list/admin-user-list.component.ts.template +7 -7
- package/src/ng-add/files/src/app/admin/admin-panel/admin-user-list/admin-user-table/admin-user-table.component.spec.ts.template +8 -10
- package/src/ng-add/files/src/app/admin/admin-panel/admin-user-list/admin-user-table/admin-user-table.component.ts.template +3 -2
- package/src/ng-add/files/src/app/app.component.html.template +3 -3
- package/src/ng-add/files/src/app/app.component.scss.template +1 -1
- package/src/ng-add/files/src/app/app.component.spec.ts.template +4 -5
- package/src/ng-add/files/src/app/app.component.ts.template +3 -2
- package/src/ng-add/files/src/app/app.config.ts.template +21 -15
- package/src/ng-add/files/src/app/app.routes.ts.template +6 -0
- package/src/ng-add/files/src/app/auth-routing.spec.ts.template +13 -9
- package/src/ng-add/files/src/app/core/analytics/time-analytics.service.spec.ts.template +46 -29
- package/src/ng-add/files/src/app/core/analytics/time-analytics.service.ts.template +27 -18
- package/src/ng-add/files/src/app/core/auth/auth.providers.spec.ts.template +112 -0
- package/src/ng-add/files/src/app/core/auth/auth.providers.ts.template +48 -0
- package/src/ng-add/files/src/app/core/auth/auth.service.ts.template +14 -23
- package/src/ng-add/files/src/app/core/auth/guards/require-admin.guard.spec.ts.template +27 -0
- package/src/ng-add/files/src/app/core/auth/guards/require-admin.guard.ts.template +3 -2
- package/src/ng-add/files/src/app/core/auth/guards/require-auth-and-consent.guard.ts.template +7 -2
- package/src/ng-add/files/src/app/core/firebase/data.providers.prod.ts.template +21 -0
- package/src/ng-add/files/src/app/core/firebase/data.providers.ts.template +13 -0
- package/src/ng-add/files/src/app/core/local-storage/session.service.spec.ts.template +43 -0
- package/src/ng-add/files/src/app/core/local-storage/session.service.ts.template +7 -0
- package/src/ng-add/files/src/app/core/store/app-data.spec.ts.template +76 -0
- package/src/ng-add/files/src/app/core/store/auth/auth.mock.ts.template +20 -82
- package/src/ng-add/files/src/app/core/store/auth/auth.store.spec.ts.template +217 -0
- package/src/ng-add/files/src/app/core/store/auth/auth.store.ts.template +36 -172
- package/src/ng-add/files/src/app/core/store/user/user.mock.ts.template +18 -15
- package/src/ng-add/files/src/app/core/store/user/user.model.ts.template +7 -8
- package/src/ng-add/files/src/app/core/store/user/user.store.ts.template +14 -10
- package/src/ng-add/files/src/app/core/store/user-context/user-context.mock.ts.template +20 -8
- package/src/ng-add/files/src/app/core/store/user-context/user-context.model.ts.template +5 -6
- package/src/ng-add/files/src/app/core/store/user-context/user-context.store.ts.template +14 -10
- package/src/ng-add/files/src/app/core/store/user-private/user-private.mock.ts.template +20 -7
- package/src/ng-add/files/src/app/core/store/user-private/user-private.model.ts.template +6 -6
- package/src/ng-add/files/src/app/core/store/user-private/user-private.store.ts.template +14 -10
- package/src/ng-add/files/src/app/core/testing/app-mocks.ts.template +42 -0
- package/src/ng-add/files/src/app/first-time/auth-action/auth-action.component.html.template +4 -0
- package/src/ng-add/files/src/app/first-time/auth-action/auth-action.component.scss.template +1 -0
- package/src/ng-add/files/src/app/first-time/auth-action/auth-action.component.ts.template +38 -0
- package/src/ng-add/files/src/app/first-time/consent/consent.component.html.template +2 -1
- package/src/ng-add/files/src/app/first-time/consent/consent.component.scss.template +7 -3
- package/src/ng-add/files/src/app/first-time/consent/consent.component.spec.ts.template +31 -11
- package/src/ng-add/files/src/app/first-time/consent/consent.component.ts.template +16 -1
- package/src/ng-add/files/src/app/first-time/consent/consent.guard.ts.template +5 -1
- package/src/ng-add/files/src/app/first-time/early-access/early-access.component.spec.ts.template +27 -16
- package/src/ng-add/files/src/app/first-time/early-access/early-access.component.ts.template +102 -49
- package/src/ng-add/files/src/app/first-time/early-access/early-access.guard.ts.template +5 -1
- package/src/ng-add/files/src/app/first-time/early-access/survey-form/survey-form.component.html.template +2 -1
- package/src/ng-add/files/src/app/first-time/early-access/survey-form/survey-form.component.scss.template +7 -3
- package/src/ng-add/files/src/app/first-time/early-access/survey-form/survey-form.component.spec.ts.template +20 -6
- package/src/ng-add/files/src/app/first-time/early-access/survey-form/survey-form.component.ts.template +2 -0
- package/src/ng-add/files/src/app/first-time/early-access/waitlist-view/waitlist-view.component.spec.ts.template +4 -5
- package/src/ng-add/files/src/app/first-time/email-link/email-link.component.html.template +18 -0
- package/src/ng-add/files/src/app/first-time/email-link/email-link.component.scss.template +2 -0
- package/src/ng-add/files/src/app/first-time/email-link/email-link.component.spec.ts.template +56 -0
- package/src/ng-add/files/src/app/first-time/email-link/email-link.component.ts.template +91 -0
- package/src/ng-add/files/src/app/first-time/first-time-routing.spec.ts.template +11 -7
- package/src/ng-add/files/src/app/first-time/landing/hero/hero.component.html.template +19 -7
- package/src/ng-add/files/src/app/first-time/landing/hero/hero.component.scss.template +51 -0
- package/src/ng-add/files/src/app/first-time/landing/hero/hero.component.ts.template +44 -5
- package/src/ng-add/files/src/app/first-time/landing/landing.component.html.template +2 -1
- package/src/ng-add/files/src/app/first-time/landing/landing.component.scss.template +12 -8
- package/src/ng-add/files/src/app/first-time/landing/landing.component.spec.ts.template +33 -10
- package/src/ng-add/files/src/app/first-time/landing/landing.component.ts.template +6 -19
- package/src/ng-add/files/src/app/first-time/login/login.component.html.template +58 -6
- package/src/ng-add/files/src/app/first-time/login/login.component.scss.template +151 -22
- package/src/ng-add/files/src/app/first-time/login/login.component.spec.ts.template +30 -32
- package/src/ng-add/files/src/app/first-time/login/login.component.ts.template +85 -31
- package/src/ng-add/files/src/app/first-time/onboarding/onboarding.component.spec.ts.template +4 -2
- package/src/ng-add/files/src/app/first-time/onboarding/onboarding.component.ts.template +1 -1
- package/src/ng-add/files/src/app/main/account-profile/account-profile.component.html.template +12 -0
- package/src/ng-add/files/src/app/main/account-profile/account-profile.component.scss.template +39 -0
- package/src/ng-add/files/src/app/main/account-profile/account-profile.component.spec.ts.template +68 -0
- package/src/ng-add/files/src/app/main/account-profile/account-profile.component.ts.template +20 -0
- package/src/ng-add/files/src/app/main/account-profile/delete-guest-card/delete-guest-card.component.html.template +24 -0
- package/src/ng-add/files/src/app/main/account-profile/delete-guest-card/delete-guest-card.component.scss.template +50 -0
- package/src/ng-add/files/src/app/main/account-profile/delete-guest-card/delete-guest-card.component.spec.ts.template +65 -0
- package/src/ng-add/files/src/app/main/account-profile/delete-guest-card/delete-guest-card.component.ts.template +59 -0
- package/src/ng-add/files/src/app/main/account-profile/guest-deletion-dialog.component.ts.template +51 -0
- package/src/ng-add/files/src/app/main/account-profile/profile-details-card/profile-details-card.component.html.template +50 -0
- package/src/ng-add/files/src/app/main/account-profile/profile-details-card/profile-details-card.component.scss.template +137 -0
- package/src/ng-add/files/src/app/main/account-profile/profile-details-card/profile-details-card.component.spec.ts.template +57 -0
- package/src/ng-add/files/src/app/main/account-profile/profile-details-card/profile-details-card.component.ts.template +59 -0
- package/src/ng-add/files/src/app/main/account-profile/sign-in-methods-card/sign-in-methods-card.component.html.template +133 -0
- package/src/ng-add/files/src/app/main/account-profile/sign-in-methods-card/sign-in-methods-card.component.scss.template +207 -0
- package/src/ng-add/files/src/app/main/account-profile/sign-in-methods-card/sign-in-methods-card.component.spec.ts.template +74 -0
- package/src/ng-add/files/src/app/main/account-profile/sign-in-methods-card/sign-in-methods-card.component.ts.template +130 -0
- package/src/ng-add/files/src/app/main/home/home.component.spec.ts.template +4 -5
- package/src/ng-add/files/src/app/main/home/home.component.ts.template +1 -6
- package/src/ng-add/files/src/app/shared/guest-warning-bar/guest-warning-bar.component.html.template +15 -0
- package/src/ng-add/files/src/app/shared/guest-warning-bar/guest-warning-bar.component.scss.template +79 -0
- package/src/ng-add/files/src/app/shared/guest-warning-bar/guest-warning-bar.component.spec.ts.template +59 -0
- package/src/ng-add/files/src/app/shared/guest-warning-bar/guest-warning-bar.component.ts.template +44 -0
- package/src/ng-add/files/src/app/shared/navbar/navbar.component.html.template +45 -15
- package/src/ng-add/files/src/app/shared/navbar/navbar.component.scss.template +103 -19
- package/src/ng-add/files/src/app/shared/navbar/navbar.component.spec.ts.template +73 -9
- package/src/ng-add/files/src/app/shared/navbar/navbar.component.ts.template +46 -18
- package/src/ng-add/files/src/environments/environment.prod.ts.template +1 -0
- package/src/ng-add/files/src/environments/environment.test.ts.template +1 -0
- package/src/ng-add/files/src/environments/environment.ts.template +1 -1
- package/src/ng-add/files/tsconfig.spec.json.template +3 -1
- package/src/ng-add/index.js +7 -0
- package/src/ng-add/index.js.map +1 -1
- package/src/shared/entity-registry.d.ts +8 -0
- package/src/shared/entity-registry.js +28 -0
- package/src/shared/entity-registry.js.map +1 -0
- package/tsconfig.json +2 -2
- package/.agents/skills/publish-npm/SKILL.md +0 -37
- package/.agents/skills/publish-npm/eval.yaml +0 -32
- package/.agents/skills/publish-npm/fixtures/package-v21.json.template +0 -8
- package/.husky/commit-msg +0 -1
- package/.husky/pre-commit +0 -1
- package/.t4g/agent-memory.db +0 -0
- package/src/component/index_spec.d.ts +0 -1
- package/src/component/index_spec.js +0 -68
- package/src/component/index_spec.js.map +0 -1
- package/src/entity/index_spec.d.ts +0 -1
- package/src/entity/index_spec.js +0 -153
- package/src/entity/index_spec.js.map +0 -1
- package/src/guard/index_spec.d.ts +0 -1
- package/src/guard/index_spec.js +0 -64
- package/src/guard/index_spec.js.map +0 -1
- package/src/ng-add/files/bigquery/scripts/export_entities.py.template +0 -143
- package/src/ng-add/files/bigquery/scripts/run_query.py.template +0 -167
- package/src/ng-add/files/src/app/core/firebase/cached-listeners.service.ts.template +0 -494
- package/src/ng-add/files/src/app/core/firebase/database.service.ts.template +0 -56
- package/src/ng-add/files/src/app/core/firebase/firebase.mock.service.ts.template +0 -366
- package/src/ng-add/files/src/app/core/firebase/firebase.service.ts.template +0 -342
- package/src/ng-add/files/src/app/core/firebase/simulate-load.spec.ts.template +0 -104
- package/src/ng-add/files/src/app/core/firebase/simulate-stream.spec.ts.template +0 -127
- package/src/ng-add/files/src/app/core/firebase/simulation.mock.ts.template +0 -38
- package/src/ng-add/files/src/app/core/firebase/stream-multiplexer.ts.template +0 -445
- package/src/ng-add/files/src/app/core/logging/logging.service.spec.ts.template +0 -118
- package/src/ng-add/files/src/app/core/logging/logging.service.ts.template +0 -168
- package/src/ng-add/files/src/app/core/store/app.model.ts.template +0 -21
- package/src/ng-add/files/src/app/core/store/app.store.spec.ts.template +0 -920
- package/src/ng-add/files/src/app/core/store/app.store.ts.template +0 -1317
- package/src/ng-add/files/src/app/core/store/batch-write.firebase.service.ts.template +0 -58
- package/src/ng-add/files/src/app/core/store/batch-write.mock.service.ts.template +0 -105
- package/src/ng-add/files/src/app/core/store/batch-write.service.ts.template +0 -126
- package/src/ng-add/files/src/app/shared/redeployment-warning/redeployment-warning.component.html.template +0 -9
- package/src/ng-add/files/src/app/shared/redeployment-warning/redeployment-warning.component.scss.template +0 -46
- package/src/ng-add/files/src/app/shared/redeployment-warning/redeployment-warning.component.spec.ts.template +0 -69
- package/src/ng-add/files/src/app/shared/redeployment-warning/redeployment-warning.component.ts.template +0 -39
- package/src/ng-add/files/src/app/shared/redeployment-warning/redeployment-warning.service.spec.ts.template +0 -122
- package/src/ng-add/files/src/app/shared/redeployment-warning/redeployment-warning.service.ts.template +0 -88
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, computed, ElementRef, input, signal, viewChild, OnInit } from '@angular/core';
|
|
2
|
+
import { MatTableModule } from '@angular/material/table';
|
|
3
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
4
|
+
import { MatInputModule } from '@angular/material/input';
|
|
5
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
6
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
7
|
+
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
8
|
+
import { DecimalPipe, DatePipe } from '@angular/common';
|
|
9
|
+
|
|
10
|
+
export interface TableColumn {
|
|
11
|
+
key: string;
|
|
12
|
+
label: string;
|
|
13
|
+
format?: 'text' | 'number' | 'percent' | 'duration' | 'datetime';
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@Component({
|
|
17
|
+
selector: 'analytics-dashboard-table',
|
|
18
|
+
imports: [
|
|
19
|
+
MatTableModule,
|
|
20
|
+
MatFormFieldModule,
|
|
21
|
+
MatInputModule,
|
|
22
|
+
MatIconModule,
|
|
23
|
+
MatButtonModule,
|
|
24
|
+
MatTooltipModule,
|
|
25
|
+
DecimalPipe,
|
|
26
|
+
],
|
|
27
|
+
providers: [DatePipe],
|
|
28
|
+
templateUrl: './dashboard-table.component.html',
|
|
29
|
+
styleUrl: './dashboard-table.component.scss',
|
|
30
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
31
|
+
})
|
|
32
|
+
export class DashboardTableComponent implements OnInit {
|
|
33
|
+
readonly title = input.required<string>();
|
|
34
|
+
readonly subtitle = input.required<string>();
|
|
35
|
+
readonly columns = input.required<TableColumn[]>();
|
|
36
|
+
readonly rows = input.required<Record<string, unknown>[]>();
|
|
37
|
+
readonly sortable = input(false);
|
|
38
|
+
readonly routeFilter = input(false);
|
|
39
|
+
readonly initialSortKey = input<string | null>(null);
|
|
40
|
+
readonly initialSortDirection = input<'asc' | 'desc'>('desc');
|
|
41
|
+
|
|
42
|
+
readonly sortKey = signal<string | null>(null);
|
|
43
|
+
readonly sortDirection = signal<'asc' | 'desc'>('desc');
|
|
44
|
+
readonly routeFilterText = signal('');
|
|
45
|
+
readonly routeFilterOpen = signal(false);
|
|
46
|
+
|
|
47
|
+
readonly routeFilterInput = viewChild<ElementRef<HTMLInputElement>>('routeFilterInput');
|
|
48
|
+
|
|
49
|
+
constructor(private datePipe: DatePipe) {
|
|
50
|
+
// Initialize sort states when inputs change? No, we just need to set them initially.
|
|
51
|
+
// We can use an effect, or just initialize them in ngOnInit, but signals with initial values can just be initialized in constructor using the inputs? Wait, inputs aren't available in constructor before Angular 16, but with signal inputs they can be used in an effect or computed. Wait, we can just use computed or initialized signals.
|
|
52
|
+
// Actually, setting the initial sort state can be done by a computed or just writing to the signal. Let's just use effect or lifecycle hook.
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
ngOnInit() {
|
|
56
|
+
this.sortKey.set(this.initialSortKey());
|
|
57
|
+
this.sortDirection.set(this.initialSortDirection());
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
tableColumns(): string[] {
|
|
61
|
+
return this.columns().map((column) => column.key);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
tableRows(): Array<Record<string, unknown>> {
|
|
65
|
+
const filter = this.routeFilterText().trim().toLocaleLowerCase();
|
|
66
|
+
const filtered = this.routeFilter() && filter ?
|
|
67
|
+
this.rows().filter((row) =>
|
|
68
|
+
String(row['route'] || '').toLocaleLowerCase().includes(filter),
|
|
69
|
+
) :
|
|
70
|
+
this.rows();
|
|
71
|
+
|
|
72
|
+
if (!this.sortable()) return filtered;
|
|
73
|
+
|
|
74
|
+
const key = this.sortKey() || this.columns()[0]?.key;
|
|
75
|
+
if (!key) return filtered;
|
|
76
|
+
const column = this.columns().find((candidate) => candidate.key === key);
|
|
77
|
+
const direction = this.sortDirection() === 'asc' ? 1 : -1;
|
|
78
|
+
|
|
79
|
+
return [...filtered].sort((left, right) => {
|
|
80
|
+
const leftValue = left[key];
|
|
81
|
+
const rightValue = right[key];
|
|
82
|
+
if (leftValue === rightValue) return 0;
|
|
83
|
+
if (leftValue === null || leftValue === undefined) return 1;
|
|
84
|
+
if (rightValue === null || rightValue === undefined) return -1;
|
|
85
|
+
if (
|
|
86
|
+
column?.format === 'number' ||
|
|
87
|
+
column?.format === 'duration' ||
|
|
88
|
+
column?.format === 'percent' ||
|
|
89
|
+
column?.format === 'datetime'
|
|
90
|
+
) {
|
|
91
|
+
return direction * (Number(leftValue) - Number(rightValue));
|
|
92
|
+
}
|
|
93
|
+
return direction * String(leftValue).localeCompare(String(rightValue));
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
setRouteFilter(value: string): void {
|
|
98
|
+
this.routeFilterText.set(value);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
toggleRouteFilter(): void {
|
|
102
|
+
if (this.routeFilterOpen()) {
|
|
103
|
+
this.routeFilterText.set('');
|
|
104
|
+
this.routeFilterOpen.set(false);
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
this.routeFilterOpen.set(true);
|
|
108
|
+
setTimeout(() => this.routeFilterInput()?.nativeElement.focus());
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
sortTable(column: TableColumn): void {
|
|
112
|
+
if (this.sortKey() === column.key) {
|
|
113
|
+
this.sortDirection.set(this.sortDirection() === 'asc' ? 'desc' : 'asc');
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
this.sortKey.set(column.key);
|
|
117
|
+
this.sortDirection.set(
|
|
118
|
+
column.format === 'text' || !column.format ? 'asc' : 'desc',
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
sortIndicator(column: TableColumn): string {
|
|
123
|
+
if (this.sortKey() !== column.key) return '';
|
|
124
|
+
return this.sortDirection() === 'asc' ? '↑' : '↓';
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
displayValue(row: Record<string, unknown>, column: TableColumn): string {
|
|
128
|
+
const value = row[column.key];
|
|
129
|
+
if (value === null || value === undefined || value === '') return '—';
|
|
130
|
+
switch (column.format) {
|
|
131
|
+
case 'number':
|
|
132
|
+
return new Intl.NumberFormat(
|
|
133
|
+
'en-US',
|
|
134
|
+
{ maximumFractionDigits: 1 },
|
|
135
|
+
).format(Number(value));
|
|
136
|
+
case 'percent':
|
|
137
|
+
return new Intl.NumberFormat('en-US', {
|
|
138
|
+
style: 'percent',
|
|
139
|
+
maximumFractionDigits: 1,
|
|
140
|
+
}).format(Number(value));
|
|
141
|
+
case 'duration': {
|
|
142
|
+
const numeric = Number(value);
|
|
143
|
+
return numeric >= 120 ?
|
|
144
|
+
`${(numeric / 60).toFixed(1)} min` :
|
|
145
|
+
`${numeric.toFixed(1)} sec`;
|
|
146
|
+
}
|
|
147
|
+
case 'datetime':
|
|
148
|
+
return this.datePipe.transform(Number(value), 'MMM d, y · h:mm a') || '—';
|
|
149
|
+
default:
|
|
150
|
+
return String(value).replaceAll('_', ' ');
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<article class="chart-card">
|
|
2
|
+
<div class="card-heading">
|
|
3
|
+
<div>
|
|
4
|
+
<h2>{{ title() }}</h2>
|
|
5
|
+
<p>{{ subtitle() }}</p>
|
|
6
|
+
</div>
|
|
7
|
+
</div>
|
|
8
|
+
<analytics-vega-chart [spec]="spec()" [ariaLabel]="title() + ' funnel'" />
|
|
9
|
+
@if (stageHelp().length) {
|
|
10
|
+
<div class="stage-axis" aria-label="Journey stages">
|
|
11
|
+
@for (stage of stageHelp(); track stage.label) {
|
|
12
|
+
<button type="button" class="stage-axis-label" [matTooltip]="stage.description" matTooltipPosition="below" [attr.aria-label]="stage.label + ': ' + stage.description">{{ stage.label }}</button>
|
|
13
|
+
}
|
|
14
|
+
</div>
|
|
15
|
+
}
|
|
16
|
+
</article>
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
.chart-card {
|
|
2
|
+
border: 1px solid #e0e4de;
|
|
3
|
+
border-radius: 16px;
|
|
4
|
+
background: rgba(255, 255, 255, 0.86);
|
|
5
|
+
box-shadow: 0 8px 26px rgba(38, 53, 45, 0.035);
|
|
6
|
+
min-width: 0;
|
|
7
|
+
padding: 22px 22px 15px;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.card-heading {
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: flex-start;
|
|
13
|
+
justify-content: space-between;
|
|
14
|
+
gap: 16px;
|
|
15
|
+
min-height: 57px;
|
|
16
|
+
margin-bottom: 10px;
|
|
17
|
+
|
|
18
|
+
h2 {
|
|
19
|
+
margin: 0;
|
|
20
|
+
color: #28382f;
|
|
21
|
+
font-size: 14px;
|
|
22
|
+
font-weight: 750;
|
|
23
|
+
letter-spacing: -0.01em;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
p {
|
|
27
|
+
max-width: 620px;
|
|
28
|
+
margin: 5px 0 0;
|
|
29
|
+
color: #89928c;
|
|
30
|
+
font-size: 10.5px;
|
|
31
|
+
line-height: 1.5;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.stage-axis {
|
|
36
|
+
display: grid;
|
|
37
|
+
grid-auto-columns: minmax(0, 1fr);
|
|
38
|
+
grid-auto-flow: column;
|
|
39
|
+
gap: 4px;
|
|
40
|
+
margin: -6px 2px 2px 40px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.stage-axis-label {
|
|
44
|
+
overflow: hidden;
|
|
45
|
+
border: 0;
|
|
46
|
+
background: transparent;
|
|
47
|
+
padding: 4px 2px;
|
|
48
|
+
color: #647068;
|
|
49
|
+
cursor: help;
|
|
50
|
+
font: inherit;
|
|
51
|
+
font-size: 10px;
|
|
52
|
+
line-height: 1.25;
|
|
53
|
+
text-align: center;
|
|
54
|
+
text-decoration: underline dotted #a6b0a8;
|
|
55
|
+
text-underline-offset: 3px;
|
|
56
|
+
text-overflow: ellipsis;
|
|
57
|
+
white-space: nowrap;
|
|
58
|
+
|
|
59
|
+
&:focus-visible {
|
|
60
|
+
outline: 2px solid #5f9a73;
|
|
61
|
+
outline-offset: 2px;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';
|
|
2
|
+
import { VisualizationSpec } from 'vega-embed';
|
|
3
|
+
import { VegaChartComponent } from '../../vega-chart/vega-chart.component';
|
|
4
|
+
import { baseSpec, palette } from '../chart-theme';
|
|
5
|
+
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
6
|
+
|
|
7
|
+
@Component({
|
|
8
|
+
selector: 'analytics-funnel-chart',
|
|
9
|
+
imports: [VegaChartComponent, MatTooltipModule],
|
|
10
|
+
templateUrl: './funnel-chart.component.html',
|
|
11
|
+
styleUrl: './funnel-chart.component.scss',
|
|
12
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
13
|
+
})
|
|
14
|
+
export class FunnelChartComponent {
|
|
15
|
+
readonly title = input.required<string>();
|
|
16
|
+
readonly subtitle = input.required<string>();
|
|
17
|
+
readonly rows = input.required<Record<string, unknown>[]>();
|
|
18
|
+
readonly stageHelp = input<{label: string, description: string}[]>([]);
|
|
19
|
+
|
|
20
|
+
readonly spec = computed(() => {
|
|
21
|
+
return {
|
|
22
|
+
...baseSpec(),
|
|
23
|
+
height: 240,
|
|
24
|
+
data: { values: this.rows() },
|
|
25
|
+
mark: { type: 'bar', cornerRadiusTopLeft: 5, cornerRadiusTopRight: 5 },
|
|
26
|
+
encoding: {
|
|
27
|
+
x: {
|
|
28
|
+
field: 'stage',
|
|
29
|
+
type: 'nominal',
|
|
30
|
+
sort: { field: 'stage_order', order: 'ascending' },
|
|
31
|
+
axis: { title: null, labels: false, ticks: false },
|
|
32
|
+
},
|
|
33
|
+
y: {
|
|
34
|
+
field: 'journeys',
|
|
35
|
+
type: 'quantitative',
|
|
36
|
+
axis: { title: 'Distinct journeys', tickMinStep: 1 },
|
|
37
|
+
},
|
|
38
|
+
color: {
|
|
39
|
+
field: 'conversion_from_cohort',
|
|
40
|
+
type: 'quantitative',
|
|
41
|
+
legend: null,
|
|
42
|
+
scale: { range: ['#d7e3da', palette.forest] },
|
|
43
|
+
},
|
|
44
|
+
tooltip: [
|
|
45
|
+
{ field: 'stage', type: 'nominal', title: 'Stage' },
|
|
46
|
+
{ field: 'journeys', type: 'quantitative', title: 'Distinct journeys', format: ',' },
|
|
47
|
+
{ field: 'conversion_from_cohort', type: 'quantitative', title: 'Retained from cohort', format: '.1%' },
|
|
48
|
+
],
|
|
49
|
+
},
|
|
50
|
+
} as VisualizationSpec;
|
|
51
|
+
});
|
|
52
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
@use '@angular/material' as mat;
|
|
2
|
+
|
|
3
|
+
.metric-card {
|
|
4
|
+
position: relative;
|
|
5
|
+
min-height: 132px;
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
border: 1px solid #e0e4de;
|
|
8
|
+
border-radius: 14px;
|
|
9
|
+
background: rgba(255, 255, 255, 0.82);
|
|
10
|
+
padding: 19px 20px;
|
|
11
|
+
|
|
12
|
+
&::before {
|
|
13
|
+
position: absolute;
|
|
14
|
+
top: 0;
|
|
15
|
+
bottom: 0;
|
|
16
|
+
left: 0;
|
|
17
|
+
width: 3px;
|
|
18
|
+
background: #9bab9f;
|
|
19
|
+
content: '';
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&.positive::before {
|
|
23
|
+
background: #4c956c;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&.warning::before {
|
|
27
|
+
background: #ca8b3e;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
p {
|
|
31
|
+
margin: 0;
|
|
32
|
+
color: #727d75;
|
|
33
|
+
font-size: 11px;
|
|
34
|
+
font-weight: 700;
|
|
35
|
+
letter-spacing: 0.02em;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
strong {
|
|
39
|
+
display: block;
|
|
40
|
+
overflow: hidden;
|
|
41
|
+
margin: 11px 0 8px;
|
|
42
|
+
color: #26352d;
|
|
43
|
+
font-family: Georgia, 'Times New Roman', serif;
|
|
44
|
+
font-size: clamp(23px, 2.4vw, 34px);
|
|
45
|
+
font-weight: 500;
|
|
46
|
+
letter-spacing: -0.035em;
|
|
47
|
+
text-overflow: ellipsis;
|
|
48
|
+
white-space: nowrap;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
small {
|
|
52
|
+
color: #8b948e;
|
|
53
|
+
font-size: 10px;
|
|
54
|
+
line-height: 1.4;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { render } from '@testing-library/angular';
|
|
2
|
+
import userEvent from '@testing-library/user-event';
|
|
3
|
+
import { MetricCardComponent } from './metric-card.component';
|
|
4
|
+
|
|
5
|
+
/** Sets up the testing environment for MetricCardComponent using render. */
|
|
6
|
+
async function setup() {
|
|
7
|
+
const user = userEvent.setup();
|
|
8
|
+
|
|
9
|
+
const view = await render(MetricCardComponent, {
|
|
10
|
+
imports: [],
|
|
11
|
+
componentInputs: {
|
|
12
|
+
label: 'Test Label',
|
|
13
|
+
value: '42',
|
|
14
|
+
note: 'Test Note',
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
return {
|
|
19
|
+
user,
|
|
20
|
+
fixture: view.fixture,
|
|
21
|
+
rerender: () => view.rerender(),
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
describe('MetricCardComponent', () => {
|
|
26
|
+
it('should create', async () => {
|
|
27
|
+
const { fixture } = await setup();
|
|
28
|
+
expect(fixture.componentInstance).toBeTruthy();
|
|
29
|
+
});
|
|
30
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, input } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Component({
|
|
4
|
+
selector: 'analytics-metric-card',
|
|
5
|
+
imports: [],
|
|
6
|
+
templateUrl: './metric-card.component.html',
|
|
7
|
+
styleUrl: './metric-card.component.scss',
|
|
8
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
9
|
+
})
|
|
10
|
+
export class MetricCardComponent {
|
|
11
|
+
readonly label = input.required<string>();
|
|
12
|
+
readonly value = input.required<string>();
|
|
13
|
+
readonly note = input.required<string>();
|
|
14
|
+
readonly tone = input<'positive' | 'warning'>();
|
|
15
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<article class="chart-card wide">
|
|
2
|
+
<div class="card-heading">
|
|
3
|
+
<div>
|
|
4
|
+
<h2>Diagnostics by check</h2>
|
|
5
|
+
<p>Warnings remain visible even when they describe historical telemetry.</p>
|
|
6
|
+
</div>
|
|
7
|
+
</div>
|
|
8
|
+
<analytics-vega-chart [spec]="spec()" ariaLabel="Data-quality diagnostic counts" />
|
|
9
|
+
</article>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
.chart-card {
|
|
2
|
+
border: 1px solid #e0e4de;
|
|
3
|
+
border-radius: 16px;
|
|
4
|
+
background: rgba(255, 255, 255, 0.86);
|
|
5
|
+
box-shadow: 0 8px 26px rgba(38, 53, 45, 0.035);
|
|
6
|
+
min-width: 0;
|
|
7
|
+
padding: 22px 22px 15px;
|
|
8
|
+
|
|
9
|
+
&.wide {
|
|
10
|
+
grid-column: 1 / -1;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.card-heading {
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: flex-start;
|
|
17
|
+
justify-content: space-between;
|
|
18
|
+
gap: 16px;
|
|
19
|
+
min-height: 57px;
|
|
20
|
+
margin-bottom: 10px;
|
|
21
|
+
|
|
22
|
+
h2 {
|
|
23
|
+
margin: 0;
|
|
24
|
+
color: #28382f;
|
|
25
|
+
font-size: 14px;
|
|
26
|
+
font-weight: 750;
|
|
27
|
+
letter-spacing: -0.01em;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
p {
|
|
31
|
+
max-width: 620px;
|
|
32
|
+
margin: 5px 0 0;
|
|
33
|
+
color: #89928c;
|
|
34
|
+
font-size: 10.5px;
|
|
35
|
+
line-height: 1.5;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@media (max-width: 760px) {
|
|
40
|
+
.chart-card.wide {
|
|
41
|
+
grid-column: auto;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';
|
|
2
|
+
import { VisualizationSpec } from 'vega-embed';
|
|
3
|
+
import { VegaChartComponent } from '../../vega-chart/vega-chart.component';
|
|
4
|
+
import { baseSpec, palette } from '../chart-theme';
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: 'analytics-quality-chart',
|
|
8
|
+
imports: [VegaChartComponent],
|
|
9
|
+
templateUrl: './quality-chart.component.html',
|
|
10
|
+
styleUrl: './quality-chart.component.scss',
|
|
11
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
12
|
+
})
|
|
13
|
+
export class QualityChartComponent {
|
|
14
|
+
readonly rows = input.required<Record<string, unknown>[]>();
|
|
15
|
+
|
|
16
|
+
readonly spec = computed(() => {
|
|
17
|
+
const qualityRows = this.rows().filter((r) => r['severity'] !== 'info');
|
|
18
|
+
return {
|
|
19
|
+
...baseSpec(),
|
|
20
|
+
height: Math.max(220, qualityRows.length * 34),
|
|
21
|
+
data: { values: qualityRows },
|
|
22
|
+
encoding: {
|
|
23
|
+
y: {
|
|
24
|
+
field: 'metric',
|
|
25
|
+
type: 'nominal',
|
|
26
|
+
sort: '-x',
|
|
27
|
+
axis: { title: null, labelLimit: 360 },
|
|
28
|
+
},
|
|
29
|
+
x: {
|
|
30
|
+
field: 'value',
|
|
31
|
+
type: 'quantitative',
|
|
32
|
+
axis: { title: 'Rows', tickMinStep: 1 },
|
|
33
|
+
},
|
|
34
|
+
color: {
|
|
35
|
+
field: 'severity',
|
|
36
|
+
type: 'nominal',
|
|
37
|
+
scale: {
|
|
38
|
+
domain: ['error', 'warning', 'info'],
|
|
39
|
+
range: [palette.clay, palette.gold, palette.mint],
|
|
40
|
+
},
|
|
41
|
+
legend: { title: null },
|
|
42
|
+
},
|
|
43
|
+
tooltip: [
|
|
44
|
+
{ field: 'metric', type: 'nominal', title: 'Check' },
|
|
45
|
+
{ field: 'value', type: 'quantitative', title: 'Rows', format: ',' },
|
|
46
|
+
{ field: 'detail', type: 'nominal', title: 'Meaning' },
|
|
47
|
+
],
|
|
48
|
+
},
|
|
49
|
+
layer: [
|
|
50
|
+
{
|
|
51
|
+
mark: { type: 'bar', cornerRadiusEnd: 4 },
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
mark: { type: 'text', align: 'left', dx: 6, fontSize: 11, fontWeight: 650, color: '#455248' },
|
|
55
|
+
encoding: {
|
|
56
|
+
text: { field: 'value', type: 'quantitative', format: ',' },
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
} as VisualizationSpec;
|
|
61
|
+
});
|
|
62
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<article class="chart-card">
|
|
2
|
+
<div class="card-heading">
|
|
3
|
+
<div>
|
|
4
|
+
<h2>Typical active-time range</h2>
|
|
5
|
+
<p>Interquartile range with median marker across recorded visits.</p>
|
|
6
|
+
</div>
|
|
7
|
+
</div>
|
|
8
|
+
<analytics-vega-chart [spec]="spec()" ariaLabel="Interval plot of active time quartiles by route" />
|
|
9
|
+
</article>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
.chart-card {
|
|
2
|
+
border: 1px solid #e0e4de;
|
|
3
|
+
border-radius: 16px;
|
|
4
|
+
background: rgba(255, 255, 255, 0.86);
|
|
5
|
+
box-shadow: 0 8px 26px rgba(38, 53, 45, 0.035);
|
|
6
|
+
min-width: 0;
|
|
7
|
+
padding: 22px 22px 15px;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.card-heading {
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: flex-start;
|
|
13
|
+
justify-content: space-between;
|
|
14
|
+
gap: 16px;
|
|
15
|
+
min-height: 57px;
|
|
16
|
+
margin-bottom: 10px;
|
|
17
|
+
|
|
18
|
+
h2 {
|
|
19
|
+
margin: 0;
|
|
20
|
+
color: #28382f;
|
|
21
|
+
font-size: 14px;
|
|
22
|
+
font-weight: 750;
|
|
23
|
+
letter-spacing: -0.01em;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
p {
|
|
27
|
+
max-width: 620px;
|
|
28
|
+
margin: 5px 0 0;
|
|
29
|
+
color: #89928c;
|
|
30
|
+
font-size: 10.5px;
|
|
31
|
+
line-height: 1.5;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';
|
|
2
|
+
import { VisualizationSpec } from 'vega-embed';
|
|
3
|
+
import { VegaChartComponent } from '../../vega-chart/vega-chart.component';
|
|
4
|
+
import { baseSpec, palette } from '../chart-theme';
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: 'analytics-route-distribution-chart',
|
|
8
|
+
imports: [VegaChartComponent],
|
|
9
|
+
templateUrl: './route-distribution-chart.component.html',
|
|
10
|
+
styleUrl: './route-distribution-chart.component.scss',
|
|
11
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
12
|
+
})
|
|
13
|
+
export class RouteDistributionChartComponent {
|
|
14
|
+
readonly rows = input.required<Record<string, unknown>[]>();
|
|
15
|
+
|
|
16
|
+
readonly spec = computed(() => {
|
|
17
|
+
const routeRows = this.rows();
|
|
18
|
+
return {
|
|
19
|
+
...baseSpec(),
|
|
20
|
+
height: Math.max(240, Math.min(routeRows.length, 14) * 28),
|
|
21
|
+
data: { values: routeRows.slice(0, 14) },
|
|
22
|
+
encoding: {
|
|
23
|
+
y: {
|
|
24
|
+
field: 'route',
|
|
25
|
+
type: 'nominal',
|
|
26
|
+
sort: { field: 'median_active_seconds', order: 'descending' },
|
|
27
|
+
axis: { title: null, labelLimit: 210 },
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
layer: [
|
|
31
|
+
{
|
|
32
|
+
mark: {
|
|
33
|
+
type: 'rule',
|
|
34
|
+
strokeWidth: 7,
|
|
35
|
+
strokeCap: 'round',
|
|
36
|
+
color: palette.mint,
|
|
37
|
+
},
|
|
38
|
+
encoding: {
|
|
39
|
+
x: {
|
|
40
|
+
field: 'q1_active_seconds',
|
|
41
|
+
type: 'quantitative',
|
|
42
|
+
axis: { title: 'Active seconds' },
|
|
43
|
+
},
|
|
44
|
+
x2: { field: 'q3_active_seconds' },
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
mark: {
|
|
49
|
+
type: 'tick',
|
|
50
|
+
thickness: 3,
|
|
51
|
+
size: 18,
|
|
52
|
+
color: palette.forest,
|
|
53
|
+
},
|
|
54
|
+
encoding: {
|
|
55
|
+
x: { field: 'median_active_seconds', type: 'quantitative' },
|
|
56
|
+
tooltip: [
|
|
57
|
+
{ field: 'route', type: 'nominal', title: 'Route' },
|
|
58
|
+
{
|
|
59
|
+
field: 'q1_active_seconds',
|
|
60
|
+
type: 'quantitative',
|
|
61
|
+
title: '25th percentile',
|
|
62
|
+
format: '.1f',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
field: 'median_active_seconds',
|
|
66
|
+
type: 'quantitative',
|
|
67
|
+
title: 'Median',
|
|
68
|
+
format: '.1f',
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
field: 'q3_active_seconds',
|
|
72
|
+
type: 'quantitative',
|
|
73
|
+
title: '75th percentile',
|
|
74
|
+
format: '.1f',
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
} as VisualizationSpec;
|
|
81
|
+
});
|
|
82
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<article class="chart-card">
|
|
2
|
+
<div class="card-heading">
|
|
3
|
+
<div>
|
|
4
|
+
<h2>Traffic and typical attention</h2>
|
|
5
|
+
<p>Bars are recorded visits with positive active time; dots are median active time. Select a route to link the statistics below.</p>
|
|
6
|
+
</div>
|
|
7
|
+
<span class="interactive-badge">Interactive</span>
|
|
8
|
+
</div>
|
|
9
|
+
<analytics-vega-chart
|
|
10
|
+
[spec]="spec()"
|
|
11
|
+
ariaLabel="Layered chart of visits and median active time by normalized route"
|
|
12
|
+
[signalNames]="['route_pick']"
|
|
13
|
+
(selectionChange)="selectionChange.emit($event)"
|
|
14
|
+
/>
|
|
15
|
+
</article>
|