data-suggestions 1.0.2 → 2.0.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.
@@ -1 +1 @@
1
- {"version":3,"file":"data-suggestions.mjs","sources":["../../../projects/data-suggestions/src/lib/config/visual-variable-index-map.ts","../../../projects/data-suggestions/src/lib/config/communication-goals.config.ts","../../../projects/data-suggestions/src/lib/model/chartsModels.ts","../../../projects/data-suggestions/src/lib/services/communicationRule/CommunicationRulesService.ts","../../../projects/data-suggestions/src/lib/services/data-suggestions-service/data-suggestions.ts","../../../projects/data-suggestions/src/lib/services/communication-goals/communication-goals.service.ts","../../../projects/data-suggestions/src/lib/bar-chart/bar-chart.ts","../../../projects/data-suggestions/src/lib/bar-chart/bar-chart.html","../../../projects/data-suggestions/src/lib/data-suggestions-table/data-suggestions-table.ts","../../../projects/data-suggestions/src/lib/data-suggestions-table/data-suggestions-table.html","../../../projects/data-suggestions/src/public-api.ts","../../../projects/data-suggestions/src/data-suggestions.ts"],"sourcesContent":["/**\n * Exact `visualVariable` names as in JSON → display order in the table.\n * Edit this object to change ordering; keys must match the JSON strings.\n */\nexport const VISUAL_VARIABLE_INDEX_BY_NAME: Readonly<Record<string, number>> = {\n 'Bar direction': 1,\n 'Order': 2,\n 'Labels': 3,\n 'Grid lines': 4,\n 'Axis maximum': 5,\n 'Number of steps': 6,\n 'Opacity': 7,\n 'Spacing between bars': 8,\n 'Color palette': 9,\n 'Border color': 10,\n 'Hover behavior': 11,\n};\n\n/** Returns configured index after trim, or undefined if not listed. */\nexport function getConfiguredVisualVariableIndex(visualVariable: string): number | undefined {\n const key = visualVariable.trim();\n const v = VISUAL_VARIABLE_INDEX_BY_NAME[key];\n return v !== undefined ? v : undefined;\n}\n","import { CommunicationGoalOption } from '../types';\n\nexport interface CommunicationGoalDefinition {\n index: number;\n label: string;\n /** Must match `assets/recomendaciones/<jsonSlug>.json`. */\n jsonSlug: string;\n}\n\n/**\n * Single catalog of communication goals and their rules JSON.\n * Host apps should use `CommunicationGoalsService` instead of duplicating this list.\n */\nexport const COMMUNICATION_GOAL_DEFINITIONS: readonly CommunicationGoalDefinition[] = [\n {\n index: 1,\n label: 'Count how many times a given value is repeated',\n jsonSlug: 'count-times-that-a-certain-value-is-repeated',\n },\n {\n index: 2,\n label: 'Count how many times a threshold is exceeded',\n jsonSlug: 'count-times-a-certain-value-is-exceeded',\n },\n {\n index: 3,\n label: 'Count how many times values stay below a threshold',\n jsonSlug: 'count-times-does-not-exceed-a-certain-value',\n },\n {\n index: 4,\n label: 'Highlight a specific value',\n jsonSlug: 'highlight-a-value',\n },\n {\n index: 5,\n label: 'Highlight the highest value',\n jsonSlug: 'highlight-the-highest-value',\n },\n {\n index: 6,\n label: 'Highlight the lowest value',\n jsonSlug: 'highlight-the-lowest-value',\n },\n {\n index: 7,\n label: 'Highlight higher values',\n jsonSlug: 'highlight-higher-values',\n },\n {\n index: 8,\n label: 'Highlight lower values',\n jsonSlug: 'highlight-lower-values',\n },\n] as const;\n\nexport function definitionsToBaseOptions(): CommunicationGoalOption[] {\n return COMMUNICATION_GOAL_DEFINITIONS.map((g) => ({\n index: g.index,\n value: g.label,\n json: g.jsonSlug,\n }));\n}\n","import { Injectable } from '@angular/core';\nimport { ReglaVisual } from '../services/communicationRule/CommunicationRulesService';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class chartsModel {\n data: any;\n dataSize: string = '';\n dataVariability: string = '';\n suggestedGraph: string = '';\n communicationGoal: number = 0;\n communicationGoalsOptions = [\n { index: 1, value: 'Count occurrences of a specific value' },\n { index: 2, value: 'Count occurrences of the maximum value' },\n { index: 3, value: 'Count occurrences of the minimum value' },\n { index: 4, value: 'Identify a specific value' },\n { index: 5, value: 'Identify the maximum value' },\n { index: 6, value: 'Identify the second highest value' },\n { index: 7, value: 'Identify the third highest value' },\n { index: 8, value: 'Identify the minimum value' },\n { index: 9, value: 'Identify the second lowest value' },\n { index: 10, value: 'Identify the third lowest value' },\n ];\n\n/** filesOptions = [\n { label: 'Gasolina en ciudades', fileName: 'gasolinaCiudades' }, //muy pequeño con poca variabilidad\n {\n label: 'Temperatura en oficinas',\n fileName: 'temperaturaMediaEnOficinas',\n }, //muy pequeño con poca variabilidad\n {\n label: 'Ventas diarias de limonada',\n fileName: 'ventasDiariasDeLimonada',\n }, //muy pequeño con variabilidad media\n {\n label: 'Duración llamadas en call center',\n fileName: 'duracionLlamadasCallCenter',\n }, //muy pequeño con variabilidad alta\n {\n label: 'Nivel de ruido en bibliotecas',\n fileName: 'nivelRuidoEnBibliotecas',\n }, //pequeño con variabilidad baja\n {\n label: 'Consumo de agua por hogar (L/día)',\n fileName: 'consumoAgua',\n }, //pequeño con variabilidad media\n {\n label: 'Horas dedicadas al gaming semanalmente',\n fileName: 'horasGaming',\n }, //pequeño con variabilidad alta\n {\n label: 'Tiempo de carga de una app (ms)',\n fileName: 'tiemposCarga',\n }, //medio con variabilidad baja\n {\n label: 'Distancia diaria Recorrida (km)',\n fileName: 'distanciaDiaria',\n }, //medio con variabilidad medial\n {\n label: 'Ingresos semanales de freelancers',\n fileName: 'ingresosSemanales',\n }, //medio con variabilidad alta\n {\n label: 'Nivel de batería de sensores IoT',\n fileName: 'nivelBateria',\n }, //grande con variabilidad baja\n {\n label: 'Tiempo de ejercicio diario (minutos)',\n fileName: 'tiempoEjercicio',\n }, //grande con variabilidad medial\n {\n label: 'Tiempo de carga de vehículos eléctricos (min)',\n fileName: 'tiempoCarga',\n }, //grande con variabilidad alta\n ];*/\n\n // selectedFile: any;\n\n rules: ReglaVisual[] = [];\n\n generatedRules: boolean = false;\n // recommendations: string[] = [];\n\n chartLabels: string[] = [];\n chartValues: number[] = [];\n\n orientation: 'Vertical' | 'Horizontal' = 'Vertical';\n\n //HABRIA QUE EDCIR QUE PASA CON LOS DE QUE SON a 0 B yo voy a ahcer de momento que sea el intermedio\n incrementoMaximo: number = 0; //voy a guardar por lo que hay multiplicar el valor mas alto para obtener el máximo\n numeroPasos: number = 10;\n auxiliarLines: boolean = false;\n opacity: number | undefined;\n ordered:boolean = false;\n labels: boolean = false\n separation:'none' | 'close' | 'medium' | 'wide' = 'medium';\n colorPalette:'single' | 'sequential' | 'categorical' = 'single'\n borderColor: \"Light border\" | \"Dark border\" | \"Same color as the bar\" | \"No border\" | \"Indifferent\" | \"Dark border or no border\" = \"Indifferent\"\n hoverRec:'none' | 'default' | 'intensify' | 'different' = 'default'\n showingInDialog:'data' | 'variables' | 'readme' | 'suggestions' |'communicationGoals' = 'suggestions';\n\n constructor() {}\n}\n","import { Injectable } from '@angular/core';\nimport { HttpClient } from '@angular/common/http';\nimport { catchError, forkJoin, map, Observable, of, tap } from 'rxjs';\nimport { chartsModel } from '../../model/chartsModels';\n\n/** Normalizes en/em dashes in sample-size labels so JSON matches computed stats. */\nexport function normalizeSampleSizeLabel(s: string | null | undefined): string {\n if (s == null) return '';\n return String(s)\n .replace(/\\u2013/g, '-')\n .replace(/\\u2014/g, '-')\n .trim();\n}\n\nexport interface ReglaVisual {\n index?: number | null;\n order?: number | null;\n visualVariable: string | null;\n sampleSize: string | null;\n variability: string | null;\n recommendation: string | null;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class CommunicationRulesService {\n private basePath = 'assets/recomendaciones/';\n\n constructor(\n private http: HttpClient,\n private readonly chartsModel: chartsModel,\n ) {}\n\n private loadJsonForGoal(goal: string): Observable<ReglaVisual[]> {\n const file = `${this.basePath}${goal}.json`;\n return this.http.get<ReglaVisual[]>(file);\n }\n\n /** All rules from `assets/recomendaciones/<goal>.json` (unfiltered). */\n getRulesForGoal(goal: string): Observable<ReglaVisual[]> {\n return this.loadJsonForGoal(goal).pipe(\n tap(() => {\n this.chartsModel.generatedRules = true;\n }),\n );\n }\n\n /**\n * Rules that match communication goal, sample size, and variability\n * (sample size labels are normalized, e.g. `10–19` vs `10-19`).\n */\n getRecomendaciones(\n goal: string,\n sampleSize: string,\n variability: string,\n ): Observable<ReglaVisual[]> {\n const wantSize = normalizeSampleSizeLabel(sampleSize);\n return this.getRulesForGoal(goal).pipe(\n map((reglas) =>\n reglas.filter(\n (r) =>\n normalizeSampleSizeLabel(r.sampleSize) === wantSize &&\n r.variability === variability &&\n !!r.recommendation,\n ),\n ),\n );\n }\n\n getRecommendationsCount(goal: string): Observable<number> {\n return this.http.get<unknown[]>(`${this.basePath}${goal}.json`).pipe(\n map((arr) => arr?.length ?? 0),\n catchError(() => of(0)),\n );\n }\n\n getCountsForGoals(goals: string[]): Observable<Record<string, number>> {\n const unique = [...new Set(goals)];\n const requests = unique.map((goal) =>\n this.getRecommendationsCount(goal).pipe(map((count) => ({ goal, count }))),\n );\n\n return forkJoin(requests).pipe(\n map((pairs) =>\n pairs.reduce(\n (acc, { goal, count }) => {\n acc[goal] = count;\n return acc;\n },\n {} as Record<string, number>,\n ),\n ),\n );\n }\n}\n","// projects/data-suggestions/src/lib/data-suggestions.service.ts\nimport { Injectable } from '@angular/core';\nimport { Observable, map } from 'rxjs';\n\nimport { DataPoint, SuggestionRow, SuggestionsResult } from '../../types';\nimport { VISUAL_VARIABLE_INDEX_BY_NAME } from '../../config/visual-variable-index-map';\nimport {\n CommunicationRulesService,\n normalizeSampleSizeLabel,\n ReglaVisual,\n} from '../communicationRule/CommunicationRulesService';\n\nfunction parseRuleIndex(raw: unknown, fallback: number): number {\n if (typeof raw === 'number' && Number.isFinite(raw)) return raw;\n if (typeof raw === 'string' && raw.trim() !== '') {\n const n = Number(raw);\n if (Number.isFinite(n)) return n;\n }\n return fallback;\n}\n\nfunction isExplicitIndex(raw: unknown): boolean {\n if (raw === null || raw === undefined) return false;\n if (typeof raw === 'number' && Number.isFinite(raw)) return true;\n if (typeof raw === 'string' && raw.trim() !== '') {\n const n = Number(raw);\n return Number.isFinite(n);\n }\n return false;\n}\n\nfunction firstFreeIndex(used: Set<number>): number {\n let n = 1;\n while (used.has(n)) n++;\n return n;\n}\n\n/**\n * Per-variable index (priority):\n * 1. `VISUAL_VARIABLE_INDEX_BY_NAME` in `visual-variable-index-map.ts`\n * 2. `index` / `order` / `orden` in JSON (minimum if several rows)\n * 3. Auto: first free integer by first appearance order in the file\n */\nfunction buildVisualVariableIndexMap(\n all: ReglaVisual[],\n canonical: Readonly<Record<string, number>> = VISUAL_VARIABLE_INDEX_BY_NAME,\n): Map<string, number> {\n const explicitByVar = new Map<string, number>();\n for (const r of all) {\n const v = r.visualVariable?.trim();\n if (!v) continue;\n const raw = r.index ?? r.order ?? r.order;\n if (!isExplicitIndex(raw)) continue;\n const n = parseRuleIndex(raw, NaN);\n if (!Number.isFinite(n)) continue;\n const prev = explicitByVar.get(v);\n if (prev === undefined || n < prev) explicitByVar.set(v, n);\n }\n\n const firstAppearance: string[] = [];\n const seen = new Set<string>();\n for (const r of all) {\n const v = r.visualVariable?.trim();\n if (!v || seen.has(v)) continue;\n seen.add(v);\n firstAppearance.push(v);\n }\n\n const map = new Map<string, number>();\n const used = new Set<number>();\n\n for (const v of firstAppearance) {\n let idx: number;\n if (Object.prototype.hasOwnProperty.call(canonical, v)) {\n idx = canonical[v]!;\n } else if (explicitByVar.has(v)) {\n idx = explicitByVar.get(v)!;\n } else {\n idx = firstFreeIndex(used);\n }\n map.set(v, idx);\n used.add(idx);\n }\n return map;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class DataSuggestionsService {\n constructor(private readonly rulesService: CommunicationRulesService) {}\n\n analyze(dataset: DataPoint[], goal: string): Observable<SuggestionsResult> {\n const suggestedGraph = this.analyzBestGraph(dataset, goal);\n\n const { dataVariability, dataSize } = this.computeStats(dataset);\n\n return this.rulesService.getRulesForGoal(goal).pipe(\n map((allRules) => {\n const indexByVariable = buildVisualVariableIndexMap(allRules);\n const wantSize = normalizeSampleSizeLabel(dataSize);\n const reglas = allRules.filter(\n (r) =>\n normalizeSampleSizeLabel(r.sampleSize) === wantSize &&\n r.variability === dataVariability &&\n !!r.recommendation,\n );\n\n const rules: SuggestionRow[] = reglas.map((r) => {\n const name = r.visualVariable ?? '';\n return {\n visualVariable: name,\n recommendation: r.recommendation ?? '',\n index: indexByVariable.get(name.trim()) ?? 0,\n };\n });\n\n rules.sort(\n (a, b) =>\n a.index - b.index ||\n a.visualVariable.localeCompare(b.visualVariable, 'en', { sensitivity: 'base' }),\n );\n\n return {\n dataSize,\n dataVariability,\n suggestedGraph,\n rules,\n };\n }),\n );\n }\n\n private analyzBestGraph(_dataset: DataPoint[], _goal: string): 'bars' {\n return 'bars';\n }\n\n private computeStats(dataset: DataPoint[]): {\n dataSize: '≤5' | '6-9' | '10-19' | '>20';\n dataVariability: 'Low' | 'Moderate' | 'High';\n } {\n const values = dataset.map((d) => d.value);\n const n = values.length;\n if (!n) {\n return { dataSize: '≤5', dataVariability: 'Low' };\n }\n\n const mean = values.reduce((a, b) => a + b, 0) / n;\n const variance = values.reduce((a, b) => a + Math.pow(b - mean, 2), 0) / n;\n const stdDev = Math.sqrt(variance);\n const coefVar = mean === 0 ? 0 : stdDev / mean;\n\n let vari: 'Low' | 'Moderate' | 'High';\n if (coefVar < 0.1) vari = 'Low';\n else if (coefVar <= 0.5) vari = 'Moderate';\n else vari = 'High';\n\n let sc: '≤5' | '6-9' | '10-19' | '>20';\n if (n <= 5) sc = '≤5';\n else if (n <= 9) sc = '6-9';\n else if (n <= 20) sc = '10-19';\n else sc = '>20';\n\n return { dataSize: sc, dataVariability: vari };\n }\n}\n","import { Injectable } from '@angular/core';\nimport { map, Observable } from 'rxjs';\nimport {\n COMMUNICATION_GOAL_DEFINITIONS,\n definitionsToBaseOptions,\n} from '../../config/communication-goals.config';\nimport { CommunicationGoalOption, CommunicationGoalSlug, DataPoint, SuggestionsResult } from '../../types';\nimport { CommunicationRulesService, ReglaVisual } from '../communicationRule/CommunicationRulesService';\nimport { DataSuggestionsService } from '../data-suggestions-service/data-suggestions';\n\n/**\n * Facade for host apps: goal catalog, rule counts, raw/filtered rules, and full suggestions\n * (same pipeline as `data-suggestions-table`).\n */\n@Injectable({ providedIn: 'root' })\nexport class CommunicationGoalsService {\n constructor(\n private readonly rulesService: CommunicationRulesService,\n private readonly suggestionsService: DataSuggestionsService,\n ) {}\n\n /** Goal definitions (index, label, JSON slug). */\n getDefinitions() {\n return COMMUNICATION_GOAL_DEFINITIONS;\n }\n\n /** Dropdown options without HTTP (label in `value`, slug in `json`). */\n getBaseOptions(): CommunicationGoalOption[] {\n return definitionsToBaseOptions();\n }\n\n /** Same options with `(n)` rule count per JSON file. */\n loadOptionsWithRuleCounts(): Observable<CommunicationGoalOption[]> {\n const defs = COMMUNICATION_GOAL_DEFINITIONS;\n const slugs = defs.map((d) => d.jsonSlug);\n return this.rulesService.getCountsForGoals(slugs).pipe(\n map((counts) =>\n defs.map((g) => ({\n index: g.index,\n value: `${g.label} (${counts[g.jsonSlug] ?? 0})`,\n json: g.jsonSlug,\n })),\n ),\n );\n }\n\n /** Full rules array from `assets/recomendaciones/<goalSlug>.json`. */\n getRulesForGoal(goalSlug: CommunicationGoalSlug): Observable<ReglaVisual[]> {\n return this.rulesService.getRulesForGoal(goalSlug);\n }\n\n /** Rules filtered by sample size and variability (for custom UIs). */\n getRecommendations(\n goalSlug: CommunicationGoalSlug,\n sampleSize: string,\n variability: string,\n ): Observable<ReglaVisual[]> {\n return this.rulesService.getRecomendaciones(goalSlug, sampleSize, variability);\n }\n\n /** Dataset stats + ordered suggestion rows (table / chart binding). */\n getSuggestionsResult(\n dataset: DataPoint[],\n goalSlug: CommunicationGoalSlug,\n ): Observable<SuggestionsResult> {\n return this.suggestionsService.analyze(dataset, goalSlug);\n }\n}\n","import {\n AfterViewInit,\n Component,\n ElementRef,\n Input,\n OnChanges,\n OnDestroy,\n SimpleChanges,\n ViewChild,\n} from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { Chart, ChartConfiguration, registerables } from 'chart.js';\nimport ChartDataLabels from 'chartjs-plugin-datalabels';\nimport { ButtonModule } from 'primeng/button';\nimport { DialogModule } from 'primeng/dialog';\nimport { chartsModel } from '../model/chartsModels';\n\nChart.register(...registerables, ChartDataLabels);\n\n@Component({\n selector: 'lib-data-suggestions-bar-chart',\n standalone: true,\n imports: [CommonModule, ButtonModule, DialogModule],\n templateUrl: './bar-chart.html',\n styleUrl: './bar-chart.css',\n})\nexport class DataSuggestionsBarChartComponent implements AfterViewInit, OnChanges, OnDestroy {\n\n @ViewChild('canvas', { static: true })\n canvas!: ElementRef<HTMLCanvasElement>;\n\n @Input() title: string = 'Summary';\n @Input() labels: string[] = [];\n @Input() values: number[] = [];\n @Input() orientation: 'Vertical' | 'Horizontal' = 'Vertical';\n @Input() maxValue: number = 0;\n @Input() stepNumber: number = 10;\n @Input() auxiliarLines: boolean = true;\n @Input() opacity: number | undefined = undefined;\n @Input() sortAscending: boolean = false;\n @Input() showLabels: boolean = false;\n @Input() colorPalette:'single' | 'sequential' | 'categorical' = 'single'\n @Input() barDistance:'none' | 'close' | 'medium' | 'wide' = 'medium'\n @Input() barBorderRecommendation:string =\"\"\n @Input() hover: 'none' | 'default' | 'intensify' | 'different' = 'default'\n\n @Input() heightPx: number = 200;\n\n\n @Input() minHeightPx: number = 180;\n @Input() maxHeightPx: number = 360;\n \n @Input() minWidthPx: number = 320;\n @Input() maxWidthPx: number = 900;\n \n @Input() barSizePx: number = 55;\n \n chartHeightPx: number = 220;\n chartWidthPx: number = 500; \n\n private chart?: Chart;\n\n\n\n constructor() {}\n ngAfterViewInit(): void {\n this.render();\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (!this.canvas) return;\n\n if (\n changes['labels'] ||\n changes['values'] ||\n changes['title'] ||\n changes['orientation'] ||\n changes['maxValue'] ||\n changes['stepNumber'] ||\n changes['auxiliarLines'] ||\n changes['opacity'] ||\n changes['sortAscending'] ||\n changes[\"showLabels\"] ||\n changes[\"colorPalette\"] ||\n changes[\"barBorderRecommendation\"] ||\n changes[\"barDistance\"] ||\n changes[\"hover\"] ||\n changes['heightPx']\n ) {\n this.render();\n }\n }\n\n ngOnDestroy(): void {\n this.chart?.destroy();\n }\n\n private render(): void {\n \n const safeLen = Math.min(this.labels.length, this.values.length);\n\n let labels = this.labels.slice(0, safeLen);\n let values = this.values.slice(0, safeLen);\n \n this.updateChartSize(safeLen);\n\n\n if (this.sortAscending) {\n const combined = labels.map((label, index) => ({\n label,\n value: values[index],\n }));\n\n combined.sort((a, b) => a.value - b.value);\n\n labels = combined.map((item) => item.label);\n values = combined.map((item) => item.value);\n }\n\n const indexAxis: 'x' | 'y' = this.orientation === 'Horizontal' ? 'y' : 'x';\n\n this.chart?.destroy();\n\n const spacingConfig = this.getBarSpacingConfig();\n\n const colors = this.getBarColors(values);\n const borderColor = this.getBorderColors(colors);\n const borderWidth = 1;\n\n const hoverBackgroundColor = this.getHoverBackgroundColor(colors);\n const hoverBorderColor = this.getHoverBorderColor(borderColor);\n const hoverBorderWidth =1;\n\n console.log(\"borderColor\", borderColor)\n\n\n const config: ChartConfiguration<'bar'> = {\n type: 'bar',\n data: {\n labels,\n datasets: [\n {\n label: this.title,\n data: values,\n backgroundColor: colors,\n borderColor,\n borderWidth,\n hoverBackgroundColor,\n hoverBorderColor,\n hoverBorderWidth,\n categoryPercentage: spacingConfig.categoryPercentage,\n barPercentage: spacingConfig.barPercentage,\n },\n ],\n },\n options: {\n indexAxis,\n responsive: true,\n maintainAspectRatio: false,\n plugins: {\n legend: { display: false },\n title: { display: !!this.title, text: this.title },\n datalabels: {\n display: this.showLabels,\n anchor: 'end',\n align: this.orientation === 'Horizontal' ? 'right' : 'top',\n formatter: (value: number) => value,\n color: '#333',\n font: {\n weight: 'bold',\n },\n },\n },\n scales: {\n x: {\n beginAtZero: true,\n max: this.orientation === 'Horizontal' ? this.maxValue : undefined,\n ticks: {\n stepSize: this.orientation === 'Horizontal' ? this.stepNumber : undefined,\n },\n grid: {\n display: this.orientation === 'Horizontal' ? this.auxiliarLines : false,\n },\n },\n y: {\n beginAtZero: true,\n max: this.orientation === 'Vertical' ? this.maxValue : undefined,\n ticks: {\n stepSize: this.orientation === 'Vertical' ? this.stepNumber : undefined,\n },\n grid: {\n display: this.orientation === 'Vertical' ? this.auxiliarLines : false,\n },\n },\n },\n },\n };\n\n this.chart = new Chart(this.canvas.nativeElement, config);\n }\n\n private getBarSpacingConfig(): { categoryPercentage: number; barPercentage: number } {\n switch (this.barDistance) {\n case 'none':\n return {\n categoryPercentage: 1.0,\n barPercentage: 1.0,\n };\n \n case 'close':\n return {\n categoryPercentage: 0.85,\n barPercentage: 0.85,\n };\n \n case 'medium':\n return {\n categoryPercentage: 0.65,\n barPercentage: 0.7,\n };\n \n case 'wide':\n return {\n categoryPercentage: 0.45,\n barPercentage: 0.5,\n };\n \n default:\n return {\n categoryPercentage: 0.7,\n barPercentage: 0.75,\n };\n }\n }\n\n \n private getBarColors(values: number[]): string[] | string {\n \n switch (this.colorPalette) {\n case 'single':\n return this.getSingleColor();\n \n case 'sequential':\n return this.getSequentialColors(values);\n \n case 'categorical':\n return this.getRandomColors(values.length);\n \n default:\n return this.getSingleColor();\n }\n }\n\n private getRandomColors(n: number): string[] {\n return Array.from({ length: n }, () => {\n const r = Math.floor(Math.random() * 200);\n const g = Math.floor(Math.random() * 200);\n const b = Math.floor(Math.random() * 200);\n const a = this.opacity ?? 0.8;\n \n return `rgba(${r}, ${g}, ${b}, ${a})`;\n });\n }\n\n private getSequentialColors(values: number[]): string[] {\n const max = Math.max(...values);\n const opacity = this.opacity ?? 0.8;\n \n return values.map((v) => {\n const intensity = v / max;\n const alpha = 0.3 + intensity * 0.7;\n \n return `rgba(54, 162, 235, ${alpha * opacity})`;\n });\n }\n\n private getSingleColor(): string {\n return `rgba(54, 162, 235, ${this.opacity ?? 0.7})`;\n }\n\n\n private getBorderColors(backgroundColor: string | string[]): string | string[] {\n const text = (this.barBorderRecommendation ?? '').trim().toLowerCase();\n \n const getColor = () => {\n switch (text) {\n case 'dark border':\n case 'dark border or no border':\n return 'rgba(0, 0, 0, 0.7)'; // negro con la misma opacidad\n \n case 'light border':\n return 'rgba(220, 220, 220, 0.7)'; // gris claro\n \n case 'same color as the bar':\n case 'no border':\n case 'indifferent':\n default:\n return null; // usar color de la barra\n }\n };\n \n const border = getColor();\n \n if (!border) {\n return backgroundColor;\n }\n \n return Array.isArray(backgroundColor)\n ? backgroundColor.map(() => border)\n : border;\n }\n\n private intensifyRgbaColor(color: string): string {\n const match = color.match(/rgba?\\((\\d+),\\s*(\\d+),\\s*(\\d+)(?:,\\s*([\\d.]+))?\\)/i);\n \n if (!match) return color;\n \n let r = Number(match[1]);\n let g = Number(match[2]);\n let b = Number(match[3]);\n const a = match[4] !== undefined ? Number(match[4]) : (this.opacity ?? 0.7);\n \n\n const darkFactor = 0.8;\n r *= darkFactor;\n g *= darkFactor;\n b *= darkFactor;\n\n const avg = (r + g + b) / 3;\n \n const saturationFactor = 1.25;\n \n r = avg + (r - avg) * saturationFactor;\n g = avg + (g - avg) * saturationFactor;\n b = avg + (b - avg) * saturationFactor;\n \n // clamp\n r = Math.min(255, Math.max(0, Math.round(r)));\n g = Math.min(255, Math.max(0, Math.round(g)));\n b = Math.min(255, Math.max(0, Math.round(b)));\n \n return `rgba(${r}, ${g}, ${b}, ${a})`;\n }\n private getDifferentHoverColor(): string {\n return `rgba(255, 159, 64, ${this.opacity ?? 0.7})`;\n }\n\nprivate getHoverBackgroundColor(backgroundColor: string | string[]): string | string[] | undefined {\n\n\n switch (this.hover) {\n case 'default':\n return undefined;\n\n case 'none':\n return backgroundColor;\n\n case 'intensify':\n return Array.isArray(backgroundColor)\n ? backgroundColor.map((color) => this.intensifyRgbaColor(color))\n : this.intensifyRgbaColor(backgroundColor);\n\n case 'different': {\n const hoverColor = this.getDifferentHoverColor();\n return Array.isArray(backgroundColor)\n ? backgroundColor.map(() => hoverColor)\n : hoverColor;\n }\n\n default:\n return undefined;\n }\n}\n\nprivate getHoverBorderColor(borderColor: string | string[]): string | string[] | undefined {\n\n\n switch (this.hover) {\n case 'default':\n return undefined;\n\n case 'none':\n return borderColor;\n\n case 'intensify':\n return Array.isArray(borderColor)\n ? borderColor.map(() => `rgba(0, 0, 0, ${this.opacity ?? 0.7})`)\n : `rgba(0, 0, 0, ${this.opacity ?? 0.7})`;\n\n case 'different':\n return Array.isArray(borderColor)\n ? borderColor.map(() => `rgba(120, 60, 0, ${this.opacity ?? 0.7})`)\n : `rgba(120, 60, 0, ${this.opacity ?? 0.7})`;\n\n default:\n return undefined;\n }\n}\nprivate updateChartSize(numberOfBars: number): void {\n const safeBars = Math.max(numberOfBars, 1);\n\n if (this.orientation === 'Vertical') {\n this.chartWidthPx = this.clamp(\n safeBars * this.barSizePx,\n this.minWidthPx,\n this.maxWidthPx\n );\n\n this.chartHeightPx = this.clamp(\n this.heightPx,\n this.minHeightPx,\n this.maxHeightPx\n );\n } else {\n this.chartWidthPx = this.clamp(\n this.maxWidthPx,\n this.minWidthPx,\n this.maxWidthPx\n );\n\n this.chartHeightPx = this.clamp(\n safeBars * 40,\n this.minHeightPx,\n this.maxHeightPx\n );\n }\n}\n\nprivate clamp(value: number, min: number, max: number): number {\n return Math.min(Math.max(value, min), max);\n}\n\n}","<div class=\"chart-wrap\" [style.height.px]=\"chartHeightPx\"\n[style.width.px]=\"chartWidthPx\">\n <canvas #canvas></canvas>\n</div>\n","// projects/data-suggestions/src/lib/data-suggestions-table.component.ts\r\nimport { CommonModule } from '@angular/common';\r\nimport { Component, Input, OnChanges } from '@angular/core';\r\nimport { Observable, of, Subject, takeUntil, tap } from 'rxjs';\r\nimport { DataPoint, SuggestionRow, SuggestionsResult } from '../types';\r\nimport { DataSuggestionsService } from '../services/data-suggestions-service/data-suggestions';\r\nimport { DataSuggestionsBarChartComponent } from '../bar-chart/bar-chart';\r\nimport { chartsModel } from '../model/chartsModels';\r\nimport { ButtonModule } from 'primeng/button';\r\nimport { DialogModule } from 'primeng/dialog';\r\n\r\nfunction findRule(rules: SuggestionRow[], ...names: string[]): SuggestionRow | undefined {\r\n for (const n of names) {\r\n const hit = rules.find((r) => r.visualVariable === n);\r\n if (hit) return hit;\r\n }\r\n return undefined;\r\n}\r\n\r\n@Component({\r\n selector: 'data-suggestions-table',\r\n standalone: true,\r\n imports: [CommonModule, DataSuggestionsBarChartComponent, ButtonModule, DialogModule ],\r\n templateUrl: './data-suggestions-table.html',\r\n styleUrl: './data-suggestions-table.scss',\r\n})\r\nexport class DataSuggestionsTableComponent implements OnChanges {\r\n @Input({ required: true }) dataset: DataPoint[] = [];\r\n @Input({ required: true }) goal!: string;\r\n\r\n result$: Observable<SuggestionsResult | null> = of(null);\r\n private readonly destroy$ = new Subject<void>();\r\n showGraph: boolean = false;\r\n showJsonInfoDialog: boolean = false;\r\n jsonExample = `{\r\n \"data\": [\r\n { \"key\": \"Monday\", \"value\": 30 },\r\n { \"key\": \"Tuesday\", \"value\": 42 },\r\n { \"key\": \"Wednesday\", \"value\": 35 },\r\n { \"key\": \"Thursday\", \"value\": 50 },\r\n { \"key\": \"Friday\", \"value\": 38 }\r\n ]\r\n }`;\r\n jsonExample1 = `[\r\n { \"key\": \"Monday\", \"value\": 30 },\r\n { \"key\": \"Tuesday\", \"value\": 42 },\r\n { \"key\": \"Wednesday\", \"value\": 35 }\r\n ]`;\r\n \r\n jsonExample2 = `{\r\n \"Monday\": 30,\r\n \"Tuesday\": 42,\r\n \"Wednesday\": 35\r\n }`;\r\n \r\n jsonExample3 = `{\r\n \"days\": [\"Monday\", \"Tuesday\", \"Wednesday\"],\r\n \"values\": [30, 42, 35]\r\n }`;\r\n \r\n jsonExample4 = `[\r\n [\"Monday\", 30],\r\n [\"Tuesday\", 42],\r\n [\"Wednesday\", 35]\r\n ]`;\r\n resultsLength: number = 0;\r\n\r\ncommunicationGoalsServiceExample = `\r\nconstructor(\r\n private communicationGoalsService: CommunicationGoalsService\r\n) {}\r\n\r\nngOnInit(): void {\r\n this.communicationGoalsService\r\n .loadOptionsWithRuleCounts()\r\n .subscribe(goals => {\r\n console.log(goals);\r\n });\r\n}\r\n`;\r\n\r\ncommunicationGoalsResponseExample = `\r\n[\r\n {\r\n \"index\": 5,\r\n \"value\": \"Highlight the highest value (24)\",\r\n \"json\": \"highlight-the-highest-value\"\r\n }\r\n]\r\n`;\r\n\r\ncommunicationGoalUsageExample = `\r\n{\r\n \"communicationGoal\": \"highlight-the-highest-value\"\r\n}\r\n`;\r\n constructor(\r\n private readonly svc: DataSuggestionsService,\r\n public readonly chartModel: chartsModel,\r\n ) {}\r\n ngOnChanges(): void {\r\n const normalizedData = this.normalizeDataset(this.dataset);\r\n \r\n if (normalizedData.length && this.goal) {\r\n console.log('cambios en', this.dataset, this.goal);\r\n \r\n this.chartModel.chartLabels = normalizedData.map(item => item.key);\r\n this.chartModel.chartValues = normalizedData.map(item => item.value);\r\n \r\n this.result$ = this.svc.analyze(normalizedData, this.goal).pipe(\r\n tap((result) => {\r\n if (result) {\r\n this.setChartOptions(result);\r\n }\r\n }),\r\n takeUntil(this.destroy$),\r\n );\r\n }\r\n }\r\n obtainKeysAndValues() {\r\n\r\n const normalizedData = this.normalizeDataset(this.dataset);\r\n\r\n this.chartModel.chartLabels =\r\n normalizedData.map(item => item.key);\r\n \r\n this.chartModel.chartValues =\r\n normalizedData.map(item => item.value); \r\n }\r\n\r\n private normalizeDataset(dataset: any): { key: string; value: number }[] {\r\n\r\n if (!dataset) {\r\n return [];\r\n }\r\n \r\n // ==========================================\r\n // FORMATO 1: Array de objetos\r\n // ==========================================\r\n if (\r\n Array.isArray(dataset) &&\r\n dataset.every(\r\n item =>\r\n item &&\r\n typeof item === 'object' &&\r\n 'key' in item &&\r\n 'value' in item\r\n )\r\n ) {\r\n return dataset.map(item => ({\r\n key: String(item.key),\r\n value: Number(item.value)\r\n }));\r\n }\r\n \r\n // ==========================================\r\n // FORMATO 2: Array de tuplas\r\n // ==========================================\r\n if (\r\n Array.isArray(dataset) &&\r\n dataset.every(\r\n item =>\r\n Array.isArray(item) &&\r\n item.length >= 2\r\n )\r\n ) {\r\n return dataset.map(item => ({\r\n key: String(item[0]),\r\n value: Number(item[1])\r\n }));\r\n }\r\n \r\n // ==========================================\r\n // FORMATO 3: Diccionario clave-valor\r\n // ==========================================\r\n if (\r\n typeof dataset === 'object' &&\r\n !Array.isArray(dataset) &&\r\n Object.values(dataset).every(v => typeof v === 'number')\r\n ) {\r\n return Object.entries(dataset).map(([key, value]) => ({\r\n key,\r\n value: Number(value)\r\n }));\r\n }\r\n \r\n // ==========================================\r\n // FORMATO 4: Estructura columnar\r\n // ==========================================\r\n if (\r\n typeof dataset === 'object' &&\r\n !Array.isArray(dataset)\r\n ) {\r\n \r\n const arrayProperties = Object.keys(dataset)\r\n .filter(key => Array.isArray(dataset[key]));\r\n \r\n if (arrayProperties.length >= 2) {\r\n \r\n const labelsArray = dataset[arrayProperties[0]];\r\n const valuesArray = dataset[arrayProperties[1]];\r\n \r\n if (\r\n labelsArray.length === valuesArray.length &&\r\n valuesArray.every((v: any) => typeof v === 'number')\r\n ) {\r\n \r\n return labelsArray.map(\r\n (label: any, index: number) => ({\r\n key: String(label),\r\n value: Number(valuesArray[index])\r\n })\r\n );\r\n }\r\n }\r\n }\r\n \r\n console.warn('Unsupported dataset format', dataset);\r\n \r\n return [];\r\n }\r\n private setChartOptions(result: SuggestionsResult): void {\r\n this.showGraph = false;\r\n //'Bar direction'\r\n this.resultsLength = result.rules.length;\r\n const orientationRule = findRule(result.rules, 'Bar direction');\r\n const orientationRecommendation = orientationRule?.recommendation;\r\n if (orientationRecommendation === 'Horizontal' || orientationRecommendation === 'Horizontal orientation') {\r\n this.chartModel.orientation = 'Horizontal';\r\n } else if (orientationRecommendation === 'Vertical') {\r\n this.chartModel.orientation = 'Vertical';\r\n } else {\r\n this.chartModel.orientation = 'Vertical';\r\n }\r\n // 'Order'\r\n //Ordered , indiferent, Unordered\r\n const orderRule = findRule(result.rules, 'Order')\r\n const orderRecommendation = orderRule?.recommendation;\r\n if(orderRecommendation==='Ordered'){\r\n this.chartModel.ordered = true;\r\n }else{\r\n this.chartModel.ordered = false;\r\n }\r\n // 'Labels'\r\n //Do not label, do not use, indifferent, use labels, with labels, without lables\r\n const labelsRule = findRule(result.rules, 'Labels')\r\n const labelRecommendation = labelsRule?.recommendation;\r\n if(labelRecommendation==='Use labels' ||labelRecommendation ==='With labels' ){\r\n this.chartModel.labels = true;\r\n }else{\r\n this.chartModel.labels = false;\r\n }\r\n\r\n\r\n // 'Grid lines'\r\n const auxiliarLinesRec = findRule(result.rules, 'Grid lines');\r\n const gridRec = auxiliarLinesRec?.recommendation ?? '';\r\n if (gridRec === 'Without grid lines') {\r\n this.chartModel.auxiliarLines = false;\r\n } else {\r\n this.chartModel.auxiliarLines = true;\r\n }\r\n\r\n // 'Axis maximum'\r\n const maxAxisRule = findRule(result.rules, 'Axis maximum');\r\n const max = getMaxValue(this.chartModel.chartValues);\r\n switch (maxAxisRule?.recommendation) {\r\n case 'Real maximum':\r\n this.chartModel.incrementoMaximo = max;\r\n break;\r\n case '30% of the maximum':\r\n case '30% above the maximum':\r\n this.chartModel.incrementoMaximo = max + max * 0.3;\r\n break;\r\n case 'Maximum +20%':\r\n this.chartModel.incrementoMaximo = max + max * 0.2;\r\n break;\r\n case '10% above the highest value':\r\n this.chartModel.incrementoMaximo = max + max * 0.1;\r\n break;\r\n case '10% or 20% above the maximum':\r\n this.chartModel.incrementoMaximo = max + max * 0.15;\r\n break;\r\n case '20% or 30% above the maximum':\r\n this.chartModel.incrementoMaximo = max + max * 0.25;\r\n break;\r\n case 'Indifferent':\r\n default:\r\n this.chartModel.incrementoMaximo = max;\r\n break;\r\n }\r\n // 'Number of steps'\r\n \r\n const stepRec = findRule(result.rules, 'Number of steps');\r\n const stepNumber = this.calculateAxisStepByPercentage(\r\n max,\r\n stepRec ? stepRec.recommendation : 'Indifferent',\r\n );\r\n this.chartModel.numeroPasos = stepNumber;\r\n\r\n // 'Opacity'\r\n \r\n const opacityRule = findRule(result.rules, 'Opacity');\r\n const opacityRecommendation = opacityRule?.recommendation ?? 'Indifferent';\r\n\r\n switch (opacityRecommendation) {\r\n case 'Opaque':\r\n this.chartModel.opacity = 1;\r\n break;\r\n case 'Transparent':\r\n case 'More transparent':\r\n case 'Transparency':\r\n this.chartModel.opacity = 0.4;\r\n break;\r\n case 'Indifferent':\r\n default:\r\n this.chartModel.opacity = undefined;\r\n }\r\n // 'Spacing between bars'\r\n // Close bars, \"Very close or very separated\", \"Separated or widely spaced\", \"Close or separated\", \"Separated or widely spaced\", \"No spacing\",\r\n // \"Widely spaced\", \"Close\", \"Close or widely spaced\", \"Close or slightly separated\", \"Indifferent\", \" \"Close or widely spaced\"\", \r\n const spaceRule = findRule(result.rules, 'Spacing between bars');\r\n const spaceRecommendation = spaceRule?.recommendation ?? 'Indifferent';\r\n this.chartModel.separation = this.normalizeSpacingRecommendation(spaceRecommendation)\r\n // 'Bar color'\r\n //\"Random or ordered\", \"Indifferent\", \"Ordered or fully distinct\", \"Random color palette\", \r\n const barColorRule = findRule(result.rules, 'Color palette');\r\n const barColorRec = barColorRule?.recommendation ?? 'Indifferent';\r\n this.chartModel.colorPalette = this.normalizeColorMode(barColorRec)\r\n // 'Border color':\r\n //·Indifferent·, \"Light border\", \"Dark border\", \"\"Dark border or no border\", \"No border\", \"Same color as the bar\", \"Dark border\", \"Moderate\", \"Light border\"\r\n const borderColorRule = findRule(result.rules, 'Border color');\r\n const borderColorRec:any = borderColorRule?.recommendation ?? 'Indifferent';\r\n this.chartModel.borderColor = borderColorRec;\r\n\r\n //'Hover behavior'\r\n //Indifferent, \"Different color or highlighted tone\", \"Highlight color\", \"Highlight bar color\", \"Highlight\", \"Do nothing\",\"Do nothing or highlight color\",\"\"\r\n const hoverRule = findRule(result.rules, 'Hover behavior');\r\n const hoverRec:any = hoverRule?.recommendation ?? 'Indifferent';\r\n\r\n const text = (hoverRec ?? '').trim().toLowerCase();\r\n switch (text) {\r\n case 'do nothing':\r\n\r\n case '':\r\n this.chartModel.hoverRec = 'none';\r\n break;\r\n \r\n case 'indifferent':\r\n this.chartModel.hoverRec = 'default';\r\n break;\r\n \r\n case 'highlight':\r\n case 'highlight color':\r\n case 'highlight bar color':\r\n case 'do nothing or highlight color':\r\n\r\n this.chartModel.hoverRec = 'intensify';\r\n break;\r\n\r\n case 'different color or highlighted tone':\r\n this.chartModel.hoverRec = 'different';\r\n break;\r\n \r\n default:\r\n this.chartModel.hoverRec = 'default';\r\n break;\r\n }\r\n\r\n\r\n this.showGraph = true;\r\n }\r\n\r\n private calculateAxisStepByPercentage(maxAxisValue: number, recommendation: string): number {\r\n if (maxAxisValue <= 0) return 1;\r\n\r\n let percentage: number;\r\n\r\n switch (recommendation) {\r\n case 'Few steps':\r\n percentage = 0.5;\r\n break;\r\n case 'Medium steps':\r\n case 'Medium number of steps':\r\n percentage = 0.25;\r\n break;\r\n case 'Few or medium steps':\r\n percentage = 0.3;\r\n break;\r\n case 'Indifferent':\r\n default:\r\n percentage = 0.25;\r\n break;\r\n }\r\n\r\n return maxAxisValue * percentage;\r\n }\r\n\r\n private normalizeSpacingRecommendation(\r\n recommendation: string | null | undefined\r\n ): 'none' | 'close' | 'medium' | 'wide' {\r\n const text = (recommendation ?? '').trim().toLowerCase();\r\n \r\n if (!text || text === 'indifferent') return 'medium';\r\n \r\n if (text === 'no spacing') return 'none';\r\n \r\n if (text === 'close bars' || text === 'close') return 'close';\r\n \r\n if (text === 'widely spaced') return 'wide';\r\n \r\n if (text.includes('or')) return 'medium';\r\n \r\n if (text.includes('very close')) return 'none';\r\n if (text.includes('slightly separated')) return 'close';\r\n if (text.includes('separated')) return 'medium';\r\n \r\n return 'medium';\r\n }\r\n \r\n private normalizeColorMode( recommendation: string | null | undefined\r\n ): 'single' | 'sequential' | 'categorical' {\r\n console.log(\"normalizeColorMode\", recommendation)\r\n console.log(\"RECOMENDACION\", recommendation)\r\n const text = (recommendation ?? '').toLowerCase().trim();\r\n \r\n console.log(\"text\")\r\n if (!text || text === 'indifferent') {\r\n return 'single';\r\n }\r\n \r\n if (text.includes('random color palette')) {\r\n return 'categorical';\r\n }\r\n \r\n if (text.includes('ordered or fully distinct')) {\r\n return 'sequential';\r\n }\r\n \r\n if (text.includes('random or ordered')) {\r\n return 'sequential';\r\n }\r\n \r\n return 'single';\r\n }\r\n\r\n \r\n}\r\n\r\nfunction getMaxValue(values: number[]): number {\r\n if (!values.length) return 0;\r\n return Math.max(...values);\r\n}\r\n\r\n\r\n\r\n","<section class=\"panel\">\r\n <header class=\"header\">\r\n <span>Applied suggestions: {{ resultsLength }}</span>\r\n <!-- <button type=\"button\" (click)=\"generate()\" [disabled]=\"!dataset?.length || !goal\">\r\n Analyze\r\n </button> -->\r\n <p-button\r\n icon=\"pi pi-info-circle\"\r\n title=\"Info\"\r\n (click)=\"showJsonInfoDialog = true\"\r\n styleClass=\"p-button-text\"\r\n ></p-button>\r\n </header>\r\n\r\n \r\n @if (showGraph) {\r\n <lib-data-suggestions-bar-chart\r\n [title]=\"'Recommendations'\"\r\n [labels]=\"this.chartModel.chartLabels\"\r\n [values]=\"this.chartModel.chartValues\"\r\n [orientation]=\"this.chartModel.orientation\"\r\n [maxValue]=\"this.chartModel.incrementoMaximo\"\r\n [stepNumber]=\"this.chartModel.numeroPasos\"\r\n [auxiliarLines]=\"this.chartModel.auxiliarLines\"\r\n [heightPx]=\"320\"\r\n [opacity]=\"this.chartModel.opacity\"\r\n [sortAscending]=\"this.chartModel.ordered\"\r\n [showLabels]=\"this.chartModel.labels\"\r\n [barDistance] = \"this.chartModel.separation\"\r\n [colorPalette]=\"this.chartModel.colorPalette\"\r\n [barBorderRecommendation]=\"this.chartModel.borderColor\"\r\n [hover]=\"this.chartModel.hoverRec\"\r\n >\r\n </lib-data-suggestions-bar-chart>\r\n \r\n }\r\n \r\n</section>\r\n\r\n<p-dialog\r\nheader=\"Info\"\r\n[(visible)]=\"showJsonInfoDialog\"\r\n[modal]=\"true\"\r\n[dismissableMask]=\"true\"\r\n[style]=\"{ width: '52rem' }\"\r\n>\r\n\r\n<div class=\"dialog-tabs\">\r\n <button\r\ntype=\"button\"\r\nclass=\"dialog-tab\"\r\n[class.active]=\"chartModel.showingInDialog === 'suggestions'\"\r\n(click)=\"chartModel.showingInDialog = 'suggestions'\"\r\n>\r\nSuggestions\r\n</button>\r\n<button\r\ntype=\"button\"\r\nclass=\"dialog-tab\"\r\n[class.active]=\"chartModel.showingInDialog === 'data'\"\r\n(click)=\"chartModel.showingInDialog = 'data'\"\r\n>\r\nExpected data format\r\n</button>\r\n\r\n<button\r\ntype=\"button\"\r\nclass=\"dialog-tab\"\r\n[class.active]=\"chartModel.showingInDialog === 'variables'\"\r\n(click)=\"chartModel.showingInDialog = 'variables'\"\r\n>\r\nVariables overview\r\n</button>\r\n\r\n<button\r\ntype=\"button\"\r\nclass=\"dialog-tab\"\r\n[class.active]=\"chartModel.showingInDialog === 'readme'\"\r\n(click)=\"chartModel.showingInDialog = 'readme'\"\r\n>\r\nHow to use the library\r\n</button>\r\n<button\r\n type=\"button\"\r\n class=\"dialog-tab\"\r\n [class.active]=\"chartModel.showingInDialog === 'communicationGoals'\"\r\n (click)=\"chartModel.showingInDialog = 'communicationGoals'\"\r\n>\r\nCommunication Goals\r\n</button>\r\n</div>\r\n<div class=\"grid body\">\r\n @if(chartModel.showingInDialog === 'suggestions'){\r\n <ng-container *ngIf=\"result$ | async as result\">\r\n <div class=\"suggestions-content\">\r\n \r\n <div class=\"meta\">\r\n <span><strong>Size:</strong> {{ result.dataSize }}</span>\r\n <span><strong>Variability:</strong> {{ result.dataVariability }}</span>\r\n <span><strong>Suggested chart:</strong> {{ result.suggestedGraph }}</span>\r\n </div>\r\n \r\n @if(result.rules?.length){\r\n <table class=\"table\">\r\n <thead>\r\n <tr>\r\n <th>Index</th>\r\n <th>Visual variable</th>\r\n <th>Recommendation</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr *ngFor=\"let r of result.rules\">\r\n <td>{{ r.index }}</td>\r\n <td>{{ r.visualVariable }}</td>\r\n <td>{{ r.recommendation }}</td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n } @else {\r\n <p class=\"empty\">\r\n There are no suggestions for this combination.\r\n </p>\r\n }\r\n \r\n </div>\r\n </ng-container>\r\n }\r\n@if(chartModel.showingInDialog === 'data'){\r\n<p>\r\n The library accepts multiple JSON structures and automatically converts them \r\n into the internal format required to generate the chart.\r\n</p>\r\n\r\n\r\n <div class=\"json-section\">\r\n <h4>Option 1: Array of objects</h4>\r\n <pre class=\"json-example\">{{ jsonExample1 }}</pre>\r\n </div>\r\n\r\n <div class=\"json-section\">\r\n <h4>Option 2: Key-value dictionary</h4>\r\n <pre class=\"json-example\">{{ jsonExample2 }}</pre>\r\n </div>\r\n\r\n <div class=\"json-section\">\r\n <h4>Option 3: Column-oriented structure</h4>\r\n <pre class=\"json-example\">{{ jsonExample3 }}</pre>\r\n </div>\r\n\r\n <div class=\"json-section\">\r\n <h4>Option 4: Array of tuples</h4>\r\n <pre class=\"json-example\">{{ jsonExample4 }}</pre>\r\n </div>\r\n\r\n\r\n}\r\n@if(chartModel.showingInDialog === 'variables'){\r\n<img\r\nsrc=\"assets/img/ejemploVariables.jpeg\"\r\nalt=\"Summary of recommended configurations\"\r\nstyle=\"width: 400px; margin-left: 120px;\"\r\n/>\r\n\r\n}\r\n@if(chartModel.showingInDialog === 'readme'){\r\n <div class=\"info-section\" style=\"margin-left: 10px;\">\r\n <h3>Quick Start</h3>\r\n \r\n <p>\r\n Install the library from the NPM registry:\r\n </p>\r\n \r\n <pre><code>npm install data-suggestions</code></pre>\r\n \r\n <p>\r\n Import the component into your Angular application and provide a dataset\r\n together with a communication goal. The library will automatically analyze\r\n the data and generate visualization recommendations.\r\n </p>\r\n \r\n <p>\r\n For detailed installation instructions, supported data formats,\r\n configuration options, examples, and API documentation, please refer to\r\n the project's README file.\r\n </p>\r\n </div>\r\n \r\n}\r\n@if(chartModel.showingInDialog === 'communicationGoals'){\r\n <div class=\"communication-goals-content\" style=\"margin-left: 10px;\">\r\n\r\n\r\n <p>\r\n Communication goals define the analytical objective that the library\r\n should apply when generating visualization recommendations.\r\n </p>\r\n\r\n <p>\r\n The available communication goals can be retrieved directly through the\r\n <code>CommunicationGoalsService</code>.\r\n </p>\r\n\r\n <div class=\"json-section\">\r\n <h4>Get communication goals with recommendation counts</h4>\r\n <pre class=\"json-example\" [textContent]=\"communicationGoalsServiceExample\"></pre>\r\n </div>\r\n\r\n <div class=\"json-section\">\r\n <h4>Example response</h4>\r\n <pre class=\"json-example\" [textContent]=\"communicationGoalsResponseExample\"></pre>\r\n </div>\r\n\r\n <p>\r\n The <code>json</code> property contains the value that must be passed to\r\n the <code>communicationGoal</code> parameter.\r\n </p>\r\n\r\n <div class=\"json-section\">\r\n <h4>Usage example</h4>\r\n <pre class=\"json-example\" [textContent]=\"communicationGoalUsageExample\"></pre>\r\n </div>\r\n\r\n </div>\r\n}\r\n</div>\r\n<!-- <p>\r\nEl archivo debe ser un JSON con una propiedad <strong>data</strong> que sea\r\nun array de objetos con <strong>key</strong> y <strong>value</strong>.\r\n</p>\r\n\r\n<pre class=\"json-example\">{{ jsonExample }}</pre>\r\n-->\r\n<ng-template pTemplate=\"footer\">\r\n<p-button\r\n label=\"Cerrar\"\r\n icon=\"pi pi-check\"\r\n (click)=\"showJsonInfoDialog = false\"\r\n></p-button>\r\n</ng-template>\r\n</p-dialog>","/*\n * Public API Surface of data-suggestions\n */\n\nexport * from './lib/types';\nexport * from './lib/config/visual-variable-index-map';\nexport * from './lib/config/communication-goals.config';\nexport * from './lib/services/communicationRule/CommunicationRulesService';\nexport * from './lib/services/communication-goals/communication-goals.service';\nexport * from './lib/services/data-suggestions-service/data-suggestions';\nexport * from './lib/data-suggestions-table/data-suggestions-table';\nexport * from './lib/bar-chart/bar-chart';","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i2.chartsModel","i1.CommunicationRulesService","i2.DataSuggestionsService","i1.DataSuggestionsService"],"mappings":";;;;;;;;;;;;;;AAAA;;;AAGG;AACI,MAAM,6BAA6B,GAAqC;AAC7E,IAAA,eAAe,EAAE,CAAC;AAClB,IAAA,OAAO,EAAE,CAAC;AACV,IAAA,QAAQ,EA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AAA,eAAA,EAAA,cAAA,EAAA,aAAA,EAAA,WAAA,EAAA,YAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,OAAA,EAAA,CAAA,EAAA,CAAA;;4FAIzE,6BAA6B,EAAA,UAAA,EAAA,CAAA;kBAPzC,SAAS;+BACE,wBAAwB,EAAA,UAAA,EACtB,IAAI,EAAA,OAAA,EACP,CAAC,YAAY,EAAE,gCAAgC,EAAE,YAAY,EAAE,YAAY,CAAE,EAAA,QAAA,EAAA,k0OAAA,EAAA,MAAA,EAAA,CAAA,y1CAAA,CAAA,EAAA;;sBAKrF,KAAK;uBAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;;sBACxB,KAAK;uBAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;;AAqa3B,SAAS,WAAW,CAAC,MAAgB,EAAA;IACnC,IAAI,CAAC,MAAM,CAAC,MAAM;AAAE,QAAA,OAAO,CAAC;AAC5B,IAAA,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC;AAC5B;;AEpcA;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"data-suggestions.mjs","sources":["../../../projects/data-suggestions/src/lib/config/visual-variable-index-map.ts","../../../projects/data-suggestions/src/lib/config/communication-goals.config.ts","../../../projects/data-suggestions/src/lib/model/chartsModels.ts","../../../projects/data-suggestions/src/lib/services/communicationRule/CommunicationRulesService.ts","../../../projects/data-suggestions/src/lib/services/data-suggestions-service/data-suggestions.ts","../../../projects/data-suggestions/src/lib/bar-chart/bar-chart.ts","../../../projects/data-suggestions/src/lib/bar-chart/bar-chart.html","../../../projects/data-suggestions/src/lib/data-suggestions-table/data-suggestions-table.ts","../../../projects/data-suggestions/src/lib/data-suggestions-table/data-suggestions-table.html","../../../projects/data-suggestions/src/public-api.ts","../../../projects/data-suggestions/src/data-suggestions.ts"],"sourcesContent":["/**\r\n * Exact `visualVariable` names as in JSON → display order in the table.\r\n * Edit this object to change ordering; keys must match the JSON strings.\r\n */\r\nexport const VISUAL_VARIABLE_INDEX_BY_NAME: Readonly<Record<string, number>> = {\r\n 'Bar direction': 1,\r\n 'Order': 2,\r\n 'Labels': 3,\r\n 'Grid lines': 4,\r\n 'Axis maximum': 5,\r\n 'Number of steps': 6,\r\n 'Opacity': 7,\r\n 'Spacing between bars': 8,\r\n 'Color palette': 9,\r\n 'Border color': 10,\r\n 'Hover behavior': 11,\r\n};\r\n\r\n/** Returns configured index after trim, or undefined if not listed. */\r\nexport function getConfiguredVisualVariableIndex(visualVariable: string): number | undefined {\r\n const key = visualVariable.trim();\r\n const v = VISUAL_VARIABLE_INDEX_BY_NAME[key];\r\n return v !== undefined ? v : undefined;\r\n}\r\n","export const ChartGenGoals = {\r\n COUNT_REPEATED_VALUE: 'count-times-that-a-certain-value-is-repeated',\r\n COUNT_EXCEEDED_THRESHOLD: 'count-times-a-certain-value-is-exceeded',\r\n COUNT_BELOW_THRESHOLD: 'count-times-does-not-exceed-a-certain-value',\r\n HIGHLIGHT_VALUE: 'highlight-a-value',\r\n HIGHLIGHT_HIGHEST_VALUE: 'highlight-the-highest-value',\r\n HIGHLIGHT_LOWEST_VALUE: 'highlight-the-lowest-value',\r\n HIGHLIGHT_HIGHER_VALUES: 'highlight-higher-values',\r\n HIGHLIGHT_LOWER_VALUES: 'highlight-lower-values',\r\n} as const;\r\n\r\nexport type ChartGenGoal = (typeof ChartGenGoals)[keyof typeof ChartGenGoals];","import { Injectable } from '@angular/core';\r\nimport { ReglaVisual } from '../services/communicationRule/CommunicationRulesService';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class chartsModel {\r\n data: any;\r\n dataSize: string = '';\r\n dataVariability: string = '';\r\n suggestedGraph: string = '';\r\n communicationGoal: number = 0;\r\n communicationGoalsOptions = [\r\n { index: 1, value: 'Count occurrences of a specific value' },\r\n { index: 2, value: 'Count occurrences of the maximum value' },\r\n { index: 3, value: 'Count occurrences of the minimum value' },\r\n { index: 4, value: 'Identify a specific value' },\r\n { index: 5, value: 'Identify the maximum value' },\r\n { index: 6, value: 'Identify the second highest value' },\r\n { index: 7, value: 'Identify the third highest value' },\r\n { index: 8, value: 'Identify the minimum value' },\r\n { index: 9, value: 'Identify the second lowest value' },\r\n { index: 10, value: 'Identify the third lowest value' },\r\n ];\r\n\r\n/** filesOptions = [\r\n { label: 'Gasolina en ciudades', fileName: 'gasolinaCiudades' }, //muy pequeño con poca variabilidad\r\n {\r\n label: 'Temperatura en oficinas',\r\n fileName: 'temperaturaMediaEnOficinas',\r\n }, //muy pequeño con poca variabilidad\r\n {\r\n label: 'Ventas diarias de limonada',\r\n fileName: 'ventasDiariasDeLimonada',\r\n }, //muy pequeño con variabilidad media\r\n {\r\n label: 'Duración llamadas en call center',\r\n fileName: 'duracionLlamadasCallCenter',\r\n }, //muy pequeño con variabilidad alta\r\n {\r\n label: 'Nivel de ruido en bibliotecas',\r\n fileName: 'nivelRuidoEnBibliotecas',\r\n }, //pequeño con variabilidad baja\r\n {\r\n label: 'Consumo de agua por hogar (L/día)',\r\n fileName: 'consumoAgua',\r\n }, //pequeño con variabilidad media\r\n {\r\n label: 'Horas dedicadas al gaming semanalmente',\r\n fileName: 'horasGaming',\r\n }, //pequeño con variabilidad alta\r\n {\r\n label: 'Tiempo de carga de una app (ms)',\r\n fileName: 'tiemposCarga',\r\n }, //medio con variabilidad baja\r\n {\r\n label: 'Distancia diaria Recorrida (km)',\r\n fileName: 'distanciaDiaria',\r\n }, //medio con variabilidad medial\r\n {\r\n label: 'Ingresos semanales de freelancers',\r\n fileName: 'ingresosSemanales',\r\n }, //medio con variabilidad alta\r\n {\r\n label: 'Nivel de batería de sensores IoT',\r\n fileName: 'nivelBateria',\r\n }, //grande con variabilidad baja\r\n {\r\n label: 'Tiempo de ejercicio diario (minutos)',\r\n fileName: 'tiempoEjercicio',\r\n }, //grande con variabilidad medial\r\n {\r\n label: 'Tiempo de carga de vehículos eléctricos (min)',\r\n fileName: 'tiempoCarga',\r\n }, //grande con variabilidad alta\r\n ];*/\r\n\r\n // selectedFile: any;\r\n\r\n rules: ReglaVisual[] = [];\r\n\r\n generatedRules: boolean = false;\r\n // recommendations: string[] = [];\r\n\r\n chartLabels: string[] = [];\r\n chartValues: number[] = [];\r\n\r\n orientation: 'Vertical' | 'Horizontal' = 'Vertical';\r\n\r\n //HABRIA QUE EDCIR QUE PASA CON LOS DE QUE SON a 0 B yo voy a ahcer de momento que sea el intermedio\r\n incrementoMaximo: number = 0; //voy a guardar por lo que hay multiplicar el valor mas alto para obtener el máximo\r\n numeroPasos: number = 10;\r\n auxiliarLines: boolean = false;\r\n opacity: number | undefined;\r\n ordered:boolean = false;\r\n labels: boolean = false\r\n separation:'none' | 'close' | 'medium' | 'wide' = 'medium';\r\n colorPalette:'single' | 'sequential' | 'categorical' = 'single'\r\n borderColor: \"Light border\" | \"Dark border\" | \"Same color as the bar\" | \"No border\" | \"Indifferent\" | \"Dark border or no border\" = \"Indifferent\"\r\n hoverRec:'none' | 'default' | 'intensify' | 'different' = 'default'\r\n showingInDialog:'data' | 'variables' | 'readme' | 'suggestions' |'communicationGoals' = 'suggestions';\r\n\r\n constructor() {}\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { HttpClient } from '@angular/common/http';\r\nimport { catchError, forkJoin, map, Observable, of, tap } from 'rxjs';\r\nimport { chartsModel } from '../../model/chartsModels';\r\n\r\n/** Normalizes en/em dashes in sample-size labels so JSON matches computed stats. */\r\nexport function normalizeSampleSizeLabel(s: string | null | undefined): string {\r\n if (s == null) return '';\r\n return String(s)\r\n .replace(/\\u2013/g, '-')\r\n .replace(/\\u2014/g, '-')\r\n .trim();\r\n}\r\n\r\nexport interface ReglaVisual {\r\n index?: number | null;\r\n order?: number | null;\r\n visualVariable: string | null;\r\n sampleSize: string | null;\r\n variability: string | null;\r\n recommendation: string | null;\r\n}\r\n\r\n@Injectable({ providedIn: 'root' })\r\nexport class CommunicationRulesService {\r\n private basePath = 'assets/recomendaciones/';\r\n\r\n constructor(\r\n private http: HttpClient,\r\n private readonly chartsModel: chartsModel,\r\n ) {}\r\n\r\n private loadJsonForGoal(goal: string): Observable<ReglaVisual[]> {\r\n const file = `${this.basePath}${goal}.json`;\r\n return this.http.get<ReglaVisual[]>(file);\r\n }\r\n\r\n /** All rules from `assets/recomendaciones/<goal>.json` (unfiltered). */\r\n getRulesForGoal(goal: string): Observable<ReglaVisual[]> {\r\n return this.loadJsonForGoal(goal).pipe(\r\n tap(() => {\r\n this.chartsModel.generatedRules = true;\r\n }),\r\n );\r\n }\r\n\r\n /**\r\n * Rules that match communication goal, sample size, and variability\r\n * (sample size labels are normalized, e.g. `10–19` vs `10-19`).\r\n */\r\n getRecomendaciones(\r\n goal: string,\r\n sampleSize: string,\r\n variability: string,\r\n ): Observable<ReglaVisual[]> {\r\n const wantSize = normalizeSampleSizeLabel(sampleSize);\r\n return this.getRulesForGoal(goal).pipe(\r\n map((reglas) =>\r\n reglas.filter(\r\n (r) =>\r\n normalizeSampleSizeLabel(r.sampleSize) === wantSize &&\r\n r.variability === variability &&\r\n !!r.recommendation,\r\n ),\r\n ),\r\n );\r\n }\r\n\r\n getRecommendationsCount(goal: string): Observable<number> {\r\n return this.http.get<unknown[]>(`${this.basePath}${goal}.json`).pipe(\r\n map((arr) => arr?.length ?? 0),\r\n catchError(() => of(0)),\r\n );\r\n }\r\n\r\n getCountsForGoals(goals: string[]): Observable<Record<string, number>> {\r\n const unique = [...new Set(goals)];\r\n const requests = unique.map((goal) =>\r\n this.getRecommendationsCount(goal).pipe(map((count) => ({ goal, count }))),\r\n );\r\n\r\n return forkJoin(requests).pipe(\r\n map((pairs) =>\r\n pairs.reduce(\r\n (acc, { goal, count }) => {\r\n acc[goal] = count;\r\n return acc;\r\n },\r\n {} as Record<string, number>,\r\n ),\r\n ),\r\n );\r\n }\r\n}\r\n","// projects/data-suggestions/src/lib/data-suggestions.service.ts\r\nimport { Injectable } from '@angular/core';\r\n import { Observable, forkJoin, map } from 'rxjs';\r\n\r\nimport { DataPoint, SuggestionRow, SuggestionsResult } from '../../types';\r\nimport { VISUAL_VARIABLE_INDEX_BY_NAME } from '../../config/visual-variable-index-map';\r\nimport {\r\n CommunicationRulesService,\r\n normalizeSampleSizeLabel,\r\n ReglaVisual,\r\n} from '../communicationRule/CommunicationRulesService';\r\n\r\nexport interface DatasetRecommendationCount<T = any> {\r\n dataset: T;\r\n recommendationCount: number;\r\n}\r\n\r\nfunction parseRuleIndex(raw: unknown, fallback: number): number {\r\n if (typeof raw === 'number' && Number.isFinite(raw)) return raw;\r\n if (typeof raw === 'string' && raw.trim() !== '') {\r\n const n = Number(raw);\r\n if (Number.isFinite(n)) return n;\r\n }\r\n return fallback;\r\n}\r\n\r\nfunction isExplicitIndex(raw: unknown): boolean {\r\n if (raw === null || raw === undefined) return false;\r\n if (typeof raw === 'number' && Number.isFinite(raw)) return true;\r\n if (typeof raw === 'string' && raw.trim() !== '') {\r\n const n = Number(raw);\r\n return Number.isFinite(n);\r\n }\r\n return false;\r\n}\r\n\r\nfunction firstFreeIndex(used: Set<number>): number {\r\n let n = 1;\r\n while (used.has(n)) n++;\r\n return n;\r\n}\r\n\r\n/**\r\n * Per-variable index (priority):\r\n * 1. `VISUAL_VARIABLE_INDEX_BY_NAME` in `visual-variable-index-map.ts`\r\n * 2. `index` / `order` / `orden` in JSON (minimum if several rows)\r\n * 3. Auto: first free integer by first appearance order in the file\r\n */\r\nfunction buildVisualVariableIndexMap(\r\n all: ReglaVisual[],\r\n canonical: Readonly<Record<string, number>> = VISUAL_VARIABLE_INDEX_BY_NAME,\r\n): Map<string, number> {\r\n const explicitByVar = new Map<string, number>();\r\n for (const r of all) {\r\n const v = r.visualVariable?.trim();\r\n if (!v) continue;\r\n const raw = r.index ?? r.order ?? r.order;\r\n if (!isExplicitIndex(raw)) continue;\r\n const n = parseRuleIndex(raw, NaN);\r\n if (!Number.isFinite(n)) continue;\r\n const prev = explicitByVar.get(v);\r\n if (prev === undefined || n < prev) explicitByVar.set(v, n);\r\n }\r\n\r\n const firstAppearance: string[] = [];\r\n const seen = new Set<string>();\r\n for (const r of all) {\r\n const v = r.visualVariable?.trim();\r\n if (!v || seen.has(v)) continue;\r\n seen.add(v);\r\n firstAppearance.push(v);\r\n }\r\n\r\n const map = new Map<string, number>();\r\n const used = new Set<number>();\r\n\r\n for (const v of firstAppearance) {\r\n let idx: number;\r\n if (Object.prototype.hasOwnProperty.call(canonical, v)) {\r\n idx = canonical[v]!;\r\n } else if (explicitByVar.has(v)) {\r\n idx = explicitByVar.get(v)!;\r\n } else {\r\n idx = firstFreeIndex(used);\r\n }\r\n map.set(v, idx);\r\n used.add(idx);\r\n }\r\n return map;\r\n}\r\n\r\n@Injectable({ providedIn: 'root' })\r\nexport class DataSuggestionsService {\r\n constructor(private readonly rulesService: CommunicationRulesService) {}\r\n\r\n analyze(dataset: DataPoint[], goal: string): Observable<SuggestionsResult> {\r\n const suggestedGraph = this.analyzBestGraph(dataset, goal);\r\n\r\n const { dataVariability, dataSize } = this.computeStats(dataset);\r\n\r\n return this.rulesService.getRulesForGoal(goal).pipe(\r\n map((allRules) => {\r\n const indexByVariable = buildVisualVariableIndexMap(allRules);\r\n const wantSize = normalizeSampleSizeLabel(dataSize);\r\n const reglas = allRules.filter(\r\n (r) =>\r\n normalizeSampleSizeLabel(r.sampleSize) === wantSize &&\r\n r.variability === dataVariability &&\r\n !!r.recommendation,\r\n );\r\n\r\n const rules: SuggestionRow[] = reglas.map((r) => {\r\n const name = r.visualVariable ?? '';\r\n return {\r\n visualVariable: name,\r\n recommendation: r.recommendation ?? '',\r\n index: indexByVariable.get(name.trim()) ?? 0,\r\n };\r\n });\r\n\r\n rules.sort(\r\n (a, b) =>\r\n a.index - b.index ||\r\n a.visualVariable.localeCompare(b.visualVariable, 'en', { sensitivity: 'base' }),\r\n );\r\n\r\n return {\r\n dataSize,\r\n dataVariability,\r\n suggestedGraph,\r\n rules,\r\n };\r\n }),\r\n );\r\n }\r\n\r\n\r\n\r\n private computeStats(dataset: DataPoint[]): {\r\n dataSize: '≤5' | '6-9' | '10-19' | '>20';\r\n dataVariability: 'Low' | 'Moderate' | 'High';\r\n } {\r\n const values = dataset.map((d) => d.value);\r\n const n = values.length;\r\n if (!n) {\r\n return { dataSize: '≤5', dataVariability: 'Low' };\r\n }\r\n\r\n const mean = values.reduce((a, b) => a + b, 0) / n;\r\n const variance = values.reduce((a, b) => a + Math.pow(b - mean, 2), 0) / n;\r\n const stdDev = Math.sqrt(variance);\r\n const coefVar = mean === 0 ? 0 : stdDev / mean;\r\n\r\n let vari: 'Low' | 'Moderate' | 'High';\r\n if (coefVar < 0.1) vari = 'Low';\r\n else if (coefVar <= 0.5) vari = 'Moderate';\r\n else vari = 'High';\r\n\r\n let sc: '≤5' | '6-9' | '10-19' | '>20';\r\n if (n <= 5) sc = '≤5';\r\n else if (n <= 9) sc = '6-9';\r\n else if (n <= 20) sc = '10-19';\r\n else sc = '>20';\r\n\r\n return { dataSize: sc, dataVariability: vari };\r\n }\r\n\r\n getRecommendationCount(dataset: DataPoint[], goal: string): Observable<number> {\r\n const { dataVariability, dataSize } = this.computeStats(dataset);\r\n\r\n return this.rulesService.getRulesForGoal(goal).pipe(\r\n map((allRules) => this.getMatchingRules(allRules, dataSize, dataVariability).length),\r\n );\r\n }\r\n\r\n getRecommendationCountsForDatasets<T extends { data: DataPoint[] }>(\r\n datasets: T[],\r\n goal: string,\r\n ): Observable<DatasetRecommendationCount<T>[]> {\r\n return forkJoin(\r\n datasets.map((dataset) =>\r\n this.getRecommendationCount(dataset.data, goal).pipe(\r\n map((recommendationCount) => ({\r\n dataset,\r\n recommendationCount,\r\n })),\r\n ),\r\n ),\r\n );\r\n }\r\n\r\n private getMatchingRules(\r\n allRules: ReglaVisual[],\r\n dataSize: '≤5' | '6-9' | '10-19' | '>20',\r\n dataVariability: 'Low' | 'Moderate' | 'High',\r\n ): ReglaVisual[] {\r\n const wantSize = normalizeSampleSizeLabel(dataSize);\r\n\r\n return allRules.filter(\r\n (r) =>\r\n normalizeSampleSizeLabel(r.sampleSize) === wantSize &&\r\n r.variability === dataVariability &&\r\n !!r.recommendation,\r\n );\r\n }\r\n\r\n private analyzBestGraph(_dataset: DataPoint[], _goal: string): 'bars' {\r\n return 'bars';\r\n }\r\n\r\n}\r\n","import {\r\n AfterViewInit,\r\n Component,\r\n ElementRef,\r\n Input,\r\n OnChanges,\r\n OnDestroy,\r\n SimpleChanges,\r\n ViewChild,\r\n} from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { Chart, ChartConfiguration, registerables } from 'chart.js';\r\nimport ChartDataLabels from 'chartjs-plugin-datalabels';\r\nimport { ButtonModule } from 'primeng/button';\r\nimport { DialogModule } from 'primeng/dialog';\r\nimport { chartsModel } from '../model/chartsModels';\r\n\r\nChart.register(...registerables, ChartDataLabels);\r\n\r\n@Component({\r\n selector: 'lib-data-suggestions-bar-chart',\r\n standalone: true,\r\n imports: [CommonModule, ButtonModule, DialogModule],\r\n templateUrl: './bar-chart.html',\r\n styleUrl: './bar-chart.css',\r\n})\r\nexport class DataSuggestionsBarChartComponent implements AfterViewInit, OnChanges, OnDestroy {\r\n\r\n @ViewChild('canvas', { static: true })\r\n canvas!: ElementRef<HTMLCanvasElement>;\r\n\r\n @Input() title: string = 'Summary';\r\n @Input() labels: string[] = [];\r\n @Input() values: number[] = [];\r\n @Input() orientation: 'Vertical' | 'Horizontal' = 'Vertical';\r\n @Input() maxValue: number = 0;\r\n @Input() stepNumber: number = 10;\r\n @Input() auxiliarLines: boolean = true;\r\n @Input() opacity: number | undefined = undefined;\r\n @Input() sortAscending: boolean = false;\r\n @Input() showLabels: boolean = false;\r\n @Input() colorPalette:'single' | 'sequential' | 'categorical' = 'single'\r\n @Input() barDistance:'none' | 'close' | 'medium' | 'wide' = 'medium'\r\n @Input() barBorderRecommendation:string =\"\"\r\n @Input() hover: 'none' | 'default' | 'intensify' | 'different' = 'default'\r\n\r\n @Input() heightPx: number = 200;\r\n\r\n\r\n @Input() minHeightPx: number = 180;\r\n @Input() maxHeightPx: number = 360;\r\n \r\n @Input() minWidthPx: number = 320;\r\n @Input() maxWidthPx: number = 900;\r\n \r\n @Input() barSizePx: number = 55;\r\n \r\n chartHeightPx: number = 220;\r\n chartWidthPx: number = 500; \r\n\r\n private chart?: Chart;\r\n\r\n\r\n\r\n constructor() {}\r\n ngAfterViewInit(): void {\r\n this.render();\r\n }\r\n\r\n ngOnChanges(changes: SimpleChanges): void {\r\n if (!this.canvas) return;\r\n\r\n if (\r\n changes['labels'] ||\r\n changes['values'] ||\r\n changes['title'] ||\r\n changes['orientation'] ||\r\n changes['maxValue'] ||\r\n changes['stepNumber'] ||\r\n changes['auxiliarLines'] ||\r\n changes['opacity'] ||\r\n changes['sortAscending'] ||\r\n changes[\"showLabels\"] ||\r\n changes[\"colorPalette\"] ||\r\n changes[\"barBorderRecommendation\"] ||\r\n changes[\"barDistance\"] ||\r\n changes[\"hover\"] ||\r\n changes['heightPx']\r\n ) {\r\n this.render();\r\n }\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this.chart?.destroy();\r\n }\r\n\r\n private render(): void {\r\n \r\n const safeLen = Math.min(this.labels.length, this.values.length);\r\n\r\n let labels = this.labels.slice(0, safeLen);\r\n let values = this.values.slice(0, safeLen);\r\n \r\n this.updateChartSize(safeLen);\r\n\r\n\r\n if (this.sortAscending) {\r\n const combined = labels.map((label, index) => ({\r\n label,\r\n value: values[index],\r\n }));\r\n\r\n combined.sort((a, b) => a.value - b.value);\r\n\r\n labels = combined.map((item) => item.label);\r\n values = combined.map((item) => item.value);\r\n }\r\n\r\n const indexAxis: 'x' | 'y' = this.orientation === 'Horizontal' ? 'y' : 'x';\r\n\r\n this.chart?.destroy();\r\n\r\n const spacingConfig = this.getBarSpacingConfig();\r\n\r\n const colors = this.getBarColors(values);\r\n const borderColor = this.getBorderColors(colors);\r\n const borderWidth = 1;\r\n\r\n const hoverBackgroundColor = this.getHoverBackgroundColor(colors);\r\n const hoverBorderColor = this.getHoverBorderColor(borderColor);\r\n const hoverBorderWidth =1;\r\n\r\n console.log(\"borderColor\", borderColor)\r\n\r\n\r\n const config: ChartConfiguration<'bar'> = {\r\n type: 'bar',\r\n data: {\r\n labels,\r\n datasets: [\r\n {\r\n label: this.title,\r\n data: values,\r\n backgroundColor: colors,\r\n borderColor,\r\n borderWidth,\r\n hoverBackgroundColor,\r\n hoverBorderColor,\r\n hoverBorderWidth,\r\n categoryPercentage: spacingConfig.categoryPercentage,\r\n barPercentage: spacingConfig.barPercentage,\r\n },\r\n ],\r\n },\r\n options: {\r\n indexAxis,\r\n responsive: true,\r\n maintainAspectRatio: false,\r\n plugins: {\r\n legend: { display: false },\r\n title: { display: !!this.title, text: this.title },\r\n datalabels: {\r\n display: this.showLabels,\r\n anchor: 'end',\r\n align: this.orientation === 'Horizontal' ? 'right' : 'top',\r\n formatter: (value: number) => value,\r\n color: '#333',\r\n font: {\r\n weight: 'bold',\r\n },\r\n },\r\n },\r\n scales: {\r\n x: {\r\n beginAtZero: true,\r\n max: this.orientation === 'Horizontal' ? this.maxValue : undefined,\r\n ticks: {\r\n stepSize: this.orientation === 'Horizontal' ? this.stepNumber : undefined,\r\n },\r\n grid: {\r\n display: this.orientation === 'Horizontal' ? this.auxiliarLines : false,\r\n },\r\n },\r\n y: {\r\n beginAtZero: true,\r\n max: this.orientation === 'Vertical' ? this.maxValue : undefined,\r\n ticks: {\r\n stepSize: this.orientation === 'Vertical' ? this.stepNumber : undefined,\r\n },\r\n grid: {\r\n display: this.orientation === 'Vertical' ? this.auxiliarLines : false,\r\n },\r\n },\r\n },\r\n },\r\n };\r\n\r\n this.chart = new Chart(this.canvas.nativeElement, config);\r\n }\r\n\r\n private getBarSpacingConfig(): { categoryPercentage: number; barPercentage: number } {\r\n switch (this.barDistance) {\r\n case 'none':\r\n return {\r\n categoryPercentage: 1.0,\r\n barPercentage: 1.0,\r\n };\r\n \r\n case 'close':\r\n return {\r\n categoryPercentage: 0.85,\r\n barPercentage: 0.85,\r\n };\r\n \r\n case 'medium':\r\n return {\r\n categoryPercentage: 0.65,\r\n barPercentage: 0.7,\r\n };\r\n \r\n case 'wide':\r\n return {\r\n categoryPercentage: 0.45,\r\n barPercentage: 0.5,\r\n };\r\n \r\n default:\r\n return {\r\n categoryPercentage: 0.7,\r\n barPercentage: 0.75,\r\n };\r\n }\r\n }\r\n\r\n \r\n private getBarColors(values: number[]): string[] | string {\r\n \r\n switch (this.colorPalette) {\r\n case 'single':\r\n return this.getSingleColor();\r\n \r\n case 'sequential':\r\n return this.getSequentialColors(values);\r\n \r\n case 'categorical':\r\n return this.getRandomColors(values.length);\r\n \r\n default:\r\n return this.getSingleColor();\r\n }\r\n }\r\n\r\n private getRandomColors(n: number): string[] {\r\n return Array.from({ length: n }, () => {\r\n const r = Math.floor(Math.random() * 200);\r\n const g = Math.floor(Math.random() * 200);\r\n const b = Math.floor(Math.random() * 200);\r\n const a = this.opacity ?? 0.8;\r\n \r\n return `rgba(${r}, ${g}, ${b}, ${a})`;\r\n });\r\n }\r\n\r\n private getSequentialColors(values: number[]): string[] {\r\n const max = Math.max(...values);\r\n const opacity = this.opacity ?? 0.8;\r\n \r\n return values.map((v) => {\r\n const intensity = v / max;\r\n const alpha = 0.3 + intensity * 0.7;\r\n \r\n return `rgba(54, 162, 235, ${alpha * opacity})`;\r\n });\r\n }\r\n\r\n private getSingleColor(): string {\r\n return `rgba(54, 162, 235, ${this.opacity ?? 0.7})`;\r\n }\r\n\r\n\r\n private getBorderColors(backgroundColor: string | string[]): string | string[] {\r\n const text = (this.barBorderRecommendation ?? '').trim().toLowerCase();\r\n \r\n const getColor = () => {\r\n switch (text) {\r\n case 'dark border':\r\n case 'dark border or no border':\r\n return 'rgba(0, 0, 0, 0.7)'; // negro con la misma opacidad\r\n \r\n case 'light border':\r\n return 'rgba(220, 220, 220, 0.7)'; // gris claro\r\n \r\n case 'same color as the bar':\r\n case 'no border':\r\n case 'indifferent':\r\n default:\r\n return null; // usar color de la barra\r\n }\r\n };\r\n \r\n const border = getColor();\r\n \r\n if (!border) {\r\n return backgroundColor;\r\n }\r\n \r\n return Array.isArray(backgroundColor)\r\n ? backgroundColor.map(() => border)\r\n : border;\r\n }\r\n\r\n private intensifyRgbaColor(color: string): string {\r\n const match = color.match(/rgba?\\((\\d+),\\s*(\\d+),\\s*(\\d+)(?:,\\s*([\\d.]+))?\\)/i);\r\n \r\n if (!match) return color;\r\n \r\n let r = Number(match[1]);\r\n let g = Number(match[2]);\r\n let b = Number(match[3]);\r\n const a = match[4] !== undefined ? Number(match[4]) : (this.opacity ?? 0.7);\r\n \r\n\r\n const darkFactor = 0.8;\r\n r *= darkFactor;\r\n g *= darkFactor;\r\n b *= darkFactor;\r\n\r\n const avg = (r + g + b) / 3;\r\n \r\n const saturationFactor = 1.25;\r\n \r\n r = avg + (r - avg) * saturationFactor;\r\n g = avg + (g - avg) * saturationFactor;\r\n b = avg + (b - avg) * saturationFactor;\r\n \r\n // clamp\r\n r = Math.min(255, Math.max(0, Math.round(r)));\r\n g = Math.min(255, Math.max(0, Math.round(g)));\r\n b = Math.min(255, Math.max(0, Math.round(b)));\r\n \r\n return `rgba(${r}, ${g}, ${b}, ${a})`;\r\n }\r\n private getDifferentHoverColor(): string {\r\n return `rgba(255, 159, 64, ${this.opacity ?? 0.7})`;\r\n }\r\n\r\nprivate getHoverBackgroundColor(backgroundColor: string | string[]): string | string[] | undefined {\r\n\r\n\r\n switch (this.hover) {\r\n case 'default':\r\n return undefined;\r\n\r\n case 'none':\r\n return backgroundColor;\r\n\r\n case 'intensify':\r\n return Array.isArray(backgroundColor)\r\n ? backgroundColor.map((color) => this.intensifyRgbaColor(color))\r\n : this.intensifyRgbaColor(backgroundColor);\r\n\r\n case 'different': {\r\n const hoverColor = this.getDifferentHoverColor();\r\n return Array.isArray(backgroundColor)\r\n ? backgroundColor.map(() => hoverColor)\r\n : hoverColor;\r\n }\r\n\r\n default:\r\n return undefined;\r\n }\r\n}\r\n\r\nprivate getHoverBorderColor(borderColor: string | string[]): string | string[] | undefined {\r\n\r\n\r\n switch (this.hover) {\r\n case 'default':\r\n return undefined;\r\n\r\n case 'none':\r\n return borderColor;\r\n\r\n case 'intensify':\r\n return Array.isArray(borderColor)\r\n ? borderColor.map(() => `rgba(0, 0, 0, ${this.opacity ?? 0.7})`)\r\n : `rgba(0, 0, 0, ${this.opacity ?? 0.7})`;\r\n\r\n case 'different':\r\n return Array.isArray(borderColor)\r\n ? borderColor.map(() => `rgba(120, 60, 0, ${this.opacity ?? 0.7})`)\r\n : `rgba(120, 60, 0, ${this.opacity ?? 0.7})`;\r\n\r\n default:\r\n return undefined;\r\n }\r\n}\r\nprivate updateChartSize(numberOfBars: number): void {\r\n const safeBars = Math.max(numberOfBars, 1);\r\n\r\n if (this.orientation === 'Vertical') {\r\n this.chartWidthPx = this.clamp(\r\n safeBars * this.barSizePx,\r\n this.minWidthPx,\r\n this.maxWidthPx\r\n );\r\n\r\n this.chartHeightPx = this.clamp(\r\n this.heightPx,\r\n this.minHeightPx,\r\n this.maxHeightPx\r\n );\r\n } else {\r\n this.chartWidthPx = this.clamp(\r\n this.maxWidthPx,\r\n this.minWidthPx,\r\n this.maxWidthPx\r\n );\r\n\r\n this.chartHeightPx = this.clamp(\r\n safeBars * 40,\r\n this.minHeightPx,\r\n this.maxHeightPx\r\n );\r\n }\r\n}\r\n\r\nprivate clamp(value: number, min: number, max: number): number {\r\n return Math.min(Math.max(value, min), max);\r\n}\r\n\r\n}","<div class=\"chart-wrap\" [style.height.px]=\"chartHeightPx\"\r\n[style.width.px]=\"chartWidthPx\">\r\n <canvas #canvas></canvas>\r\n</div>\r\n","// projects/data-suggestions/src/lib/data-suggestions-table.component.ts\r\nimport { CommonModule } from '@angular/common';\r\nimport { Component, Input, OnChanges } from '@angular/core';\r\nimport { Observable, of, Subject, takeUntil, tap } from 'rxjs';\r\nimport { DataPoint, SuggestionRow, SuggestionsResult } from '../types';\r\nimport { DataSuggestionsService } from '../services/data-suggestions-service/data-suggestions';\r\nimport { DataSuggestionsBarChartComponent } from '../bar-chart/bar-chart';\r\nimport { chartsModel } from '../model/chartsModels';\r\nimport { ButtonModule } from 'primeng/button';\r\nimport { DialogModule } from 'primeng/dialog';\r\n\r\nfunction findRule(rules: SuggestionRow[], ...names: string[]): SuggestionRow | undefined {\r\n for (const n of names) {\r\n const hit = rules.find((r) => r.visualVariable === n);\r\n if (hit) return hit;\r\n }\r\n return undefined;\r\n}\r\n\r\n@Component({\r\n selector: 'chart-gen',\r\n standalone: true,\r\n imports: [CommonModule, DataSuggestionsBarChartComponent, ButtonModule, DialogModule ],\r\n templateUrl: './data-suggestions-table.html',\r\n styleUrl: './data-suggestions-table.scss',\r\n})\r\nexport class DataSuggestionsTableComponent implements OnChanges {\r\n @Input({ required: true }) dataset: DataPoint[] = [];\r\n @Input({ required: true }) goal!: string;\r\n\r\n result$: Observable<SuggestionsResult | null> = of(null);\r\n private readonly destroy$ = new Subject<void>();\r\n showGraph: boolean = false;\r\n showJsonInfoDialog: boolean = false;\r\n jsonExample = `{\r\n \"data\": [\r\n { \"key\": \"Monday\", \"value\": 30 },\r\n { \"key\": \"Tuesday\", \"value\": 42 },\r\n { \"key\": \"Wednesday\", \"value\": 35 },\r\n { \"key\": \"Thursday\", \"value\": 50 },\r\n { \"key\": \"Friday\", \"value\": 38 }\r\n ]\r\n }`;\r\n jsonExample1 = `[\r\n { \"key\": \"Monday\", \"value\": 30 },\r\n { \"key\": \"Tuesday\", \"value\": 42 },\r\n { \"key\": \"Wednesday\", \"value\": 35 }\r\n ]`;\r\n \r\n jsonExample2 = `{\r\n \"Monday\": 30,\r\n \"Tuesday\": 42,\r\n \"Wednesday\": 35\r\n }`;\r\n \r\n jsonExample3 = `{\r\n \"days\": [\"Monday\", \"Tuesday\", \"Wednesday\"],\r\n \"values\": [30, 42, 35]\r\n }`;\r\n \r\n jsonExample4 = `[\r\n [\"Monday\", 30],\r\n [\"Tuesday\", 42],\r\n [\"Wednesday\", 35]\r\n ]`;\r\n resultsLength: number = 0;\r\n\r\ncommunicationGoalsServiceExample = `\r\nconstructor(\r\n private communicationGoalsService: CommunicationGoalsService\r\n) {}\r\n\r\nngOnInit(): void {\r\n this.communicationGoalsService\r\n .loadOptionsWithRuleCounts()\r\n .subscribe(goals => {\r\n console.log(goals);\r\n });\r\n}\r\n`;\r\n\r\ncommunicationGoalsResponseExample = `\r\n[\r\n {\r\n \"index\": 5,\r\n \"value\": \"Highlight the highest value (24)\",\r\n \"json\": \"highlight-the-highest-value\"\r\n }\r\n]\r\n`;\r\n\r\ncommunicationGoalUsageExample = `\r\n{\r\n \"communicationGoal\": \"highlight-the-highest-value\"\r\n}\r\n`;\r\n constructor(\r\n private readonly svc: DataSuggestionsService,\r\n public readonly chartModel: chartsModel,\r\n ) {}\r\n ngOnChanges(): void {\r\n const normalizedData = this.normalizeDataset(this.dataset);\r\n \r\n if (normalizedData.length && this.goal) {\r\n console.log('cambios en', this.dataset, this.goal);\r\n \r\n this.chartModel.chartLabels = normalizedData.map(item => item.key);\r\n this.chartModel.chartValues = normalizedData.map(item => item.value);\r\n \r\n this.result$ = this.svc.analyze(normalizedData, this.goal).pipe(\r\n tap((result) => {\r\n if (result) {\r\n this.setChartOptions(result);\r\n }\r\n }),\r\n takeUntil(this.destroy$),\r\n );\r\n }\r\n }\r\n obtainKeysAndValues() {\r\n\r\n const normalizedData = this.normalizeDataset(this.dataset);\r\n\r\n this.chartModel.chartLabels =\r\n normalizedData.map(item => item.key);\r\n \r\n this.chartModel.chartValues =\r\n normalizedData.map(item => item.value); \r\n }\r\n\r\n private normalizeDataset(dataset: any): { key: string; value: number }[] {\r\n\r\n if (!dataset) {\r\n return [];\r\n }\r\n \r\n // ==========================================\r\n // FORMATO 1: Array de objetos\r\n // ==========================================\r\n if (\r\n Array.isArray(dataset) &&\r\n dataset.every(\r\n item =>\r\n item &&\r\n typeof item === 'object' &&\r\n 'key' in item &&\r\n 'value' in item\r\n )\r\n ) {\r\n return dataset.map(item => ({\r\n key: String(item.key),\r\n value: Number(item.value)\r\n }));\r\n }\r\n \r\n // ==========================================\r\n // FORMATO 2: Array de tuplas\r\n // ==========================================\r\n if (\r\n Array.isArray(dataset) &&\r\n dataset.every(\r\n item =>\r\n Array.isArray(item) &&\r\n item.length >= 2\r\n )\r\n ) {\r\n return dataset.map(item => ({\r\n key: String(item[0]),\r\n value: Number(item[1])\r\n }));\r\n }\r\n \r\n // ==========================================\r\n // FORMATO 3: Diccionario clave-valor\r\n // ==========================================\r\n if (\r\n typeof dataset === 'object' &&\r\n !Array.isArray(dataset) &&\r\n Object.values(dataset).every(v => typeof v === 'number')\r\n ) {\r\n return Object.entries(dataset).map(([key, value]) => ({\r\n key,\r\n value: Number(value)\r\n }));\r\n }\r\n \r\n // ==========================================\r\n // FORMATO 4: Estructura columnar\r\n // ==========================================\r\n if (\r\n typeof dataset === 'object' &&\r\n !Array.isArray(dataset)\r\n ) {\r\n \r\n const arrayProperties = Object.keys(dataset)\r\n .filter(key => Array.isArray(dataset[key]));\r\n \r\n if (arrayProperties.length >= 2) {\r\n \r\n const labelsArray = dataset[arrayProperties[0]];\r\n const valuesArray = dataset[arrayProperties[1]];\r\n \r\n if (\r\n labelsArray.length === valuesArray.length &&\r\n valuesArray.every((v: any) => typeof v === 'number')\r\n ) {\r\n \r\n return labelsArray.map(\r\n (label: any, index: number) => ({\r\n key: String(label),\r\n value: Number(valuesArray[index])\r\n })\r\n );\r\n }\r\n }\r\n }\r\n \r\n console.warn('Unsupported dataset format', dataset);\r\n \r\n return [];\r\n }\r\n private setChartOptions(result: SuggestionsResult): void {\r\n this.showGraph = false;\r\n //'Bar direction'\r\n this.resultsLength = result.rules.length;\r\n const orientationRule = findRule(result.rules, 'Bar direction');\r\n const orientationRecommendation = orientationRule?.recommendation;\r\n if (orientationRecommendation === 'Horizontal' || orientationRecommendation === 'Horizontal orientation') {\r\n this.chartModel.orientation = 'Horizontal';\r\n } else if (orientationRecommendation === 'Vertical') {\r\n this.chartModel.orientation = 'Vertical';\r\n } else {\r\n this.chartModel.orientation = 'Vertical';\r\n }\r\n // 'Order'\r\n //Ordered , indiferent, Unordered\r\n const orderRule = findRule(result.rules, 'Order')\r\n const orderRecommendation = orderRule?.recommendation;\r\n if(orderRecommendation==='Ordered'){\r\n this.chartModel.ordered = true;\r\n }else{\r\n this.chartModel.ordered = false;\r\n }\r\n // 'Labels'\r\n //Do not label, do not use, indifferent, use labels, with labels, without lables\r\n const labelsRule = findRule(result.rules, 'Labels')\r\n const labelRecommendation = labelsRule?.recommendation;\r\n if(labelRecommendation==='Use labels' ||labelRecommendation ==='With labels' ){\r\n this.chartModel.labels = true;\r\n }else{\r\n this.chartModel.labels = false;\r\n }\r\n\r\n\r\n // 'Grid lines'\r\n const auxiliarLinesRec = findRule(result.rules, 'Grid lines');\r\n const gridRec = auxiliarLinesRec?.recommendation ?? '';\r\n if (gridRec === 'Without grid lines') {\r\n this.chartModel.auxiliarLines = false;\r\n } else {\r\n this.chartModel.auxiliarLines = true;\r\n }\r\n\r\n // 'Axis maximum'\r\n const maxAxisRule = findRule(result.rules, 'Axis maximum');\r\n const max = getMaxValue(this.chartModel.chartValues);\r\n switch (maxAxisRule?.recommendation) {\r\n case 'Real maximum':\r\n this.chartModel.incrementoMaximo = max;\r\n break;\r\n case '30% of the maximum':\r\n case '30% above the maximum':\r\n this.chartModel.incrementoMaximo = max + max * 0.3;\r\n break;\r\n case 'Maximum +20%':\r\n this.chartModel.incrementoMaximo = max + max * 0.2;\r\n break;\r\n case '10% above the highest value':\r\n this.chartModel.incrementoMaximo = max + max * 0.1;\r\n break;\r\n case '10% or 20% above the maximum':\r\n this.chartModel.incrementoMaximo = max + max * 0.15;\r\n break;\r\n case '20% or 30% above the maximum':\r\n this.chartModel.incrementoMaximo = max + max * 0.25;\r\n break;\r\n case 'Indifferent':\r\n default:\r\n this.chartModel.incrementoMaximo = max;\r\n break;\r\n }\r\n // 'Number of steps'\r\n \r\n const stepRec = findRule(result.rules, 'Number of steps');\r\n const stepNumber = this.calculateAxisStepByPercentage(\r\n max,\r\n stepRec ? stepRec.recommendation : 'Indifferent',\r\n );\r\n this.chartModel.numeroPasos = stepNumber;\r\n\r\n // 'Opacity'\r\n \r\n const opacityRule = findRule(result.rules, 'Opacity');\r\n const opacityRecommendation = opacityRule?.recommendation ?? 'Indifferent';\r\n\r\n switch (opacityRecommendation) {\r\n case 'Opaque':\r\n this.chartModel.opacity = 1;\r\n break;\r\n case 'Transparent':\r\n case 'More transparent':\r\n case 'Transparency':\r\n this.chartModel.opacity = 0.4;\r\n break;\r\n case 'Indifferent':\r\n default:\r\n this.chartModel.opacity = undefined;\r\n }\r\n // 'Spacing between bars'\r\n // Close bars, \"Very close or very separated\", \"Separated or widely spaced\", \"Close or separated\", \"Separated or widely spaced\", \"No spacing\",\r\n // \"Widely spaced\", \"Close\", \"Close or widely spaced\", \"Close or slightly separated\", \"Indifferent\", \" \"Close or widely spaced\"\", \r\n const spaceRule = findRule(result.rules, 'Spacing between bars');\r\n const spaceRecommendation = spaceRule?.recommendation ?? 'Indifferent';\r\n this.chartModel.separation = this.normalizeSpacingRecommendation(spaceRecommendation)\r\n // 'Bar color'\r\n //\"Random or ordered\", \"Indifferent\", \"Ordered or fully distinct\", \"Random color palette\", \r\n const barColorRule = findRule(result.rules, 'Color palette');\r\n const barColorRec = barColorRule?.recommendation ?? 'Indifferent';\r\n this.chartModel.colorPalette = this.normalizeColorMode(barColorRec)\r\n // 'Border color':\r\n //·Indifferent·, \"Light border\", \"Dark border\", \"\"Dark border or no border\", \"No border\", \"Same color as the bar\", \"Dark border\", \"Moderate\", \"Light border\"\r\n const borderColorRule = findRule(result.rules, 'Border color');\r\n const borderColorRec:any = borderColorRule?.recommendation ?? 'Indifferent';\r\n this.chartModel.borderColor = borderColorRec;\r\n\r\n //'Hover behavior'\r\n //Indifferent, \"Different color or highlighted tone\", \"Highlight color\", \"Highlight bar color\", \"Highlight\", \"Do nothing\",\"Do nothing or highlight color\",\"\"\r\n const hoverRule = findRule(result.rules, 'Hover behavior');\r\n const hoverRec:any = hoverRule?.recommendation ?? 'Indifferent';\r\n\r\n const text = (hoverRec ?? '').trim().toLowerCase();\r\n switch (text) {\r\n case 'do nothing':\r\n\r\n case '':\r\n this.chartModel.hoverRec = 'none';\r\n break;\r\n \r\n case 'indifferent':\r\n this.chartModel.hoverRec = 'default';\r\n break;\r\n \r\n case 'highlight':\r\n case 'highlight color':\r\n case 'highlight bar color':\r\n case 'do nothing or highlight color':\r\n\r\n this.chartModel.hoverRec = 'intensify';\r\n break;\r\n\r\n case 'different color or highlighted tone':\r\n this.chartModel.hoverRec = 'different';\r\n break;\r\n \r\n default:\r\n this.chartModel.hoverRec = 'default';\r\n break;\r\n }\r\n\r\n\r\n this.showGraph = true;\r\n }\r\n\r\n private calculateAxisStepByPercentage(maxAxisValue: number, recommendation: string): number {\r\n if (maxAxisValue <= 0) return 1;\r\n\r\n let percentage: number;\r\n\r\n switch (recommendation) {\r\n case 'Few steps':\r\n percentage = 0.5;\r\n break;\r\n case 'Medium steps':\r\n case 'Medium number of steps':\r\n percentage = 0.25;\r\n break;\r\n case 'Few or medium steps':\r\n percentage = 0.3;\r\n break;\r\n case 'Indifferent':\r\n default:\r\n percentage = 0.25;\r\n break;\r\n }\r\n\r\n return maxAxisValue * percentage;\r\n }\r\n\r\n private normalizeSpacingRecommendation(\r\n recommendation: string | null | undefined\r\n ): 'none' | 'close' | 'medium' | 'wide' {\r\n const text = (recommendation ?? '').trim().toLowerCase();\r\n \r\n if (!text || text === 'indifferent') return 'medium';\r\n \r\n if (text === 'no spacing') return 'none';\r\n \r\n if (text === 'close bars' || text === 'close') return 'close';\r\n \r\n if (text === 'widely spaced') return 'wide';\r\n \r\n if (text.includes('or')) return 'medium';\r\n \r\n if (text.includes('very close')) return 'none';\r\n if (text.includes('slightly separated')) return 'close';\r\n if (text.includes('separated')) return 'medium';\r\n \r\n return 'medium';\r\n }\r\n \r\n private normalizeColorMode( recommendation: string | null | undefined\r\n ): 'single' | 'sequential' | 'categorical' {\r\n console.log(\"normalizeColorMode\", recommendation)\r\n console.log(\"RECOMENDACION\", recommendation)\r\n const text = (recommendation ?? '').toLowerCase().trim();\r\n \r\n console.log(\"text\")\r\n if (!text || text === 'indifferent') {\r\n return 'single';\r\n }\r\n \r\n if (text.includes('random color palette')) {\r\n return 'categorical';\r\n }\r\n \r\n if (text.includes('ordered or fully distinct')) {\r\n return 'sequential';\r\n }\r\n \r\n if (text.includes('random or ordered')) {\r\n return 'sequential';\r\n }\r\n \r\n return 'single';\r\n }\r\n\r\n \r\n}\r\n\r\nfunction getMaxValue(values: number[]): number {\r\n if (!values.length) return 0;\r\n return Math.max(...values);\r\n}\r\n\r\n\r\n\r\n","<section class=\"panel\">\r\n <header class=\"header\">\r\n <span>Applied suggestions abc: {{ resultsLength }}</span>\r\n <!-- <button type=\"button\" (click)=\"generate()\" [disabled]=\"!dataset?.length || !goal\">\r\n Analyze\r\n </button> -->\r\n <p-button\r\n icon=\"pi pi-info-circle\"\r\n title=\"Info\"\r\n (click)=\"showJsonInfoDialog = true\"\r\n styleClass=\"p-button-text\"\r\n ></p-button>\r\n </header>\r\n\r\n \r\n @if (showGraph) {\r\n <lib-data-suggestions-bar-chart\r\n [title]=\"'Recommendations'\"\r\n [labels]=\"this.chartModel.chartLabels\"\r\n [values]=\"this.chartModel.chartValues\"\r\n [orientation]=\"this.chartModel.orientation\"\r\n [maxValue]=\"this.chartModel.incrementoMaximo\"\r\n [stepNumber]=\"this.chartModel.numeroPasos\"\r\n [auxiliarLines]=\"this.chartModel.auxiliarLines\"\r\n [heightPx]=\"320\"\r\n [opacity]=\"this.chartModel.opacity\"\r\n [sortAscending]=\"this.chartModel.ordered\"\r\n [showLabels]=\"this.chartModel.labels\"\r\n [barDistance] = \"this.chartModel.separation\"\r\n [colorPalette]=\"this.chartModel.colorPalette\"\r\n [barBorderRecommendation]=\"this.chartModel.borderColor\"\r\n [hover]=\"this.chartModel.hoverRec\"\r\n >\r\n </lib-data-suggestions-bar-chart>\r\n \r\n }\r\n \r\n</section>\r\n\r\n<p-dialog\r\nheader=\"Info\"\r\n[(visible)]=\"showJsonInfoDialog\"\r\n[modal]=\"true\"\r\n[dismissableMask]=\"true\"\r\n[style]=\"{ width: '60rem', height: '42rem' }\"\r\n[contentStyle]=\"{ height: '34rem', overflow: 'auto' }\"\r\n>\r\n\r\n<div class=\"dialog-tabs\">\r\n <button\r\ntype=\"button\"\r\nclass=\"dialog-tab\"\r\n[class.active]=\"chartModel.showingInDialog === 'suggestions'\"\r\n(click)=\"chartModel.showingInDialog = 'suggestions'\"\r\n>\r\nSuggestions\r\n</button>\r\n<button\r\ntype=\"button\"\r\nclass=\"dialog-tab\"\r\n[class.active]=\"chartModel.showingInDialog === 'data'\"\r\n(click)=\"chartModel.showingInDialog = 'data'\"\r\n>\r\nExpected data format\r\n</button>\r\n\r\n<button\r\ntype=\"button\"\r\nclass=\"dialog-tab\"\r\n[class.active]=\"chartModel.showingInDialog === 'variables'\"\r\n(click)=\"chartModel.showingInDialog = 'variables'\"\r\n>\r\nVariables overview\r\n</button>\r\n\r\n<button\r\ntype=\"button\"\r\nclass=\"dialog-tab\"\r\n[class.active]=\"chartModel.showingInDialog === 'readme'\"\r\n(click)=\"chartModel.showingInDialog = 'readme'\"\r\n>\r\nHow to use the library\r\n</button>\r\n<button\r\n type=\"button\"\r\n class=\"dialog-tab\"\r\n [class.active]=\"chartModel.showingInDialog === 'communicationGoals'\"\r\n (click)=\"chartModel.showingInDialog = 'communicationGoals'\"\r\n>\r\nCommunication Goals\r\n</button>\r\n</div>\r\n<div class=\"grid body\">\r\n @if(chartModel.showingInDialog === 'suggestions'){\r\n <ng-container *ngIf=\"result$ | async as result\">\r\n <div class=\"suggestions-content\">\r\n \r\n <div class=\"meta\">\r\n <span><strong>Size:</strong> {{ result.dataSize }}</span>\r\n <span><strong>Variability:</strong> {{ result.dataVariability }}</span>\r\n <span><strong>Suggested chart:</strong> {{ result.suggestedGraph }}</span>\r\n </div>\r\n \r\n @if(result.rules?.length){\r\n <table class=\"table\">\r\n <thead>\r\n <tr>\r\n <th>Index</th>\r\n <th>Visual variable</th>\r\n <th>Recommendation</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr *ngFor=\"let r of result.rules\">\r\n <td>{{ r.index }}</td>\r\n <td>{{ r.visualVariable }}</td>\r\n <td>{{ r.recommendation }}</td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n } @else {\r\n <p class=\"empty\">\r\n There are no suggestions for this combination.\r\n </p>\r\n }\r\n \r\n </div>\r\n </ng-container>\r\n }\r\n@if(chartModel.showingInDialog === 'data'){\r\n<p>\r\n The library accepts multiple JSON structures and automatically converts them \r\n into the internal format required to generate the chart.\r\n</p>\r\n\r\n\r\n <div class=\"json-section\">\r\n <h4>Option 1: Array of objects</h4>\r\n <pre class=\"json-example\">{{ jsonExample1 }}</pre>\r\n </div>\r\n\r\n <div class=\"json-section\">\r\n <h4>Option 2: Key-value dictionary</h4>\r\n <pre class=\"json-example\">{{ jsonExample2 }}</pre>\r\n </div>\r\n\r\n <div class=\"json-section\">\r\n <h4>Option 3: Column-oriented structure</h4>\r\n <pre class=\"json-example\">{{ jsonExample3 }}</pre>\r\n </div>\r\n\r\n <div class=\"json-section\">\r\n <h4>Option 4: Array of tuples</h4>\r\n <pre class=\"json-example\">{{ jsonExample4 }}</pre>\r\n </div>\r\n\r\n\r\n}\r\n@if(chartModel.showingInDialog === 'variables'){\r\n<img\r\nsrc=\"assets/img/ejemploVariables.jpeg\"\r\nalt=\"Summary of recommended configurations\"\r\nstyle=\"width: 400px; margin-left: 120px;\"\r\n/>\r\n\r\n}\r\n@if(chartModel.showingInDialog === 'readme'){\r\n <div class=\"info-section\">\r\n <h3>Quick Start</h3>\r\n\r\n <p>Install the library:</p>\r\n\r\n <pre><code>npm install data-suggestions</code></pre>\r\n\r\n <p>Import the component, service and communication goal constants:</p>\r\n\r\n <pre><code>import &#123;\r\n DataSuggestionsTableComponent,\r\n DataSuggestionsService,\r\n ChartGenGoals\r\n&#125; from 'data-suggestions';</code></pre>\r\n\r\n <p>Add the component to the Angular standalone imports:</p>\r\n\r\n <pre><code>@Component(&#123;\r\n standalone: true,\r\n imports: [\r\n DataSuggestionsTableComponent\r\n ]\r\n&#125;)</code></pre>\r\n\r\n <p>Use the component in your template:</p>\r\n\r\n <pre><code>&lt;chart-gen\r\n [dataset]=\"dataset\"\r\n [goal]=\"ChartGenGoals.HIGHLIGHT_HIGHEST_VALUE\"&gt;\r\n&lt;/chart-gen&gt;</code></pre>\r\n\r\n <p>\r\n The <code>dataset</code> input contains the data to be analyzed. The\r\n <code>goal</code> input defines the communication objective and must use\r\n one of the values exported by <code>ChartGenGoals</code>.\r\n </p>\r\n\r\n <h4>Supported data formats</h4>\r\n\r\n <p>The library accepts several JSON structures:</p>\r\n\r\n <pre><code>[\r\n &#123; \"key\": \"Monday\", \"value\": 30 &#125;,\r\n &#123; \"key\": \"Tuesday\", \"value\": 42 &#125;\r\n]</code></pre>\r\n\r\n <pre><code>&#123;\r\n \"Monday\": 30,\r\n \"Tuesday\": 42\r\n&#125;</code></pre>\r\n\r\n <pre><code>&#123;\r\n \"labels\": [\"Monday\", \"Tuesday\"],\r\n \"values\": [30, 42]\r\n&#125;</code></pre>\r\n\r\n <pre><code>[\r\n [\"Monday\", 30],\r\n [\"Tuesday\", 42]\r\n]</code></pre>\r\n\r\n <h4>Available communication goals</h4>\r\n\r\n <pre><code>ChartGenGoals.COUNT_REPEATED_VALUE\r\nChartGenGoals.COUNT_EXCEEDED_THRESHOLD\r\nChartGenGoals.COUNT_BELOW_THRESHOLD\r\nChartGenGoals.HIGHLIGHT_VALUE\r\nChartGenGoals.HIGHLIGHT_HIGHEST_VALUE\r\nChartGenGoals.HIGHLIGHT_LOWEST_VALUE\r\nChartGenGoals.HIGHLIGHT_HIGHER_VALUES\r\nChartGenGoals.HIGHLIGHT_LOWER_VALUES</code></pre>\r\n\r\n <h4>Recommendation counts</h4>\r\n\r\n <p>\r\n The library also provides a service to calculate how many recommendations\r\n would be applied to each dataset for a selected communication goal.\r\n </p>\r\n\r\n <pre><code>this.dataSuggestionsService\r\n .getRecommendationCountsForDatasets(datasets, goal)\r\n .subscribe(results =&gt; &#123;\r\n this.datasetOptions = results\r\n .map((&#123; dataset, recommendationCount &#125;) =&gt; (&#123;\r\n ...dataset,\r\n displayLabel: `$&#123;dataset.label&#125; ($&#123;recommendationCount&#125;)`,\r\n recommendationCount\r\n &#125;))\r\n .sort((a, b) =&gt; b.recommendationCount - a.recommendationCount);\r\n &#125;);</code></pre>\r\n </div>\r\n}\r\n@if(chartModel.showingInDialog === 'communicationGoals'){\r\n <div class=\"communication-goals-content\">\r\n <h3>Communication Goals</h3>\r\n\r\n <p>\r\n Communication goals are exported by the library through\r\n <code>ChartGenGoals</code>. Each key maps to the internal JSON rule file\r\n used to generate recommendations.\r\n </p>\r\n\r\n <pre><code>import &#123; ChartGenGoals &#125; from 'data-suggestions';</code></pre>\r\n\r\n <p>Example:</p>\r\n\r\n <pre><code>goal = ChartGenGoals.HIGHLIGHT_HIGHEST_VALUE;</code></pre>\r\n\r\n <p>Available goals:</p>\r\n\r\n <pre><code>ChartGenGoals.COUNT_REPEATED_VALUE\r\nChartGenGoals.COUNT_EXCEEDED_THRESHOLD\r\nChartGenGoals.COUNT_BELOW_THRESHOLD\r\nChartGenGoals.HIGHLIGHT_VALUE\r\nChartGenGoals.HIGHLIGHT_HIGHEST_VALUE\r\nChartGenGoals.HIGHLIGHT_LOWEST_VALUE\r\nChartGenGoals.HIGHLIGHT_HIGHER_VALUES\r\nChartGenGoals.HIGHLIGHT_LOWER_VALUES</code></pre>\r\n </div>\r\n}\r\n</div>\r\n<!-- <p>\r\nEl archivo debe ser un JSON con una propiedad <strong>data</strong> que sea\r\nun array de objetos con <strong>key</strong> y <strong>value</strong>.\r\n</p>\r\n\r\n<pre class=\"json-example\">{{ jsonExample }}</pre>\r\n-->\r\n<ng-template pTemplate=\"footer\">\r\n<p-button\r\n label=\"Cerrar\"\r\n icon=\"pi pi-check\"\r\n (click)=\"showJsonInfoDialog = false\"\r\n></p-button>\r\n</ng-template>\r\n</p-dialog>","/*\r\n * Public API Surface of data-suggestions\r\n */\r\n\r\nexport * from './lib/types';\r\nexport * from './lib/config/visual-variable-index-map';\r\nexport * from './lib/config/communication-goals.config';\r\nexport * from './lib/services/data-suggestions-service/data-suggestions';\r\nexport * from './lib/data-suggestions-table/data-suggestions-table';\r\nexport * from './lib/bar-chart/bar-chart';","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i2.chartsModel","i1.CommunicationRulesService","i1.DataSuggestionsService"],"mappings":";;;;;;;;;;;;;;AAAA;;;AAGG;AACI,MAAM,6BAA6B,GAAqC;AAC7E,IAAA,eAAe,EAAE,CAAC;AAClB,IAAA,OAAO,EAAE,CAAC;AACV,IAAA,QAAQ,EAAE,CAAC;AACX,IAAA,YAAY,EAAE,CAAC;AACf,IAAA,cAAc,EAAE,CAAC;AACjB,IAAA,iBAAiB,EAAE,CAAC;AACpB,IAAA,SAAS,EAAE,CAAC;AACZ,IAAA,sBAAsB,EAAE,CAAC;AACzB,IAAA,eAAe,EAAE,CAAC;AAClB,IAAA,cAAc,EAAE,EAAE;AAClB,IAAA,gBAAgB,EAAE,EAAE;;AAGtB;AACM,SAAU,gCAAgC,CAAC,cAAsB,EAAA;AACrE,IAAA,MAAM,GAAG,GAAG,cAAc,CAAC,IAAI,EAAE;AACjC,IAAA,MAAM,CAAC,GAAG,6BAA6B,CAAC,GAAG,CAAC;IAC5C,OAAO,CAAC,KAAK,SAAS,GAAG,CAAC,GAAG,SAAS;AACxC;;ACvBO,MAAM,aAAa,GAAG;AAC3B,IAAA,oBAAoB,EAAE,8CAA8C;AACpE,IAAA,wBAAwB,EAAE,yCAAyC;AACnE,IAAA,qBAAqB,EAAE,6CAA6C;AACpE,IAAA,eAAe,EAAE,mB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AAA,UAAA,EAAA,MAAA,EAAA,UAAA,EAAA,SAAA,EAAA,iBAAA,EAAA,gBAAA,EAAA,mBAAA,EAAA,sBAAA,EAAA,sBAAA,EAAA,kBAAA,CAAA,EAAA,OAAA,EAAA,CAAA,QAAA,EAAA,QAAA,EAAA,eAAA,EAAA,cAAA,EAAA,aAAA,EAAA,WAAA,EAAA,YAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,OAAA,EAAA,CAAA,EAAA,CAAA;;4FAIzE,6BAA6B,EAAA,UAAA,EAAA,CAAA;kBAPzC,SAAS;+BACE,WAAW,EAAA,UAAA,EACT,IAAI,EAAA,OAAA,EACP,CAAC,YAAY,EAAE,gCAAgC,EAAE,YAAY,EAAE,YAAY,CAAE,EAAA,QAAA,EAAA,kqSAAA,EAAA,MAAA,EAAA,CAAA,m9CAAA,CAAA,EAAA;;sBAKrF,KAAK;uBAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;;sBACxB,KAAK;uBAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;;AAqa3B,SAAS,WAAW,CAAC,MAAgB,EAAA;IACnC,IAAI,CAAC,MAAM,CAAC,MAAM;AAAE,QAAA,OAAO,CAAC;AAC5B,IAAA,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC;AAC5B;;AEpcA;;AAEG;;ACFH;;AAEG;;;;"}
package/index.d.ts CHANGED
@@ -1,8 +1,7 @@
1
- import { HttpClient } from '@angular/common/http';
2
1
  import { Observable } from 'rxjs';
2
+ import { HttpClient } from '@angular/common/http';
3
3
  import * as i0 from '@angular/core';
4
4
  import { OnChanges, AfterViewInit, OnDestroy, ElementRef, SimpleChanges } from '@angular/core';
5
- import * as data_suggestions from 'data-suggestions';
6
5
 
7
6
  type CommunicationGoalSlug = string;
8
7
  /** Entrada del desplegable de objetivo (compatible con PrimeNG optionLabel/value). */
@@ -37,18 +36,17 @@ declare const VISUAL_VARIABLE_INDEX_BY_NAME: Readonly<Record<string, number>>;
37
36
  /** Returns configured index after trim, or undefined if not listed. */
38
37
  declare function getConfiguredVisualVariableIndex(visualVariable: string): number | undefined;
39
38
 
40
- interface CommunicationGoalDefinition {
41
- index: number;
42
- label: string;
43
- /** Must match `assets/recomendaciones/<jsonSlug>.json`. */
44
- jsonSlug: string;
45
- }
46
- /**
47
- * Single catalog of communication goals and their rules JSON.
48
- * Host apps should use `CommunicationGoalsService` instead of duplicating this list.
49
- */
50
- declare const COMMUNICATION_GOAL_DEFINITIONS: readonly CommunicationGoalDefinition[];
51
- declare function definitionsToBaseOptions(): CommunicationGoalOption[];
39
+ declare const ChartGenGoals: {
40
+ readonly COUNT_REPEATED_VALUE: "count-times-that-a-certain-value-is-repeated";
41
+ readonly COUNT_EXCEEDED_THRESHOLD: "count-times-a-certain-value-is-exceeded";
42
+ readonly COUNT_BELOW_THRESHOLD: "count-times-does-not-exceed-a-certain-value";
43
+ readonly HIGHLIGHT_VALUE: "highlight-a-value";
44
+ readonly HIGHLIGHT_HIGHEST_VALUE: "highlight-the-highest-value";
45
+ readonly HIGHLIGHT_LOWEST_VALUE: "highlight-the-lowest-value";
46
+ readonly HIGHLIGHT_HIGHER_VALUES: "highlight-higher-values";
47
+ readonly HIGHLIGHT_LOWER_VALUES: "highlight-lower-values";
48
+ };
49
+ type ChartGenGoal = (typeof ChartGenGoals)[keyof typeof ChartGenGoals];
52
50
 
53
51
  declare class chartsModel {
54
52
  data: any;
@@ -132,8 +130,6 @@ declare class chartsModel {
132
130
  static ɵprov: i0.ɵɵInjectableDeclaration<chartsModel>;
133
131
  }
134
132
 
135
- /** Normalizes en/em dashes in sample-size labels so JSON matches computed stats. */
136
- declare function normalizeSampleSizeLabel(s: string | null | undefined): string;
137
133
  interface ReglaVisual {
138
134
  index?: number | null;
139
135
  order?: number | null;
@@ -161,40 +157,25 @@ declare class CommunicationRulesService {
161
157
  static ɵprov: i0.ɵɵInjectableDeclaration<CommunicationRulesService>;
162
158
  }
163
159
 
160
+ interface DatasetRecommendationCount<T = any> {
161
+ dataset: T;
162
+ recommendationCount: number;
163
+ }
164
164
  declare class DataSuggestionsService {
165
165
  private readonly rulesService;
166
166
  constructor(rulesService: CommunicationRulesService);
167
167
  analyze(dataset: DataPoint[], goal: string): Observable<SuggestionsResult>;
168
- private analyzBestGraph;
169
168
  private computeStats;
169
+ getRecommendationCount(dataset: DataPoint[], goal: string): Observable<number>;
170
+ getRecommendationCountsForDatasets<T extends {
171
+ data: DataPoint[];
172
+ }>(datasets: T[], goal: string): Observable<DatasetRecommendationCount<T>[]>;
173
+ private getMatchingRules;
174
+ private analyzBestGraph;
170
175
  static ɵfac: i0.ɵɵFactoryDeclaration<DataSuggestionsService, never>;
171
176
  static ɵprov: i0.ɵɵInjectableDeclaration<DataSuggestionsService>;
172
177
  }
173
178
 
174
- /**
175
- * Facade for host apps: goal catalog, rule counts, raw/filtered rules, and full suggestions
176
- * (same pipeline as `data-suggestions-table`).
177
- */
178
- declare class CommunicationGoalsService {
179
- private readonly rulesService;
180
- private readonly suggestionsService;
181
- constructor(rulesService: CommunicationRulesService, suggestionsService: DataSuggestionsService);
182
- /** Goal definitions (index, label, JSON slug). */
183
- getDefinitions(): readonly data_suggestions.CommunicationGoalDefinition[];
184
- /** Dropdown options without HTTP (label in `value`, slug in `json`). */
185
- getBaseOptions(): CommunicationGoalOption[];
186
- /** Same options with `(n)` rule count per JSON file. */
187
- loadOptionsWithRuleCounts(): Observable<CommunicationGoalOption[]>;
188
- /** Full rules array from `assets/recomendaciones/<goalSlug>.json`. */
189
- getRulesForGoal(goalSlug: CommunicationGoalSlug): Observable<ReglaVisual[]>;
190
- /** Rules filtered by sample size and variability (for custom UIs). */
191
- getRecommendations(goalSlug: CommunicationGoalSlug, sampleSize: string, variability: string): Observable<ReglaVisual[]>;
192
- /** Dataset stats + ordered suggestion rows (table / chart binding). */
193
- getSuggestionsResult(dataset: DataPoint[], goalSlug: CommunicationGoalSlug): Observable<SuggestionsResult>;
194
- static ɵfac: i0.ɵɵFactoryDeclaration<CommunicationGoalsService, never>;
195
- static ɵprov: i0.ɵɵInjectableDeclaration<CommunicationGoalsService>;
196
- }
197
-
198
179
  declare class DataSuggestionsTableComponent implements OnChanges {
199
180
  private readonly svc;
200
181
  readonly chartModel: chartsModel;
@@ -222,7 +203,7 @@ declare class DataSuggestionsTableComponent implements OnChanges {
222
203
  private normalizeSpacingRecommendation;
223
204
  private normalizeColorMode;
224
205
  static ɵfac: i0.ɵɵFactoryDeclaration<DataSuggestionsTableComponent, never>;
225
- static ɵcmp: i0.ɵɵComponentDeclaration<DataSuggestionsTableComponent, "data-suggestions-table", never, { "dataset": { "alias": "dataset"; "required": true; }; "goal": { "alias": "goal"; "required": true; }; }, {}, never, never, true, never>;
206
+ static ɵcmp: i0.ɵɵComponentDeclaration<DataSuggestionsTableComponent, "chart-gen", never, { "dataset": { "alias": "dataset"; "required": true; }; "goal": { "alias": "goal"; "required": true; }; }, {}, never, never, true, never>;
226
207
  }
227
208
 
228
209
  declare class DataSuggestionsBarChartComponent implements AfterViewInit, OnChanges, OnDestroy {
@@ -271,5 +252,5 @@ declare class DataSuggestionsBarChartComponent implements AfterViewInit, OnChang
271
252
  static ɵcmp: i0.ɵɵComponentDeclaration<DataSuggestionsBarChartComponent, "lib-data-suggestions-bar-chart", never, { "title": { "alias": "title"; "required": false; }; "labels": { "alias": "labels"; "required": false; }; "values": { "alias": "values"; "required": false; }; "orientation": { "alias": "orientation"; "required": false; }; "maxValue": { "alias": "maxValue"; "required": false; }; "stepNumber": { "alias": "stepNumber"; "required": false; }; "auxiliarLines": { "alias": "auxiliarLines"; "required": false; }; "opacity": { "alias": "opacity"; "required": false; }; "sortAscending": { "alias": "sortAscending"; "required": false; }; "showLabels": { "alias": "showLabels"; "required": false; }; "colorPalette": { "alias": "colorPalette"; "required": false; }; "barDistance": { "alias": "barDistance"; "required": false; }; "barBorderRecommendation": { "alias": "barBorderRecommendation"; "required": false; }; "hover": { "alias": "hover"; "required": false; }; "heightPx": { "alias": "heightPx"; "required": false; }; "minHeightPx": { "alias": "minHeightPx"; "required": false; }; "maxHeightPx": { "alias": "maxHeightPx"; "required": false; }; "minWidthPx": { "alias": "minWidthPx"; "required": false; }; "maxWidthPx": { "alias": "maxWidthPx"; "required": false; }; "barSizePx": { "alias": "barSizePx"; "required": false; }; }, {}, never, never, true, never>;
272
253
  }
273
254
 
274
- export { COMMUNICATION_GOAL_DEFINITIONS, CommunicationGoalsService, CommunicationRulesService, DataSuggestionsBarChartComponent, DataSuggestionsService, DataSuggestionsTableComponent, VISUAL_VARIABLE_INDEX_BY_NAME, definitionsToBaseOptions, getConfiguredVisualVariableIndex, normalizeSampleSizeLabel };
275
- export type { CommunicationGoalDefinition, CommunicationGoalOption, CommunicationGoalSlug, DataPoint, ReglaVisual, SuggestionRow, SuggestionsResult };
255
+ export { ChartGenGoals, DataSuggestionsBarChartComponent, DataSuggestionsService, DataSuggestionsTableComponent, VISUAL_VARIABLE_INDEX_BY_NAME, getConfiguredVisualVariableIndex };
256
+ export type { ChartGenGoal, CommunicationGoalOption, CommunicationGoalSlug, DataPoint, DatasetRecommendationCount, SuggestionRow, SuggestionsResult };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "data-suggestions",
3
- "version": "1.0.2",
3
+ "version": "2.0.0",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^20.3.0",
6
6
  "@angular/core": "^20.3.0",