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.
- package/README.md +241 -241
- package/assets/recomendaciones/count-times-that-a-certain-value-is-repeated.json +2 -2
- package/assets/recomendaciones/highlight-higher-values.json +121 -121
- package/assets/recomendaciones/highlight-lower-values.json +121 -121
- package/assets/recomendaciones/highlight-the-second-lowest-value.json +91 -91
- package/assets/recomendaciones/highlight-the-third-highest-value.json +79 -79
- package/fesm2022/data-suggestions.mjs +44 -120
- package/fesm2022/data-suggestions.mjs.map +1 -1
- package/index.d.ts +25 -44
- package/package.json +1 -1
|
@@ -1,80 +1,80 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"visualVariable": "Border color",
|
|
4
|
-
"sampleSize": "≤5",
|
|
5
|
-
"variability": "Moderate",
|
|
6
|
-
"recommendation": "Indifferent"
|
|
7
|
-
},
|
|
8
|
-
{
|
|
9
|
-
"visualVariable": "Hover behavior",
|
|
10
|
-
"sampleSize": "≤5",
|
|
11
|
-
"variability": "Moderate",
|
|
12
|
-
"recommendation": "Indifferent"
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
"visualVariable": "Bar direction",
|
|
16
|
-
"sampleSize": "≤5",
|
|
17
|
-
"variability": "High",
|
|
18
|
-
"recommendation": "Horizontal"
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
"visualVariable": "Bar direction",
|
|
22
|
-
"sampleSize": null,
|
|
23
|
-
"variability": "Moderate",
|
|
24
|
-
"recommendation": "Indifferent"
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"visualVariable": "Spacing between bars",
|
|
28
|
-
"sampleSize": "≤5",
|
|
29
|
-
"variability": "Moderate",
|
|
30
|
-
"recommendation": "Indifferent"
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
"visualVariable": "Labels",
|
|
34
|
-
"sampleSize": "≤5",
|
|
35
|
-
"variability": "Moderate",
|
|
36
|
-
"recommendation": "Indifferent"
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
"visualVariable": "Color palette",
|
|
40
|
-
"sampleSize": "≤5",
|
|
41
|
-
"variability": "Moderate",
|
|
42
|
-
"recommendation": "Random color palette"
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
"visualVariable": "Axis maximum",
|
|
46
|
-
"sampleSize": "≤5",
|
|
47
|
-
"variability": "Moderate",
|
|
48
|
-
"recommendation": "Indifferent"
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
"visualVariable": "Number of steps",
|
|
52
|
-
"sampleSize": ">20",
|
|
53
|
-
"variability": "High",
|
|
54
|
-
"recommendation": "Few steps"
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
"visualVariable": "Number of steps",
|
|
58
|
-
"sampleSize": "≤5",
|
|
59
|
-
"variability": "Moderate",
|
|
60
|
-
"recommendation": "Indifferent"
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
"visualVariable": "Order",
|
|
64
|
-
"sampleSize": "≤5",
|
|
65
|
-
"variability": "Moderate",
|
|
66
|
-
"recommendation": "Ordered"
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
"visualVariable": "Opacity",
|
|
70
|
-
"sampleSize": ">20",
|
|
71
|
-
"variability": "High",
|
|
72
|
-
"recommendation": "Transparent"
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
"visualVariable": "Opacity",
|
|
76
|
-
"sampleSize": "≤5",
|
|
77
|
-
"variability": "Moderate",
|
|
78
|
-
"recommendation": "Opaque"
|
|
79
|
-
}
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"visualVariable": "Border color",
|
|
4
|
+
"sampleSize": "≤5",
|
|
5
|
+
"variability": "Moderate",
|
|
6
|
+
"recommendation": "Indifferent"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"visualVariable": "Hover behavior",
|
|
10
|
+
"sampleSize": "≤5",
|
|
11
|
+
"variability": "Moderate",
|
|
12
|
+
"recommendation": "Indifferent"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"visualVariable": "Bar direction",
|
|
16
|
+
"sampleSize": "≤5",
|
|
17
|
+
"variability": "High",
|
|
18
|
+
"recommendation": "Horizontal"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"visualVariable": "Bar direction",
|
|
22
|
+
"sampleSize": null,
|
|
23
|
+
"variability": "Moderate",
|
|
24
|
+
"recommendation": "Indifferent"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"visualVariable": "Spacing between bars",
|
|
28
|
+
"sampleSize": "≤5",
|
|
29
|
+
"variability": "Moderate",
|
|
30
|
+
"recommendation": "Indifferent"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"visualVariable": "Labels",
|
|
34
|
+
"sampleSize": "≤5",
|
|
35
|
+
"variability": "Moderate",
|
|
36
|
+
"recommendation": "Indifferent"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"visualVariable": "Color palette",
|
|
40
|
+
"sampleSize": "≤5",
|
|
41
|
+
"variability": "Moderate",
|
|
42
|
+
"recommendation": "Random color palette"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"visualVariable": "Axis maximum",
|
|
46
|
+
"sampleSize": "≤5",
|
|
47
|
+
"variability": "Moderate",
|
|
48
|
+
"recommendation": "Indifferent"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"visualVariable": "Number of steps",
|
|
52
|
+
"sampleSize": ">20",
|
|
53
|
+
"variability": "High",
|
|
54
|
+
"recommendation": "Few steps"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"visualVariable": "Number of steps",
|
|
58
|
+
"sampleSize": "≤5",
|
|
59
|
+
"variability": "Moderate",
|
|
60
|
+
"recommendation": "Indifferent"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"visualVariable": "Order",
|
|
64
|
+
"sampleSize": "≤5",
|
|
65
|
+
"variability": "Moderate",
|
|
66
|
+
"recommendation": "Ordered"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"visualVariable": "Opacity",
|
|
70
|
+
"sampleSize": ">20",
|
|
71
|
+
"variability": "High",
|
|
72
|
+
"recommendation": "Transparent"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"visualVariable": "Opacity",
|
|
76
|
+
"sampleSize": "≤5",
|
|
77
|
+
"variability": "Moderate",
|
|
78
|
+
"recommendation": "Opaque"
|
|
79
|
+
}
|
|
80
80
|
]
|
|
@@ -36,59 +36,16 @@ function getConfiguredVisualVariableIndex(visualVariable) {
|
|
|
36
36
|
return v !== undefined ? v : undefined;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
{
|
|
50
|
-
index: 2,
|
|
51
|
-
label: 'Count how many times a threshold is exceeded',
|
|
52
|
-
jsonSlug: 'count-times-a-certain-value-is-exceeded',
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
index: 3,
|
|
56
|
-
label: 'Count how many times values stay below a threshold',
|
|
57
|
-
jsonSlug: 'count-times-does-not-exceed-a-certain-value',
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
index: 4,
|
|
61
|
-
label: 'Highlight a specific value',
|
|
62
|
-
jsonSlug: 'highlight-a-value',
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
index: 5,
|
|
66
|
-
label: 'Highlight the highest value',
|
|
67
|
-
jsonSlug: 'highlight-the-highest-value',
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
index: 6,
|
|
71
|
-
label: 'Highlight the lowest value',
|
|
72
|
-
jsonSlug: 'highlight-the-lowest-value',
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
index: 7,
|
|
76
|
-
label: 'Highlight higher values',
|
|
77
|
-
jsonSlug: 'highlight-higher-values',
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
index: 8,
|
|
81
|
-
label: 'Highlight lower values',
|
|
82
|
-
jsonSlug: 'highlight-lower-values',
|
|
83
|
-
},
|
|
84
|
-
];
|
|
85
|
-
function definitionsToBaseOptions() {
|
|
86
|
-
return COMMUNICATION_GOAL_DEFINITIONS.map((g) => ({
|
|
87
|
-
index: g.index,
|
|
88
|
-
value: g.label,
|
|
89
|
-
json: g.jsonSlug,
|
|
90
|
-
}));
|
|
91
|
-
}
|
|
39
|
+
const ChartGenGoals = {
|
|
40
|
+
COUNT_REPEATED_VALUE: 'count-times-that-a-certain-value-is-repeated',
|
|
41
|
+
COUNT_EXCEEDED_THRESHOLD: 'count-times-a-certain-value-is-exceeded',
|
|
42
|
+
COUNT_BELOW_THRESHOLD: 'count-times-does-not-exceed-a-certain-value',
|
|
43
|
+
HIGHLIGHT_VALUE: 'highlight-a-value',
|
|
44
|
+
HIGHLIGHT_HIGHEST_VALUE: 'highlight-the-highest-value',
|
|
45
|
+
HIGHLIGHT_LOWEST_VALUE: 'highlight-the-lowest-value',
|
|
46
|
+
HIGHLIGHT_HIGHER_VALUES: 'highlight-higher-values',
|
|
47
|
+
HIGHLIGHT_LOWER_VALUES: 'highlight-lower-values',
|
|
48
|
+
};
|
|
92
49
|
|
|
93
50
|
class chartsModel {
|
|
94
51
|
data;
|
|
@@ -179,10 +136,10 @@ class chartsModel {
|
|
|
179
136
|
hoverRec = 'default';
|
|
180
137
|
showingInDialog = 'suggestions';
|
|
181
138
|
constructor() { }
|
|
182
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
183
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
139
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: chartsModel, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
140
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: chartsModel, providedIn: 'root' });
|
|
184
141
|
}
|
|
185
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
142
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: chartsModel, decorators: [{
|
|
186
143
|
type: Injectable,
|
|
187
144
|
args: [{
|
|
188
145
|
providedIn: 'root',
|
|
@@ -237,10 +194,10 @@ class CommunicationRulesService {
|
|
|
237
194
|
return acc;
|
|
238
195
|
}, {})));
|
|
239
196
|
}
|
|
240
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
241
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
197
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: CommunicationRulesService, deps: [{ token: i1.HttpClient }, { token: chartsModel }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
198
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: CommunicationRulesService, providedIn: 'root' });
|
|
242
199
|
}
|
|
243
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
200
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: CommunicationRulesService, decorators: [{
|
|
244
201
|
type: Injectable,
|
|
245
202
|
args: [{ providedIn: 'root' }]
|
|
246
203
|
}], ctorParameters: () => [{ type: i1.HttpClient }, { type: chartsModel }] });
|
|
@@ -354,9 +311,6 @@ class DataSuggestionsService {
|
|
|
354
311
|
};
|
|
355
312
|
}));
|
|
356
313
|
}
|
|
357
|
-
analyzBestGraph(_dataset, _goal) {
|
|
358
|
-
return 'bars';
|
|
359
|
-
}
|
|
360
314
|
computeStats(dataset) {
|
|
361
315
|
const values = dataset.map((d) => d.value);
|
|
362
316
|
const n = values.length;
|
|
@@ -385,62 +339,32 @@ class DataSuggestionsService {
|
|
|
385
339
|
sc = '>20';
|
|
386
340
|
return { dataSize: sc, dataVariability: vari };
|
|
387
341
|
}
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: DataSuggestionsService, decorators: [{
|
|
392
|
-
type: Injectable,
|
|
393
|
-
args: [{ providedIn: 'root' }]
|
|
394
|
-
}], ctorParameters: () => [{ type: CommunicationRulesService }] });
|
|
395
|
-
|
|
396
|
-
/**
|
|
397
|
-
* Facade for host apps: goal catalog, rule counts, raw/filtered rules, and full suggestions
|
|
398
|
-
* (same pipeline as `data-suggestions-table`).
|
|
399
|
-
*/
|
|
400
|
-
class CommunicationGoalsService {
|
|
401
|
-
rulesService;
|
|
402
|
-
suggestionsService;
|
|
403
|
-
constructor(rulesService, suggestionsService) {
|
|
404
|
-
this.rulesService = rulesService;
|
|
405
|
-
this.suggestionsService = suggestionsService;
|
|
406
|
-
}
|
|
407
|
-
/** Goal definitions (index, label, JSON slug). */
|
|
408
|
-
getDefinitions() {
|
|
409
|
-
return COMMUNICATION_GOAL_DEFINITIONS;
|
|
410
|
-
}
|
|
411
|
-
/** Dropdown options without HTTP (label in `value`, slug in `json`). */
|
|
412
|
-
getBaseOptions() {
|
|
413
|
-
return definitionsToBaseOptions();
|
|
414
|
-
}
|
|
415
|
-
/** Same options with `(n)` rule count per JSON file. */
|
|
416
|
-
loadOptionsWithRuleCounts() {
|
|
417
|
-
const defs = COMMUNICATION_GOAL_DEFINITIONS;
|
|
418
|
-
const slugs = defs.map((d) => d.jsonSlug);
|
|
419
|
-
return this.rulesService.getCountsForGoals(slugs).pipe(map((counts) => defs.map((g) => ({
|
|
420
|
-
index: g.index,
|
|
421
|
-
value: `${g.label} (${counts[g.jsonSlug] ?? 0})`,
|
|
422
|
-
json: g.jsonSlug,
|
|
423
|
-
}))));
|
|
342
|
+
getRecommendationCount(dataset, goal) {
|
|
343
|
+
const { dataVariability, dataSize } = this.computeStats(dataset);
|
|
344
|
+
return this.rulesService.getRulesForGoal(goal).pipe(map((allRules) => this.getMatchingRules(allRules, dataSize, dataVariability).length));
|
|
424
345
|
}
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
346
|
+
getRecommendationCountsForDatasets(datasets, goal) {
|
|
347
|
+
return forkJoin(datasets.map((dataset) => this.getRecommendationCount(dataset.data, goal).pipe(map((recommendationCount) => ({
|
|
348
|
+
dataset,
|
|
349
|
+
recommendationCount,
|
|
350
|
+
})))));
|
|
428
351
|
}
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
return
|
|
352
|
+
getMatchingRules(allRules, dataSize, dataVariability) {
|
|
353
|
+
const wantSize = normalizeSampleSizeLabel(dataSize);
|
|
354
|
+
return allRules.filter((r) => normalizeSampleSizeLabel(r.sampleSize) === wantSize &&
|
|
355
|
+
r.variability === dataVariability &&
|
|
356
|
+
!!r.recommendation);
|
|
432
357
|
}
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
return this.suggestionsService.analyze(dataset, goalSlug);
|
|
358
|
+
analyzBestGraph(_dataset, _goal) {
|
|
359
|
+
return 'bars';
|
|
436
360
|
}
|
|
437
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
438
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
361
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: DataSuggestionsService, deps: [{ token: CommunicationRulesService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
362
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: DataSuggestionsService, providedIn: 'root' });
|
|
439
363
|
}
|
|
440
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
364
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: DataSuggestionsService, decorators: [{
|
|
441
365
|
type: Injectable,
|
|
442
366
|
args: [{ providedIn: 'root' }]
|
|
443
|
-
}], ctorParameters: () => [{ type: CommunicationRulesService }
|
|
367
|
+
}], ctorParameters: () => [{ type: CommunicationRulesService }] });
|
|
444
368
|
|
|
445
369
|
Chart.register(...registerables, ChartDataLabels);
|
|
446
370
|
class DataSuggestionsBarChartComponent {
|
|
@@ -747,12 +671,12 @@ class DataSuggestionsBarChartComponent {
|
|
|
747
671
|
clamp(value, min, max) {
|
|
748
672
|
return Math.min(Math.max(value, min), max);
|
|
749
673
|
}
|
|
750
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
751
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.
|
|
674
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: DataSuggestionsBarChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
675
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.25", type: DataSuggestionsBarChartComponent, isStandalone: true, selector: "lib-data-suggestions-bar-chart", inputs: { title: "title", labels: "labels", values: "values", orientation: "orientation", maxValue: "maxValue", stepNumber: "stepNumber", auxiliarLines: "auxiliarLines", opacity: "opacity", sortAscending: "sortAscending", showLabels: "showLabels", colorPalette: "colorPalette", barDistance: "barDistance", barBorderRecommendation: "barBorderRecommendation", hover: "hover", heightPx: "heightPx", minHeightPx: "minHeightPx", maxHeightPx: "maxHeightPx", minWidthPx: "minWidthPx", maxWidthPx: "maxWidthPx", barSizePx: "barSizePx" }, viewQueries: [{ propertyName: "canvas", first: true, predicate: ["canvas"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"chart-wrap\" [style.height.px]=\"chartHeightPx\"\r\n[style.width.px]=\"chartWidthPx\">\r\n <canvas #canvas></canvas>\r\n</div>\r\n", styles: [".chart-wrap{position:relative;margin-left:auto;margin-right:auto;max-width:900px;min-width:300px}.chart-wrap canvas{width:100%!important;height:100%!important}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ButtonModule }, { kind: "ngmodule", type: DialogModule }] });
|
|
752
676
|
}
|
|
753
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
677
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: DataSuggestionsBarChartComponent, decorators: [{
|
|
754
678
|
type: Component,
|
|
755
|
-
args: [{ selector: 'lib-data-suggestions-bar-chart', standalone: true, imports: [CommonModule, ButtonModule, DialogModule], template: "<div class=\"chart-wrap\" [style.height.px]=\"chartHeightPx\"\n[style.width.px]=\"chartWidthPx\">\n <canvas #canvas></canvas>\n</div>\n", styles: [".chart-wrap{position:relative;margin-left:auto;margin-right:auto;max-width:900px;min-width:300px}.chart-wrap canvas{width:100%!important;height:100%!important}\n"] }]
|
|
679
|
+
args: [{ selector: 'lib-data-suggestions-bar-chart', standalone: true, imports: [CommonModule, ButtonModule, DialogModule], template: "<div class=\"chart-wrap\" [style.height.px]=\"chartHeightPx\"\r\n[style.width.px]=\"chartWidthPx\">\r\n <canvas #canvas></canvas>\r\n</div>\r\n", styles: [".chart-wrap{position:relative;margin-left:auto;margin-right:auto;max-width:900px;min-width:300px}.chart-wrap canvas{width:100%!important;height:100%!important}\n"] }]
|
|
756
680
|
}], ctorParameters: () => [], propDecorators: { canvas: [{
|
|
757
681
|
type: ViewChild,
|
|
758
682
|
args: ['canvas', { static: true }]
|
|
@@ -1154,12 +1078,12 @@ ngOnInit(): void {
|
|
|
1154
1078
|
}
|
|
1155
1079
|
return 'single';
|
|
1156
1080
|
}
|
|
1157
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
1158
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.17", type: DataSuggestionsTableComponent, isStandalone: true, selector: "data-suggestions-table", inputs: { dataset: "dataset", goal: "goal" }, usesOnChanges: true, ngImport: i0, template: "<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>", styles: [".panel{display:grid;gap:12px;padding:12px;border:1px solid #ddd;border-radius:12px}.header{display:flex;align-items:center;justify-content:space-between;gap:12px}.meta{display:flex;gap:16px;flex-wrap:wrap;font-size:14px;opacity:.9;margin-left:10px;margin-top:10px;margin-bottom:10px}.table{width:100%;border-collapse:collapse}th,td{padding:10px;border-bottom:1px solid #eee;text-align:left;vertical-align:top}.empty{opacity:.7}.dialog-tabs{display:flex;gap:.5rem;margin-bottom:1rem;border-bottom:1px solid #ddd}.dialog-tab{border:none;background:transparent;padding:.75rem 1rem;cursor:pointer;font-weight:500;color:#666;border-bottom:3px solid transparent}.dialog-tab:hover{color:#111}.dialog-tab.active{color:#111;font-weight:700;border-bottom-color:#2563eb}.active{color:#5da6ff!important}.json-example{background:#0b1020;color:#e6e6e6;padding:12px;border-radius:8px;overflow:auto;font-size:.9rem;line-height:1.35}.dialog-body{display:block;width:100%}.suggestions-content{display:flex;flex-direction:column;width:100%}.meta{display:flex;gap:24px;flex-wrap:wrap;margin-bottom:18px}.empty{display:block;width:100%;padding:14px 0;text-align:left;margin:0 0 0 10px}.json-section{display:block;width:100%;margin-bottom:20px}.json-section h4{margin-bottom:8px}.json-example{display:block;width:100%}.code-block{display:block;white-space:pre-wrap;word-break:break-word}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: DataSuggestionsBarChartComponent, selector: "lib-data-suggestions-bar-chart", inputs: ["title", "labels", "values", "orientation", "maxValue", "stepNumber", "auxiliarLines", "opacity", "sortAscending", "showLabels", "colorPalette", "barDistance", "barBorderRecommendation", "hover", "heightPx", "minHeightPx", "maxHeightPx", "minWidthPx", "maxWidthPx", "barSizePx"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i4.Button, selector: "p-button", inputs: ["hostName", "type", "badge", "disabled", "raised", "rounded", "text", "plain", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "iconPos", "icon", "label", "loading", "loadingIcon", "severity", "buttonProps", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "directive", type: i5.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "ngmodule", type: DialogModule }, { kind: "component", type: i6.Dialog, selector: "p-dialog", inputs: ["hostName", "header", "draggable", "resizable", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "breakpoints", "styleClass", "maskStyleClass", "maskStyle", "showHeader", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "maskMotionOptions", "motionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "closeButtonProps", "maximizeButtonProps", "visible", "style", "position", "role", "appendTo", "content", "contentTemplate", "footerTemplate", "closeIconTemplate", "maximizeIconTemplate", "minimizeIconTemplate", "headlessTemplate"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }] });
|
|
1081
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: DataSuggestionsTableComponent, deps: [{ token: DataSuggestionsService }, { token: chartsModel }], target: i0.ɵɵFactoryTarget.Component });
|
|
1082
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: DataSuggestionsTableComponent, isStandalone: true, selector: "chart-gen", inputs: { dataset: "dataset", goal: "goal" }, usesOnChanges: true, ngImport: i0, template: "<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 {\r\n DataSuggestionsTableComponent,\r\n DataSuggestionsService,\r\n ChartGenGoals\r\n} 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({\r\n standalone: true,\r\n imports: [\r\n DataSuggestionsTableComponent\r\n ]\r\n})</code></pre>\r\n\r\n <p>Use the component in your template:</p>\r\n\r\n <pre><code><chart-gen\r\n [dataset]=\"dataset\"\r\n [goal]=\"ChartGenGoals.HIGHLIGHT_HIGHEST_VALUE\">\r\n</chart-gen></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 { \"key\": \"Monday\", \"value\": 30 },\r\n { \"key\": \"Tuesday\", \"value\": 42 }\r\n]</code></pre>\r\n\r\n <pre><code>{\r\n \"Monday\": 30,\r\n \"Tuesday\": 42\r\n}</code></pre>\r\n\r\n <pre><code>{\r\n \"labels\": [\"Monday\", \"Tuesday\"],\r\n \"values\": [30, 42]\r\n}</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 => {\r\n this.datasetOptions = results\r\n .map(({ dataset, recommendationCount }) => ({\r\n ...dataset,\r\n displayLabel: `${dataset.label} (${recommendationCount})`,\r\n recommendationCount\r\n }))\r\n .sort((a, b) => b.recommendationCount - a.recommendationCount);\r\n });</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 { ChartGenGoals } 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>", styles: [".panel{display:grid;gap:12px;padding:12px;border:1px solid #ddd;border-radius:12px}.header{display:flex;align-items:center;justify-content:space-between;gap:12px}.meta{display:flex;gap:16px;flex-wrap:wrap;font-size:14px;opacity:.9;margin-left:10px;margin-top:10px;margin-bottom:10px}.table{width:100%;border-collapse:collapse}th,td{padding:10px;border-bottom:1px solid #eee;text-align:left;vertical-align:top}.empty{opacity:.7}.dialog-tabs{display:flex;gap:.5rem;margin-bottom:1rem;border-bottom:1px solid #ddd}.dialog-tab{border:none;background:transparent;padding:.75rem 1rem;cursor:pointer;font-weight:500;color:#666;border-bottom:3px solid transparent}.dialog-tab:hover{color:#111}.dialog-tab.active{color:#111;font-weight:700;border-bottom-color:#2563eb}.active{color:#5da6ff!important}.json-example{background:#0b1020;color:#e6e6e6;padding:12px;border-radius:8px;overflow:auto;font-size:.9rem;line-height:1.35}.dialog-body{display:block;width:100%}.suggestions-content{display:flex;flex-direction:column;width:100%}.meta{display:flex;gap:24px;flex-wrap:wrap;margin-bottom:18px}.empty{display:block;width:100%;padding:14px 0;text-align:left;margin:0 0 0 10px}.json-section{display:block;width:100%;margin-bottom:20px}.json-section h4{margin-bottom:8px}.json-example{display:block;width:100%}.code-block{display:block;white-space:pre-wrap;word-break:break-word}:host ::ng-deep .p-dialog-content{overflow:auto}.dialog-tabs{display:flex;gap:.5rem;flex-wrap:wrap}.body{min-height:28rem}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: DataSuggestionsBarChartComponent, selector: "lib-data-suggestions-bar-chart", inputs: ["title", "labels", "values", "orientation", "maxValue", "stepNumber", "auxiliarLines", "opacity", "sortAscending", "showLabels", "colorPalette", "barDistance", "barBorderRecommendation", "hover", "heightPx", "minHeightPx", "maxHeightPx", "minWidthPx", "maxWidthPx", "barSizePx"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i4.Button, selector: "p-button", inputs: ["hostName", "type", "badge", "disabled", "raised", "rounded", "text", "plain", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "iconPos", "icon", "label", "loading", "loadingIcon", "severity", "buttonProps", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "directive", type: i5.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "ngmodule", type: DialogModule }, { kind: "component", type: i6.Dialog, selector: "p-dialog", inputs: ["hostName", "header", "draggable", "resizable", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "breakpoints", "styleClass", "maskStyleClass", "maskStyle", "showHeader", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "closeButtonProps", "maximizeButtonProps", "visible", "style", "position", "role", "appendTo", "content", "contentTemplate", "footerTemplate", "closeIconTemplate", "maximizeIconTemplate", "minimizeIconTemplate", "headlessTemplate"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }] });
|
|
1159
1083
|
}
|
|
1160
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
1084
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: DataSuggestionsTableComponent, decorators: [{
|
|
1161
1085
|
type: Component,
|
|
1162
|
-
args: [{ selector: 'data-suggestions-table', standalone: true, imports: [CommonModule, DataSuggestionsBarChartComponent, ButtonModule, DialogModule], template: "<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>", styles: [".panel{display:grid;gap:12px;padding:12px;border:1px solid #ddd;border-radius:12px}.header{display:flex;align-items:center;justify-content:space-between;gap:12px}.meta{display:flex;gap:16px;flex-wrap:wrap;font-size:14px;opacity:.9;margin-left:10px;margin-top:10px;margin-bottom:10px}.table{width:100%;border-collapse:collapse}th,td{padding:10px;border-bottom:1px solid #eee;text-align:left;vertical-align:top}.empty{opacity:.7}.dialog-tabs{display:flex;gap:.5rem;margin-bottom:1rem;border-bottom:1px solid #ddd}.dialog-tab{border:none;background:transparent;padding:.75rem 1rem;cursor:pointer;font-weight:500;color:#666;border-bottom:3px solid transparent}.dialog-tab:hover{color:#111}.dialog-tab.active{color:#111;font-weight:700;border-bottom-color:#2563eb}.active{color:#5da6ff!important}.json-example{background:#0b1020;color:#e6e6e6;padding:12px;border-radius:8px;overflow:auto;font-size:.9rem;line-height:1.35}.dialog-body{display:block;width:100%}.suggestions-content{display:flex;flex-direction:column;width:100%}.meta{display:flex;gap:24px;flex-wrap:wrap;margin-bottom:18px}.empty{display:block;width:100%;padding:14px 0;text-align:left;margin:0 0 0 10px}.json-section{display:block;width:100%;margin-bottom:20px}.json-section h4{margin-bottom:8px}.json-example{display:block;width:100%}.code-block{display:block;white-space:pre-wrap;word-break:break-word}\n"] }]
|
|
1086
|
+
args: [{ selector: 'chart-gen', standalone: true, imports: [CommonModule, DataSuggestionsBarChartComponent, ButtonModule, DialogModule], template: "<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 {\r\n DataSuggestionsTableComponent,\r\n DataSuggestionsService,\r\n ChartGenGoals\r\n} 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({\r\n standalone: true,\r\n imports: [\r\n DataSuggestionsTableComponent\r\n ]\r\n})</code></pre>\r\n\r\n <p>Use the component in your template:</p>\r\n\r\n <pre><code><chart-gen\r\n [dataset]=\"dataset\"\r\n [goal]=\"ChartGenGoals.HIGHLIGHT_HIGHEST_VALUE\">\r\n</chart-gen></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 { \"key\": \"Monday\", \"value\": 30 },\r\n { \"key\": \"Tuesday\", \"value\": 42 }\r\n]</code></pre>\r\n\r\n <pre><code>{\r\n \"Monday\": 30,\r\n \"Tuesday\": 42\r\n}</code></pre>\r\n\r\n <pre><code>{\r\n \"labels\": [\"Monday\", \"Tuesday\"],\r\n \"values\": [30, 42]\r\n}</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 => {\r\n this.datasetOptions = results\r\n .map(({ dataset, recommendationCount }) => ({\r\n ...dataset,\r\n displayLabel: `${dataset.label} (${recommendationCount})`,\r\n recommendationCount\r\n }))\r\n .sort((a, b) => b.recommendationCount - a.recommendationCount);\r\n });</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 { ChartGenGoals } 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>", styles: [".panel{display:grid;gap:12px;padding:12px;border:1px solid #ddd;border-radius:12px}.header{display:flex;align-items:center;justify-content:space-between;gap:12px}.meta{display:flex;gap:16px;flex-wrap:wrap;font-size:14px;opacity:.9;margin-left:10px;margin-top:10px;margin-bottom:10px}.table{width:100%;border-collapse:collapse}th,td{padding:10px;border-bottom:1px solid #eee;text-align:left;vertical-align:top}.empty{opacity:.7}.dialog-tabs{display:flex;gap:.5rem;margin-bottom:1rem;border-bottom:1px solid #ddd}.dialog-tab{border:none;background:transparent;padding:.75rem 1rem;cursor:pointer;font-weight:500;color:#666;border-bottom:3px solid transparent}.dialog-tab:hover{color:#111}.dialog-tab.active{color:#111;font-weight:700;border-bottom-color:#2563eb}.active{color:#5da6ff!important}.json-example{background:#0b1020;color:#e6e6e6;padding:12px;border-radius:8px;overflow:auto;font-size:.9rem;line-height:1.35}.dialog-body{display:block;width:100%}.suggestions-content{display:flex;flex-direction:column;width:100%}.meta{display:flex;gap:24px;flex-wrap:wrap;margin-bottom:18px}.empty{display:block;width:100%;padding:14px 0;text-align:left;margin:0 0 0 10px}.json-section{display:block;width:100%;margin-bottom:20px}.json-section h4{margin-bottom:8px}.json-example{display:block;width:100%}.code-block{display:block;white-space:pre-wrap;word-break:break-word}:host ::ng-deep .p-dialog-content{overflow:auto}.dialog-tabs{display:flex;gap:.5rem;flex-wrap:wrap}.body{min-height:28rem}\n"] }]
|
|
1163
1087
|
}], ctorParameters: () => [{ type: DataSuggestionsService }, { type: chartsModel }], propDecorators: { dataset: [{
|
|
1164
1088
|
type: Input,
|
|
1165
1089
|
args: [{ required: true }]
|
|
@@ -1181,5 +1105,5 @@ function getMaxValue(values) {
|
|
|
1181
1105
|
* Generated bundle index. Do not edit.
|
|
1182
1106
|
*/
|
|
1183
1107
|
|
|
1184
|
-
export {
|
|
1108
|
+
export { ChartGenGoals, DataSuggestionsBarChartComponent, DataSuggestionsService, DataSuggestionsTableComponent, VISUAL_VARIABLE_INDEX_BY_NAME, getConfiguredVisualVariableIndex };
|
|
1185
1109
|
//# sourceMappingURL=data-suggestions.mjs.map
|