@visionaris-bruno/vs-echarts 8.6.1 → 9.0.4

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,7 +1,7 @@
1
1
  import { provideEchartsCore, NgxEchartsDirective } from 'ngx-echarts';
2
2
  import * as echarts from 'echarts/core';
3
3
  import { BarChart, PieChart, LineChart, ScatterChart, FunnelChart, SunburstChart, SankeyChart, BoxplotChart } from 'echarts/charts';
4
- import { TitleComponent, TooltipComponent, GridComponent, LegendComponent, GraphicComponent, ToolboxComponent, PolarComponent, DatasetComponent, DataZoomComponent } from 'echarts/components';
4
+ import { TooltipComponent, GridComponent, LegendComponent, GraphicComponent, PolarComponent, DatasetComponent, DataZoomComponent } from 'echarts/components';
5
5
  import { CanvasRenderer, SVGRenderer } from 'echarts/renderers';
6
6
  import * as i0 from '@angular/core';
7
7
  import { InjectionToken, Inject, Injectable, EventEmitter, inject, Output, Input, ViewChild, Directive, Component } from '@angular/core';
@@ -66,10 +66,7 @@ const VS_ECHARTS_CONFIG = new InjectionToken('VS_ECHARTS_CONFIG', {
66
66
  * Inicialización centralizada de ECharts para evitar duplicación y efectos secundarios
67
67
  * no controlados en componentes standalone.
68
68
  */
69
- let initialized = false;
70
69
  function initializeEcharts() {
71
- if (initialized)
72
- return;
73
70
  echarts.use([
74
71
  BarChart,
75
72
  PieChart,
@@ -79,14 +76,12 @@ function initializeEcharts() {
79
76
  SunburstChart,
80
77
  SankeyChart,
81
78
  BoxplotChart,
82
- TitleComponent,
83
79
  TooltipComponent,
84
80
  GridComponent,
85
81
  LegendComponent,
86
82
  CanvasRenderer,
87
83
  SVGRenderer,
88
84
  GraphicComponent,
89
- ToolboxComponent,
90
85
  PolarComponent,
91
86
  DatasetComponent,
92
87
  DataZoomComponent,
@@ -98,7 +93,6 @@ function initializeEcharts() {
98
93
  echarts.registerLocale('IT', langIT);
99
94
  echarts.registerLocale('PT-br', langPTbr);
100
95
  echarts.registerLocale('PT', langPTbr);
101
- initialized = true;
102
96
  }
103
97
  /**
104
98
  * Provee la configuración de ECharts para ngx-echarts.
@@ -243,11 +237,11 @@ class BaseEchartsComponent {
243
237
  data = { dimensions: [], source: [] };
244
238
  optionsOverrides = defaultOptionsOverrides();
245
239
  /** Paleta de colores básica */
246
- palette;
240
+ palette = getDefaultPalette();
247
241
  /** Resolver de colores dinámico (Callback) */
248
242
  colorResolver;
249
243
  /** Formateador de valores para etiquetas y tooltips */
250
- valueFormatter;
244
+ valueFormatter = (value) => value.toLocaleString();
251
245
  chartClick = new EventEmitter();
252
246
  /** Subject para debouncing de actualizaciones. ReplaySubject asegura no perder el primer renderizado. */
253
247
  updateSubject = new ReplaySubject(1);
@@ -1206,344 +1200,236 @@ class BoxPlotBuilder {
1206
1200
  }
1207
1201
 
1208
1202
  /**
1209
- * Director de Builds.
1203
+ * Builder principal.
1204
+ *
1205
+ * Es muy completo, tiene soporte para ejes y sistema cartesiano polar.
1206
+ *
1207
+ * Puede verse utilizado en graficos como Lineas y Bars. Siempre que se pueda priorizar utilizar este.
1210
1208
  */
1211
- class VSECDirector {
1212
- builder = undefined;
1213
- constructor(builder) {
1214
- this.builder = builder;
1215
- }
1216
- makeBar(data, overrides, opts = {}) {
1217
- const { valueFormatter = undefined, palette = undefined, colorResolver = undefined, axisTypes = {
1218
- x: 'category',
1219
- y: 'value',
1220
- // TODO agregar radius y angle axis
1221
- } } = opts;
1222
- this.builder.reset();
1223
- // El orden importa, primero callbaks y despues componentes.
1224
- //chart callbacks
1225
- this.builder.setValueFormatter(valueFormatter);
1226
- this.builder.setPalette(palette);
1227
- this.builder.setColorResolver(colorResolver);
1228
- const product = this.builder.baseProduct;
1229
- const seriesOverrides = merge$1({}, product.baseOptions.series, overrides[product.chartKey].series);
1230
- // chart components
1231
- this.builder.addCommons();
1232
- const layoutOpts = { axisTypes };
1233
- this.builder.addSeries(data, seriesOverrides, layoutOpts);
1234
- this.builder.addXAxis(data, overrides.axis, axisTypes.x);
1235
- this.builder.addYAxis(data, overrides.axis, axisTypes.y);
1236
- this.builder.addTooltip(data, overrides.tooltip);
1237
- this.builder.addLegend();
1238
- }
1239
- makeBarRadial(data, overrides, opts = {}) {
1240
- const { valueFormatter = undefined, palette = undefined, colorResolver = undefined, axisTypes = {
1241
- x: 'category',
1242
- y: 'value',
1243
- // TODO agregar radius y angle axis
1244
- } } = opts;
1245
- this.builder.reset();
1246
- // El orden importa, primero callbaks y despues componentes.
1247
- //chart callbacks
1248
- this.builder.setValueFormatter(valueFormatter);
1249
- this.builder.setPalette(palette);
1250
- this.builder.setColorResolver(colorResolver);
1251
- const product = this.builder.baseProduct;
1252
- const seriesOverrides = merge$1({}, product.baseOptions.series, overrides[product.chartKey].series);
1253
- // chart components
1254
- this.builder.addCommons();
1255
- const layoutOpts = { axisTypes, coordinateSystem: 'polar' };
1256
- this.builder.addSeries(data, seriesOverrides, layoutOpts);
1257
- this.builder.addPolar();
1258
- this.builder.addAngleAxis(data, overrides['axis']);
1259
- this.builder.addRadiusAxis(data, overrides['axis']);
1260
- this.builder.addTooltip(data, overrides.tooltip);
1261
- this.builder.addLegend();
1262
- }
1263
- makeLine(data, overrides, opts = {}) {
1264
- const { valueFormatter = undefined, palette = undefined, colorResolver = undefined, axisTypes = {
1265
- x: 'category',
1266
- y: 'value',
1267
- // TODO agregar radius y angle axis
1268
- } } = opts;
1269
- this.builder.reset();
1270
- // El orden importa, primero callbaks y despues componentes.
1271
- //chart callbacks
1272
- this.builder.setValueFormatter(valueFormatter);
1273
- this.builder.setPalette(palette);
1274
- this.builder.setColorResolver(colorResolver);
1275
- const product = this.builder.baseProduct;
1276
- const seriesOverrides = merge$1({}, product.baseOptions.series, overrides[product.chartKey].series);
1277
- // chart components
1278
- this.builder.addCommons();
1279
- const layoutOpts = { axisTypes };
1280
- this.builder.addSeries(data, seriesOverrides, layoutOpts);
1281
- this.builder.addXAxis(data, overrides.axis, axisTypes.x);
1282
- this.builder.addYAxis(data, overrides.axis, axisTypes.y);
1283
- this.builder.addTooltip(data, overrides.tooltip);
1284
- this.builder.addLegend();
1209
+ class EChartBuilder {
1210
+ baseProduct = undefined;
1211
+ valueFormatter = (value) => value.toLocaleString();
1212
+ palette = [];
1213
+ // TODO: Hay que implementar un valor por defecto.
1214
+ colorResolver;
1215
+ result = {};
1216
+ constructor(baseProduct) {
1217
+ this.baseProduct = baseProduct;
1285
1218
  }
1286
- makeScatter(data, overrides, opts = {}) {
1287
- const { valueFormatter = undefined, palette = undefined, colorResolver = undefined, axisTypes = {
1288
- x: 'category',
1289
- y: 'value',
1290
- } } = opts;
1291
- this.builder.reset();
1292
- // El orden importa, primero callbacks y despues componentes.
1293
- this.builder.setValueFormatter(valueFormatter);
1294
- this.builder.setPalette(palette);
1295
- this.builder.setColorResolver(colorResolver);
1296
- const product = this.builder.baseProduct;
1297
- const seriesOverrides = merge$1({}, product.baseOptions.series, overrides[product.chartKey].series);
1298
- // chart components
1299
- this.builder.addCommons();
1300
- const layoutOpts = { axisTypes };
1301
- this.builder.addSeries(data, seriesOverrides, layoutOpts);
1302
- this.builder.addXAxis(data, overrides.axis, axisTypes.x);
1303
- this.builder.addYAxis(data, overrides.axis, axisTypes.y);
1304
- this.builder.addTooltip(data, overrides.tooltip);
1305
- this.builder.addLegend();
1219
+ reset() {
1220
+ this.result = {};
1306
1221
  }
1307
- makeRing(data, overrides, opts = {}) {
1308
- const { valueFormatter = undefined, palette = undefined, colorResolver = undefined, } = opts;
1309
- this.builder.reset();
1310
- // El orden importa, primero callbacks y despues componentes.
1311
- this.builder.setValueFormatter(valueFormatter);
1312
- this.builder.setPalette(palette);
1313
- this.builder.setColorResolver(colorResolver);
1314
- const product = this.builder.baseProduct;
1315
- const seriesOverrides = merge$1({}, product.baseOptions.series, overrides[product.chartKey].series);
1316
- // chart components
1317
- this.builder.addCommons();
1318
- const layoutOpts = {};
1319
- this.builder.addSeries(data, seriesOverrides, layoutOpts);
1320
- this.builder.addGraphic();
1321
- this.builder.addTooltip(data, overrides.tooltip);
1322
- this.builder.addLegend();
1222
+ addCommons() {
1223
+ const opts = {
1224
+ palette: this.palette,
1225
+ };
1226
+ merge$1(this.result, getCommons(opts));
1323
1227
  }
1324
- makePie(data, overrides, opts = {}) {
1325
- const { valueFormatter = undefined, palette = undefined, colorResolver = undefined, } = opts;
1326
- this.builder.reset();
1327
- // El orden importa, primero callbacks y despues componentes.
1328
- this.builder.setValueFormatter(valueFormatter);
1329
- this.builder.setPalette(palette);
1330
- this.builder.setColorResolver(colorResolver);
1331
- const product = this.builder.baseProduct;
1332
- const seriesOverrides = merge$1({}, product.baseOptions.series, overrides[product.chartKey].series);
1333
- // chart components
1334
- this.builder.addCommons();
1335
- const layoutOpts = {};
1336
- this.builder.addSeries(data, seriesOverrides, layoutOpts);
1337
- this.builder.addTooltip(data, overrides.tooltip);
1338
- this.builder.addLegend();
1228
+ /**
1229
+ *
1230
+ * @param data
1231
+ * @param overrides
1232
+ * @returns
1233
+ */
1234
+ addSeries(data, overrides, opts) {
1235
+ if (!data || !data.dimensions || !data.source || data.source.length === 0)
1236
+ return;
1237
+ this.result.dataset = {
1238
+ dimensions: data.dimensions,
1239
+ source: data.source
1240
+ };
1241
+ const measureDims = data.dimensions.filter(d => d.name !== 'category');
1242
+ const isPolar = opts?.coordinateSystem === 'polar';
1243
+ const isHorizontal = opts?.axisTypes?.x === 'value' && opts?.axisTypes?.y === 'category';
1244
+ const series = measureDims.map((dim) => {
1245
+ const friendlyName = dim.displayName || dim.name;
1246
+ const dimKey = dim.name;
1247
+ let encode = {
1248
+ x: 'category',
1249
+ y: dimKey
1250
+ };
1251
+ if (isPolar) {
1252
+ encode = {
1253
+ angle: 'category',
1254
+ radius: dimKey
1255
+ };
1256
+ }
1257
+ else if (isHorizontal) {
1258
+ encode = {
1259
+ x: dimKey,
1260
+ y: 'category'
1261
+ };
1262
+ }
1263
+ const dynamicOverrides = {
1264
+ name: friendlyName,
1265
+ encode,
1266
+ label: {
1267
+ formatter: (params) => {
1268
+ const row = params.value;
1269
+ const rawValue = (row && typeof row === 'object') ? row[dimKey] : params.value;
1270
+ return this.formatCellValue(Number(rawValue ?? 0), dimKey);
1271
+ }
1272
+ }
1273
+ };
1274
+ const seriesOption = merge$1(dynamicOverrides, overrides);
1275
+ // Inyectar el resolver de color si existe
1276
+ if (this.colorResolver && seriesOption.itemStyle) {
1277
+ seriesOption.itemStyle.color = this.colorResolver;
1278
+ }
1279
+ return seriesOption;
1280
+ });
1281
+ this.result.series = series;
1339
1282
  }
1340
- makeFunnel(data, overrides, opts = {}) {
1341
- const { valueFormatter = undefined, palette = undefined, colorResolver = undefined, } = opts;
1342
- this.builder.reset();
1343
- // El orden importa, primero callbacks y despues componentes.
1344
- this.builder.setValueFormatter(valueFormatter);
1345
- this.builder.setPalette(palette);
1346
- this.builder.setColorResolver(colorResolver);
1347
- const product = this.builder.baseProduct;
1348
- const seriesOverrides = merge$1({}, product.baseOptions.series, overrides[product.chartKey].series);
1349
- // chart components
1350
- this.builder.addCommons();
1351
- const layoutOpts = {};
1352
- this.builder.addSeries(data, seriesOverrides, layoutOpts);
1353
- this.builder.addTooltip(data, overrides.tooltip);
1354
- this.builder.addLegend();
1283
+ /**
1284
+ * TODO: Mejorar funcion, no me convence como se implemento el tooltip formatter.
1285
+ * @param data
1286
+ * @param overrides
1287
+ */
1288
+ addTooltip(data, overrides) {
1289
+ // inyecto formateador a overrides de tooltip
1290
+ merge$1(overrides, {
1291
+ formatter: getTooltipFormatter(overrides.trigger, data, this.formatCellValue.bind(this)),
1292
+ });
1293
+ const tooltip = getTooltipOptions(overrides);
1294
+ this.result.tooltip = tooltip;
1355
1295
  }
1356
- makeSunburst(data, overrides, opts = {}) {
1357
- const { valueFormatter = undefined, palette = undefined, colorResolver = undefined, } = opts;
1358
- this.builder.reset();
1359
- // El orden importa, primero callbacks y despues componentes.
1360
- this.builder.setValueFormatter(valueFormatter);
1361
- this.builder.setPalette(palette);
1362
- this.builder.setColorResolver(colorResolver);
1363
- const product = this.builder.baseProduct;
1364
- const seriesOverrides = merge$1({}, product.baseOptions.series, overrides[product.chartKey].series);
1365
- // chart components
1366
- this.builder.addCommons();
1367
- const layoutOpts = {};
1368
- this.builder.addSeries(data, seriesOverrides, layoutOpts);
1369
- this.builder.addTooltip(data, overrides.tooltip);
1370
- // this.builder.addLegend();
1296
+ addPolar() {
1297
+ const polar = [];
1298
+ polar.push({
1299
+ radius: '65%',
1300
+ center: ["50%", "44%"],
1301
+ });
1302
+ this.result.polar = polar;
1371
1303
  }
1372
- makeSankey(data, overrides, opts = {}) {
1373
- const { valueFormatter = undefined, palette = undefined, colorResolver = undefined, } = opts;
1374
- this.builder.reset();
1375
- // El orden importa, primero callbacks y despues componentes.
1376
- this.builder.setValueFormatter(valueFormatter);
1377
- this.builder.setPalette(palette);
1378
- this.builder.setColorResolver(colorResolver);
1379
- const product = this.builder.baseProduct;
1380
- const seriesOverrides = merge$1({}, product.baseOptions.series, overrides[product.chartKey].series);
1381
- // chart components
1382
- this.builder.addCommons();
1383
- const layoutOpts = {};
1384
- this.builder.addSeries(data, seriesOverrides, layoutOpts);
1385
- this.builder.addTooltip(data, overrides.tooltip);
1304
+ addXAxis(data, overrides, type = 'category') {
1305
+ const xAxis = [];
1306
+ const categoryAxisOptions = this.getCategoryAxisOptions(data, overrides);
1307
+ const valueAxisOptions = this.getValueAxisOptions(data, overrides);
1308
+ if (type == 'category') {
1309
+ xAxis.push(categoryAxisOptions);
1310
+ }
1311
+ else if (type == 'value') {
1312
+ xAxis.push(valueAxisOptions);
1313
+ }
1314
+ this.result.xAxis = xAxis;
1386
1315
  }
1387
- makeBoxplot(data, overrides, opts = {}) {
1388
- if (this.builder instanceof BoxPlotBuilder == false) {
1389
- return;
1316
+ addYAxis(data, overrides, type = 'value') {
1317
+ const yAxis = [];
1318
+ const categoryAxisOptions = this.getCategoryAxisOptions(data, overrides);
1319
+ const valueAxisOptions = this.getValueAxisOptions(data, overrides);
1320
+ if (type == 'category') {
1321
+ yAxis.push(categoryAxisOptions);
1390
1322
  }
1391
- const { valueFormatter = undefined, palette = undefined, colorResolver = undefined, axisTypes = {
1392
- x: 'value',
1393
- y: 'category',
1394
- }, } = opts;
1395
- this.builder.reset();
1396
- // El orden importa, primero callbacks y despues componentes.
1397
- this.builder.setValueFormatter(valueFormatter);
1398
- this.builder.setPalette(palette);
1399
- this.builder.setColorResolver(colorResolver);
1400
- const product = this.builder.baseProduct;
1401
- const seriesOverrides = merge$1({}, product.baseOptions.series, overrides[product.chartKey].series);
1402
- // chart components
1403
- this.builder.addCommons();
1404
- const layoutOpts = { axisTypes };
1405
- this.builder.addDataset(data);
1406
- this.builder.addSeries(data, seriesOverrides, layoutOpts);
1407
- this.builder.addXAxis(data, overrides.axis, axisTypes.x);
1408
- this.builder.addYAxis(data, overrides.axis, axisTypes.y);
1409
- this.builder.addTooltip(data, overrides.tooltip);
1410
- this.builder.addDataZoom();
1323
+ else if (type == 'value') {
1324
+ yAxis.push(valueAxisOptions);
1325
+ }
1326
+ this.result.yAxis = yAxis;
1411
1327
  }
1412
- }
1413
-
1414
- /**
1415
- * EchartsRingComponent
1416
- *
1417
- * Especialista en visualización de tipo Ring. Soporta multi-medidas y KPI central.
1418
- * @see {@link vs-echarts/docs/charts/ring-patterns.md}
1419
- */
1420
- class EchartsRingComponent extends BaseEchartsComponent {
1421
- baseSeriesOptions = {
1422
- type: 'pie',
1423
- center: ['50%', '50%'],
1424
- avoidLabelOverlap: true,
1425
- minAngle: 3,
1426
- selectedMode: 'single',
1427
- selectedOffset: 4,
1428
- itemStyle: {
1429
- borderColor: '#fff',
1430
- },
1431
- label: { show: false },
1432
- emphasis: {
1433
- scale: true,
1434
- scaleSize: 2,
1435
- },
1436
- select: {
1437
- itemStyle: {
1438
- borderColor: EChartsTokens.sBorderColor,
1439
- shadowColor: EChartsTokens.sShadowColor,
1440
- borderWidth: 1,
1441
- shadowBlur: 4,
1328
+ addRadiusAxis(data, overrides) {
1329
+ const radiusAxis = [];
1330
+ /** estilos exclusivos hardcodeados para el eje de valores del sistema de coordenadas polar*/
1331
+ const radiusAxisOverrides = {
1332
+ zlevel: 10,
1333
+ axisTick: {
1334
+ show: false,
1442
1335
  },
1443
- },
1444
- animationType: 'scale',
1445
- animationEasing: 'elasticOut',
1446
- };
1447
- baseProduct = {
1448
- chartKey: 'ring',
1449
- baseOptions: {
1450
- series: this.baseSeriesOptions,
1451
- }
1452
- };
1453
- builder = new RingBuilder(this.baseProduct);
1454
- director = new VSECDirector(this.builder);
1455
- lastSelectedSeriesIndex = null;
1456
- lastSelectedDataIndex = null;
1457
- selectedPercent = null;
1458
- currentGraphicText = '';
1459
- constructor() {
1460
- super();
1461
- }
1462
- make() {
1463
- const makeOpts = {
1464
- valueFormatter: this.valueFormatter,
1465
- palette: this.palette,
1466
- colorResolver: this.colorResolver,
1336
+ axisLabel: {
1337
+ margin: 2,
1338
+ fontSize: 8,
1339
+ align: 'right',
1340
+ rotate: 20,
1341
+ verticalAlign: 'top',
1342
+ },
1343
+ splitLine: {
1344
+ show: true,
1345
+ lineStyle: {
1346
+ opacity: 0.2,
1347
+ type: 'solid',
1348
+ }
1349
+ },
1350
+ axisLine: {
1351
+ lineStyle: {
1352
+ type: 'dashed',
1353
+ },
1354
+ }
1467
1355
  };
1468
- this.director.makeRing(this.data, this.optionsOverrides, makeOpts);
1356
+ const radialAxisOptions = getValueAxisOptions(radiusAxisOverrides);
1357
+ radiusAxis.push(radialAxisOptions);
1358
+ this.result.radiusAxis = radiusAxis;
1469
1359
  }
1470
- onInputChanges(changes) {
1471
- // Reset selection only if data changed
1472
- if (changes['data']) {
1473
- this.lastSelectedSeriesIndex = null;
1474
- this.lastSelectedDataIndex = null;
1475
- this.selectedPercent = null;
1476
- this.currentGraphicText = '';
1477
- }
1478
- super.onInputChanges(changes);
1360
+ addAngleAxis(data, overrides) {
1361
+ const angleAxis = [];
1362
+ const categoryAxisOptions = this.getCategoryAxisOptions(data, overrides);
1363
+ angleAxis.push(categoryAxisOptions);
1364
+ this.result.angleAxis = angleAxis;
1365
+ }
1366
+ addLegend() {
1367
+ this.result.legend = getLegendOptions();
1368
+ }
1369
+ // No-ops for ring charts
1370
+ addGraphic() { }
1371
+ addDataset(data) { }
1372
+ addDataZoom() {
1373
+ this.result.dataZoom = [
1374
+ {
1375
+ type: 'inside'
1376
+ },
1377
+ {
1378
+ type: 'slider',
1379
+ height: 20,
1380
+ bottom: 60
1381
+ }
1382
+ ];
1383
+ }
1384
+ getResult() {
1385
+ return this.result;
1479
1386
  }
1387
+ ;
1480
1388
  /**
1481
- * Maneja clics en los sectores del ring.
1482
- * Soporta múltiples series (anillos) y actualiza el KPI central.
1389
+ * Formatea un valor utilizando el callback inyectado.
1483
1390
  */
1484
- onChartClick(event) {
1485
- if (this.chartInstance && event && event.dataIndex !== undefined) {
1486
- const isSameSelection = event.seriesIndex === this.lastSelectedSeriesIndex &&
1487
- event.dataIndex === this.lastSelectedDataIndex;
1488
- if (isSameSelection) {
1489
- // Toggle OFF
1490
- this.lastSelectedSeriesIndex = null;
1491
- this.lastSelectedDataIndex = null;
1492
- this.selectedPercent = null;
1493
- this.setGraphicText('');
1494
- }
1495
- else {
1496
- // SELECT
1497
- this.lastSelectedSeriesIndex = event.seriesIndex;
1498
- this.lastSelectedDataIndex = event.dataIndex;
1499
- this.selectedPercent = (event.percent !== undefined) ? event.percent + '%' : '';
1500
- this.setGraphicText(this.selectedPercent);
1501
- }
1502
- this.chartClick.emit({
1503
- type: 'cross-filter',
1504
- data: {
1505
- category: event.name,
1506
- serie: event.seriesName,
1507
- value: event.value
1508
- }
1509
- });
1510
- }
1391
+ formatCellValue(value, key) {
1392
+ return this.valueFormatter(value, key);
1511
1393
  }
1512
- onChartMouseOver(event) {
1513
- if (this.selectedPercent === null && event && event.percent !== undefined) {
1514
- this.setGraphicText(event.percent + '%');
1394
+ // Setters
1395
+ /**
1396
+ * Permite inyectar un formateador de valores externo.
1397
+ */
1398
+ setValueFormatter(formatter) {
1399
+ if (formatter) {
1400
+ this.valueFormatter = formatter;
1515
1401
  }
1516
1402
  }
1517
- onChartMouseOut(event) {
1518
- if (this.selectedPercent === null) {
1519
- this.setGraphicText('');
1403
+ /**
1404
+ * Permite inyectar una paleta de colores básica.
1405
+ */
1406
+ setPalette(palette) {
1407
+ if (palette) {
1408
+ this.palette = palette;
1520
1409
  }
1521
1410
  }
1522
1411
  /**
1523
- * Actualiza el texto del Graphic central y persiste la selección en el modelo de opciones.
1412
+ * Permite inyectar un resolver de colores dinámico.
1524
1413
  */
1525
- setGraphicText(text) {
1526
- this.currentGraphicText = text;
1527
- // Persistencia de GRAPHIC (KPI central)
1528
- this.chartInstance?.setOption({
1529
- graphic: {
1530
- style: {
1531
- text: this.currentGraphicText,
1532
- opacity: this.currentGraphicText ? 1 : 0,
1533
- }
1534
- }
1535
- });
1414
+ setColorResolver(resolver) {
1415
+ if (resolver) {
1416
+ this.colorResolver = resolver;
1417
+ }
1418
+ }
1419
+ // Utils
1420
+ getCategoryAxisOptions(data, overrides) {
1421
+ // No explicit data needed on category axis when using ECharts dataset
1422
+ const categoryAxisOptionsOverrides = {
1423
+ ...overrides.categoryAxis[0]
1424
+ };
1425
+ const categoryAxisOptions = getCategoryAxisOptions(categoryAxisOptionsOverrides);
1426
+ return categoryAxisOptions;
1427
+ }
1428
+ getValueAxisOptions(data, overrides) {
1429
+ const valueAxisOptions = getValueAxisOptions();
1430
+ return valueAxisOptions;
1536
1431
  }
1537
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: EchartsRingComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1538
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.19", type: EchartsRingComponent, isStandalone: true, selector: "vs-echarts-ring", providers: [provideVSEcharts()], usesInheritance: true, ngImport: i0, template: "<div class=\"echarts-container\" \n echarts \n [options]=\"{}\"\n [initOpts]=\"initOptions\"\n [autoResize]=\"true\" \n (chartInit)=\"onChartInit($event)\" \n (chartClick)=\"onChartClick($event)\" \n (chartMouseOver)=\"onChartMouseOver($event)\" \n (chartMouseOut)=\"onChartMouseOut($event)\" \n (chartSelectChanged)=\"onChartSelectChanged($event, { fixPieDataIndexInside: true })\"\n></div>\n ", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: NgxEchartsDirective, selector: "echarts, [echarts]", inputs: ["options", "theme", "initOpts", "merge", "autoResize", "loading", "loadingType", "loadingOpts"], outputs: ["chartInit", "optionsError", "chartClick", "chartDblClick", "chartMouseDown", "chartMouseMove", "chartMouseUp", "chartMouseOver", "chartMouseOut", "chartGlobalOut", "chartContextMenu", "chartHighlight", "chartDownplay", "chartSelectChanged", "chartLegendSelectChanged", "chartLegendSelected", "chartLegendUnselected", "chartLegendLegendSelectAll", "chartLegendLegendInverseSelect", "chartLegendScroll", "chartDataZoom", "chartDataRangeSelected", "chartGraphRoam", "chartGeoRoam", "chartTreeRoam", "chartTimelineChanged", "chartTimelinePlayChanged", "chartRestore", "chartDataViewChanged", "chartMagicTypeChanged", "chartGeoSelectChanged", "chartGeoSelected", "chartGeoUnselected", "chartAxisAreaSelected", "chartBrush", "chartBrushEnd", "chartBrushSelected", "chartGlobalCursorTaken", "chartRendered", "chartFinished"], exportAs: ["echarts"] }] });
1539
1432
  }
1540
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: EchartsRingComponent, decorators: [{
1541
- type: Component,
1542
- args: [{ selector: 'vs-echarts-ring', standalone: true, imports: [
1543
- CommonModule,
1544
- NgxEchartsDirective,
1545
- ], providers: [provideVSEcharts()], template: "<div class=\"echarts-container\" \n echarts \n [options]=\"{}\"\n [initOpts]=\"initOptions\"\n [autoResize]=\"true\" \n (chartInit)=\"onChartInit($event)\" \n (chartClick)=\"onChartClick($event)\" \n (chartMouseOver)=\"onChartMouseOver($event)\" \n (chartMouseOut)=\"onChartMouseOut($event)\" \n (chartSelectChanged)=\"onChartSelectChanged($event, { fixPieDataIndexInside: true })\"\n></div>\n ", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"] }]
1546
- }], ctorParameters: () => [] });
1547
1433
 
1548
1434
  /**
1549
1435
  * PieBuilder
@@ -1708,78 +1594,18 @@ class PieBuilder {
1708
1594
  }
1709
1595
 
1710
1596
  /**
1711
- * EchartsPieComponent
1597
+ * FunnelBuilder
1712
1598
  *
1713
- * Especialista en visualización de tipo Pie (Torta y Anillos concéntricos).
1714
- * La primera serie se dibuja como un gráfico de torta tradicional (lleno) y
1715
- * las subsecuentes como anillos concéntricos alrededor.
1599
+ * Concrete builder for Funnel charts.
1716
1600
  */
1717
- class EchartsPieComponent extends BaseEchartsComponent {
1718
- baseSeriesOptions = {
1719
- type: 'pie',
1720
- center: ['50%', '50%'],
1721
- avoidLabelOverlap: true,
1722
- minAngle: 3,
1723
- selectedMode: 'single',
1724
- selectedOffset: 4,
1725
- emphasis: {
1726
- scale: true,
1727
- scaleSize: 2,
1728
- },
1729
- select: {
1730
- itemStyle: {
1731
- borderColor: EChartsTokens.sBorderColor,
1732
- shadowColor: EChartsTokens.sShadowColor,
1733
- borderWidth: 1,
1734
- shadowBlur: 4,
1735
- },
1736
- },
1737
- animationType: 'scale',
1738
- animationEasing: 'elasticOut',
1739
- };
1740
- baseProduct = {
1741
- chartKey: 'pie',
1742
- baseOptions: {
1743
- series: this.baseSeriesOptions,
1744
- }
1745
- };
1746
- builder = new PieBuilder(this.baseProduct);
1747
- director = new VSECDirector(this.builder);
1748
- constructor() {
1749
- super();
1750
- }
1751
- make() {
1752
- const makeOpts = {
1753
- valueFormatter: this.valueFormatter,
1754
- palette: this.palette,
1755
- colorResolver: this.colorResolver,
1756
- };
1757
- this.director.makePie(this.data, this.optionsOverrides, makeOpts);
1758
- }
1759
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: EchartsPieComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1760
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.19", type: EchartsPieComponent, isStandalone: true, selector: "vs-echarts-pie", providers: [provideVSEcharts()], usesInheritance: true, ngImport: i0, template: "<div\n class=\"echarts-container\"\n echarts\n [options]=\"{}\"\n [initOpts]=\"initOptions\"\n [autoResize]=\"true\"\n (chartInit)=\"onChartInit($event)\"\n (chartClick)=\"onChartClick($event)\"\n (chartSelectChanged)=\"onChartSelectChanged($event, { fixPieDataIndexInside: true })\"\n></div>\n", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: NgxEchartsDirective, selector: "echarts, [echarts]", inputs: ["options", "theme", "initOpts", "merge", "autoResize", "loading", "loadingType", "loadingOpts"], outputs: ["chartInit", "optionsError", "chartClick", "chartDblClick", "chartMouseDown", "chartMouseMove", "chartMouseUp", "chartMouseOver", "chartMouseOut", "chartGlobalOut", "chartContextMenu", "chartHighlight", "chartDownplay", "chartSelectChanged", "chartLegendSelectChanged", "chartLegendSelected", "chartLegendUnselected", "chartLegendLegendSelectAll", "chartLegendLegendInverseSelect", "chartLegendScroll", "chartDataZoom", "chartDataRangeSelected", "chartGraphRoam", "chartGeoRoam", "chartTreeRoam", "chartTimelineChanged", "chartTimelinePlayChanged", "chartRestore", "chartDataViewChanged", "chartMagicTypeChanged", "chartGeoSelectChanged", "chartGeoSelected", "chartGeoUnselected", "chartAxisAreaSelected", "chartBrush", "chartBrushEnd", "chartBrushSelected", "chartGlobalCursorTaken", "chartRendered", "chartFinished"], exportAs: ["echarts"] }] });
1761
- }
1762
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: EchartsPieComponent, decorators: [{
1763
- type: Component,
1764
- args: [{ selector: 'vs-echarts-pie', standalone: true, imports: [
1765
- CommonModule,
1766
- NgxEchartsDirective,
1767
- ], providers: [provideVSEcharts()], template: "<div\n class=\"echarts-container\"\n echarts\n [options]=\"{}\"\n [initOpts]=\"initOptions\"\n [autoResize]=\"true\"\n (chartInit)=\"onChartInit($event)\"\n (chartClick)=\"onChartClick($event)\"\n (chartSelectChanged)=\"onChartSelectChanged($event, { fixPieDataIndexInside: true })\"\n></div>\n", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"] }]
1768
- }], ctorParameters: () => [] });
1769
-
1770
- /**
1771
- * FunnelBuilder
1772
- *
1773
- * Concrete builder for Funnel charts.
1774
- */
1775
- class FunnelBuilder {
1776
- baseProduct;
1777
- valueFormatter = (value) => value.toLocaleString();
1778
- palette = [];
1779
- colorResolver;
1780
- result = {};
1781
- constructor(baseProduct) {
1782
- this.baseProduct = baseProduct;
1601
+ class FunnelBuilder {
1602
+ baseProduct;
1603
+ valueFormatter = (value) => value.toLocaleString();
1604
+ palette = [];
1605
+ colorResolver;
1606
+ result = {};
1607
+ constructor(baseProduct) {
1608
+ this.baseProduct = baseProduct;
1783
1609
  }
1784
1610
  reset() {
1785
1611
  this.result = {};
@@ -1871,91 +1697,10 @@ class FunnelBuilder {
1871
1697
  }
1872
1698
  }
1873
1699
 
1874
- /**
1875
- * EchartsFunnelComponent
1876
- *
1877
- * Component for Funnel visualization. Supports single and multiple measures.
1878
- */
1879
- class EchartsFunnelComponent extends BaseEchartsComponent {
1880
- baseSeriesOptions = {
1881
- type: 'funnel',
1882
- left: '10%',
1883
- width: '80%',
1884
- minSize: '0.01%',
1885
- maxSize: '100%',
1886
- sort: 'descending',
1887
- gap: 2,
1888
- label: {
1889
- show: true,
1890
- position: 'inside'
1891
- },
1892
- labelLine: {
1893
- show: false
1894
- },
1895
- itemStyle: {
1896
- borderColor: '#fff',
1897
- borderWidth: 1
1898
- },
1899
- emphasis: {
1900
- label: {
1901
- fontSize: 16
1902
- }
1903
- },
1904
- selectedMode: 'single',
1905
- select: {
1906
- label: {
1907
- fontSize: 16
1908
- },
1909
- itemStyle: {
1910
- borderWidth: 1,
1911
- borderColor: EChartsTokens.sBorderColor,
1912
- shadowColor: EChartsTokens.sShadowColor,
1913
- shadowBlur: 6,
1914
- }
1915
- },
1916
- };
1917
- baseProduct = {
1918
- chartKey: 'funnel',
1919
- baseOptions: {
1920
- series: this.baseSeriesOptions,
1921
- }
1922
- };
1923
- builder = new FunnelBuilder(this.baseProduct);
1924
- director = new VSECDirector(this.builder);
1925
- constructor() {
1926
- super();
1927
- }
1928
- make() {
1929
- const makeOpts = {
1930
- valueFormatter: this.valueFormatter,
1931
- palette: this.palette,
1932
- colorResolver: this.colorResolver,
1933
- };
1934
- this.director.makeFunnel(this.data, this.optionsOverrides, makeOpts);
1935
- }
1936
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: EchartsFunnelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1937
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.19", type: EchartsFunnelComponent, isStandalone: true, selector: "vs-echarts-funnel", providers: [provideVSEcharts()], usesInheritance: true, ngImport: i0, template: "<div class=\"echarts-container\" echarts \n [options]=\"{}\"\n [initOpts]=\"initOptions\" \n [autoResize]=\"true\" \n (chartInit)=\"onChartInit($event)\" \n (chartClick)=\"onChartClick($event)\" \n (chartSelectChanged)=\"onChartSelectChanged($event, { fixPieDataIndexInside: true })\"\n></div>\n", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: NgxEchartsDirective, selector: "echarts, [echarts]", inputs: ["options", "theme", "initOpts", "merge", "autoResize", "loading", "loadingType", "loadingOpts"], outputs: ["chartInit", "optionsError", "chartClick", "chartDblClick", "chartMouseDown", "chartMouseMove", "chartMouseUp", "chartMouseOver", "chartMouseOut", "chartGlobalOut", "chartContextMenu", "chartHighlight", "chartDownplay", "chartSelectChanged", "chartLegendSelectChanged", "chartLegendSelected", "chartLegendUnselected", "chartLegendLegendSelectAll", "chartLegendLegendInverseSelect", "chartLegendScroll", "chartDataZoom", "chartDataRangeSelected", "chartGraphRoam", "chartGeoRoam", "chartTreeRoam", "chartTimelineChanged", "chartTimelinePlayChanged", "chartRestore", "chartDataViewChanged", "chartMagicTypeChanged", "chartGeoSelectChanged", "chartGeoSelected", "chartGeoUnselected", "chartAxisAreaSelected", "chartBrush", "chartBrushEnd", "chartBrushSelected", "chartGlobalCursorTaken", "chartRendered", "chartFinished"], exportAs: ["echarts"] }] });
1938
- }
1939
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: EchartsFunnelComponent, decorators: [{
1940
- type: Component,
1941
- args: [{ selector: 'vs-echarts-funnel', standalone: true, imports: [
1942
- CommonModule,
1943
- NgxEchartsDirective,
1944
- ], providers: [provideVSEcharts()], template: "<div class=\"echarts-container\" echarts \n [options]=\"{}\"\n [initOpts]=\"initOptions\" \n [autoResize]=\"true\" \n (chartInit)=\"onChartInit($event)\" \n (chartClick)=\"onChartClick($event)\" \n (chartSelectChanged)=\"onChartSelectChanged($event, { fixPieDataIndexInside: true })\"\n></div>\n", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"] }]
1945
- }], ctorParameters: () => [] });
1946
-
1947
- /**
1948
- * Builder principal.
1949
- *
1950
- * Es muy completo, tiene soporte para ejes y sistema cartesiano polar.
1951
- *
1952
- * Puede verse utilizado en graficos como Lineas y Bars. Siempre que se pueda priorizar utilizar este.
1953
- */
1954
- class EChartBuilder {
1955
- baseProduct = undefined;
1700
+ class SunburstBuilder {
1701
+ baseProduct;
1956
1702
  valueFormatter = (value) => value.toLocaleString();
1957
1703
  palette = [];
1958
- // TODO: Hay que implementar un valor por defecto.
1959
1704
  colorResolver;
1960
1705
  result = {};
1961
1706
  constructor(baseProduct) {
@@ -1964,217 +1709,779 @@ class EChartBuilder {
1964
1709
  reset() {
1965
1710
  this.result = {};
1966
1711
  }
1967
- addCommons() {
1968
- const opts = {
1969
- palette: this.palette,
1970
- };
1971
- merge$1(this.result, getCommons(opts));
1972
- }
1973
- /**
1974
- *
1975
- * @param data
1976
- * @param overrides
1977
- * @returns
1978
- */
1979
- addSeries(data, overrides, opts) {
1980
- if (!data || !data.dimensions || !data.source || data.source.length === 0)
1712
+ addSeries(data, overrides) {
1713
+ if (!data || !data.source || data.source.length === 0) {
1981
1714
  return;
1982
- this.result.dataset = {
1983
- dimensions: data.dimensions,
1984
- source: data.source
1985
- };
1986
- const measureDims = data.dimensions.filter(d => d.name !== 'category');
1987
- const isPolar = opts?.coordinateSystem === 'polar';
1988
- const isHorizontal = opts?.axisTypes?.x === 'value' && opts?.axisTypes?.y === 'category';
1989
- const series = measureDims.map((dim) => {
1990
- const friendlyName = dim.displayName || dim.name;
1991
- const dimKey = dim.name;
1992
- let encode = {
1993
- x: 'category',
1994
- y: dimKey
1995
- };
1996
- if (isPolar) {
1997
- encode = {
1998
- angle: 'category',
1999
- radius: dimKey
2000
- };
2001
- }
2002
- else if (isHorizontal) {
2003
- encode = {
2004
- x: dimKey,
2005
- y: 'category'
2006
- };
2007
- }
2008
- const dynamicOverrides = {
2009
- name: friendlyName,
2010
- encode,
1715
+ }
1716
+ const sunburstData = mapHierarchicalData(data.source, data.dimensions);
1717
+ const depth = getTreeDepth(sunburstData);
1718
+ const levels = [];
1719
+ for (let i = 0; i <= depth; i++) {
1720
+ levels.push({
2011
1721
  label: {
2012
- formatter: (params) => {
2013
- const row = params.value;
2014
- const rawValue = (row && typeof row === 'object') ? row[dimKey] : params.value;
2015
- return this.formatCellValue(Number(rawValue ?? 0), dimKey);
2016
- }
2017
- }
2018
- };
2019
- const seriesOption = merge$1(dynamicOverrides, overrides);
2020
- // Inyectar el resolver de color si existe
2021
- if (this.colorResolver && seriesOption.itemStyle) {
2022
- seriesOption.itemStyle.color = this.colorResolver;
1722
+ show: false,
1723
+ },
1724
+ });
1725
+ }
1726
+ const dynamiSerieOptions = {
1727
+ name: '',
1728
+ data: sunburstData,
1729
+ levels: levels
1730
+ };
1731
+ const serie = merge$1({}, dynamiSerieOptions, overrides);
1732
+ if (this.colorResolver) {
1733
+ if (!serie.itemStyle) {
1734
+ serie.itemStyle = {};
2023
1735
  }
2024
- return seriesOption;
2025
- });
2026
- this.result.series = series;
1736
+ serie.itemStyle.color = this.colorResolver;
1737
+ }
1738
+ this.result.series = serie;
2027
1739
  }
2028
- /**
2029
- * TODO: Mejorar funcion, no me convence como se implemento el tooltip formatter.
2030
- * @param data
2031
- * @param overrides
2032
- */
2033
1740
  addTooltip(data, overrides) {
2034
- // inyecto formateador a overrides de tooltip
2035
1741
  merge$1(overrides, {
2036
- formatter: getTooltipFormatter(overrides.trigger, data, this.formatCellValue.bind(this)),
1742
+ formatter: getTooltipFormatter(overrides.trigger || 'item', data, this.valueFormatter),
2037
1743
  });
2038
1744
  const tooltip = getTooltipOptions(overrides);
2039
1745
  this.result.tooltip = tooltip;
2040
1746
  }
2041
- addPolar() {
2042
- const polar = [];
2043
- polar.push({
2044
- radius: '65%',
2045
- center: ["50%", "44%"],
2046
- });
2047
- this.result.polar = polar;
1747
+ addCommons() {
1748
+ const opts = {
1749
+ palette: this.palette,
1750
+ };
1751
+ merge$1(this.result, getCommons(opts));
2048
1752
  }
2049
- addXAxis(data, overrides, type = 'category') {
2050
- const xAxis = [];
2051
- const categoryAxisOptions = this.getCategoryAxisOptions(data, overrides);
2052
- const valueAxisOptions = this.getValueAxisOptions(data, overrides);
2053
- if (type == 'category') {
2054
- xAxis.push(categoryAxisOptions);
2055
- }
2056
- else if (type == 'value') {
2057
- xAxis.push(valueAxisOptions);
2058
- }
2059
- this.result.xAxis = xAxis;
1753
+ getResult() {
1754
+ return this.result;
2060
1755
  }
2061
- addYAxis(data, overrides, type = 'value') {
2062
- const yAxis = [];
2063
- const categoryAxisOptions = this.getCategoryAxisOptions(data, overrides);
2064
- const valueAxisOptions = this.getValueAxisOptions(data, overrides);
2065
- if (type == 'category') {
2066
- yAxis.push(categoryAxisOptions);
1756
+ ;
1757
+ // No-ops
1758
+ addPolar() { }
1759
+ addXAxis(data, overrides, type) { }
1760
+ addYAxis(data, overrides, type) { }
1761
+ addRadiusAxis(data, overrides) { }
1762
+ addAngleAxis(data, overrides) { }
1763
+ addLegend() { }
1764
+ addDataZoom() { }
1765
+ addDataset(data, opts) { }
1766
+ addGraphic() { }
1767
+ // Setters
1768
+ /**
1769
+ * Permite inyectar un formateador de valores externo.
1770
+ */
1771
+ setValueFormatter(formatter) {
1772
+ if (formatter) {
1773
+ this.valueFormatter = formatter;
2067
1774
  }
2068
- else if (type == 'value') {
2069
- yAxis.push(valueAxisOptions);
1775
+ }
1776
+ /**
1777
+ * Permite inyectar una paleta de colores básica.
1778
+ */
1779
+ setPalette(palette) {
1780
+ if (palette) {
1781
+ this.palette = palette;
2070
1782
  }
2071
- this.result.yAxis = yAxis;
2072
1783
  }
2073
- addRadiusAxis(data, overrides) {
2074
- const radiusAxis = [];
2075
- /** estilos exclusivos hardcodeados para el eje de valores del sistema de coordenadas polar*/
2076
- const radiusAxisOverrides = {
2077
- zlevel: 10,
2078
- axisTick: {
2079
- show: false,
1784
+ /**
1785
+ * Permite inyectar un resolver de colores dinámico.
1786
+ */
1787
+ setColorResolver(resolver) {
1788
+ if (resolver) {
1789
+ this.colorResolver = resolver;
1790
+ }
1791
+ }
1792
+ }
1793
+
1794
+ /**
1795
+ * SankeyBuilder
1796
+ *
1797
+ * Builder concreto para el gráfico Sankey (diagrama de flujos de izquierda a derecha).
1798
+ */
1799
+ class SankeyBuilder {
1800
+ baseProduct;
1801
+ valueFormatter = (value) => value.toLocaleString();
1802
+ palette = [];
1803
+ colorResolver;
1804
+ result = {};
1805
+ constructor(baseProduct) {
1806
+ this.baseProduct = baseProduct;
1807
+ }
1808
+ reset() {
1809
+ this.result = {};
1810
+ }
1811
+ addSeries(data, overrides) {
1812
+ if (!data || !data.source || data.source.length === 0) {
1813
+ return;
1814
+ }
1815
+ // Identificar medidas (todas las dimensiones excepto 'category')
1816
+ const measureKeys = data.dimensions
1817
+ .filter((d) => d.name !== "category")
1818
+ .map((d) => d.name);
1819
+ // Función auxiliar para sumarizar valores de medidas en caso de haber más de una
1820
+ const getNodeValue = (node) => {
1821
+ return measureKeys.reduce((sum, key) => sum + (Number(node[key]) || 0), 0);
1822
+ };
1823
+ const nodesMap = new Map();
1824
+ const linksMap = new Map();
1825
+ // Función recursiva para aplanar datos jerárquicos a nodos y enlaces
1826
+ const traverse = (nodeList, level, parentId) => {
1827
+ for (const node of nodeList) {
1828
+ const category = node.category;
1829
+ const currentId = `${category}___${level}`;
1830
+ const value = getNodeValue(node);
1831
+ nodesMap.set(currentId, (nodesMap.get(currentId) || 0) + value);
1832
+ if (parentId) {
1833
+ const linkKey = `${parentId}--->${currentId}`;
1834
+ if (linksMap.has(linkKey)) {
1835
+ linksMap.get(linkKey).value += value;
1836
+ }
1837
+ else {
1838
+ linksMap.set(linkKey, {
1839
+ source: parentId,
1840
+ target: currentId,
1841
+ value: value,
1842
+ });
1843
+ }
1844
+ }
1845
+ if (node.children && node.children.length > 0) {
1846
+ traverse(node.children, level + 1, currentId);
1847
+ }
1848
+ }
1849
+ };
1850
+ // Comenzar el recorrido en el nivel 0
1851
+ traverse(data.source, 0);
1852
+ // al menos un nivel de links para dibujar.
1853
+ if (linksMap.size === 0)
1854
+ return;
1855
+ // Mapear nodos acumulados a la estructura requerida por ECharts (name y opcionalmente color, sin value redundante)
1856
+ const nodes = Array.from(nodesMap.keys()).map((currentId) => {
1857
+ const category = currentId.split("___")[0];
1858
+ const nodeItem = {
1859
+ name: currentId,
1860
+ };
1861
+ if (this.colorResolver) {
1862
+ const color = this.colorResolver({ name: category, data: nodeItem });
1863
+ if (color) {
1864
+ nodeItem.itemStyle = { color };
1865
+ }
1866
+ }
1867
+ return nodeItem;
1868
+ });
1869
+ const dynamicSerieOptions = {
1870
+ type: "sankey",
1871
+ orient: "horizontal", // De izquierda a derecha
1872
+ draggable: true,
1873
+ emphasis: {
1874
+ focus: "adjacency",
2080
1875
  },
2081
- axisLabel: {
2082
- margin: 2,
2083
- fontSize: 8,
2084
- align: 'right',
2085
- rotate: 20,
2086
- verticalAlign: 'top',
1876
+ lineStyle: {
1877
+ color: "source",
1878
+ opacity: 0.25,
1879
+ curveness: 0.5,
2087
1880
  },
2088
- splitLine: {
1881
+ label: {
2089
1882
  show: true,
2090
- lineStyle: {
2091
- opacity: 0.2,
2092
- type: 'solid',
2093
- }
2094
- },
2095
- axisLine: {
2096
- lineStyle: {
2097
- type: 'dashed',
1883
+ position: "right",
1884
+ fontFamily: "'Inter', 'Roboto', 'Open Sans', sans-serif",
1885
+ fontSize: 10,
1886
+ formatter: (params) => {
1887
+ // Remover el sufijo de nivel de la etiqueta visual
1888
+ return params.name.split("___")[0];
2098
1889
  },
2099
- }
1890
+ },
1891
+ roam: true,
1892
+ data: nodes,
1893
+ links: Array.from(linksMap.values()),
2100
1894
  };
2101
- const radialAxisOptions = getValueAxisOptions(radiusAxisOverrides);
2102
- radiusAxis.push(radialAxisOptions);
2103
- this.result.radiusAxis = radiusAxis;
2104
- }
2105
- addAngleAxis(data, overrides) {
2106
- const angleAxis = [];
2107
- const categoryAxisOptions = this.getCategoryAxisOptions(data, overrides);
2108
- angleAxis.push(categoryAxisOptions);
2109
- this.result.angleAxis = angleAxis;
1895
+ const serie = merge$1({}, dynamicSerieOptions, overrides);
1896
+ if (this.colorResolver && !serie.itemStyle) {
1897
+ serie.itemStyle = {};
1898
+ }
1899
+ if (this.colorResolver && serie.itemStyle) {
1900
+ serie.itemStyle.color = this.colorResolver;
1901
+ }
1902
+ this.result.series = serie;
2110
1903
  }
2111
- addLegend() {
2112
- this.result.legend = getLegendOptions();
1904
+ addTooltip(data, overrides) {
1905
+ merge$1(overrides, {
1906
+ formatter: getTooltipFormatter(overrides.trigger || 'item', data, this.valueFormatter),
1907
+ });
1908
+ const tooltip = getTooltipOptions(overrides);
1909
+ this.result.tooltip = tooltip;
2113
1910
  }
2114
- // No-ops for ring charts
2115
- addGraphic() { }
1911
+ addPolar() { }
1912
+ addXAxis(data, overrides, type) { }
1913
+ addYAxis(data, overrides, type) { }
1914
+ addRadiusAxis(data, overrides) { }
1915
+ addAngleAxis(data, overrides) { }
1916
+ addLegend() { }
1917
+ addDataZoom() { }
2116
1918
  addDataset(data, opts) { }
2117
- addDataZoom() {
2118
- this.result.dataZoom = [
2119
- {
2120
- type: 'inside'
2121
- },
2122
- {
2123
- type: 'slider',
2124
- height: 20,
2125
- bottom: 60
2126
- }
2127
- ];
1919
+ addCommons() {
1920
+ const opts = {
1921
+ palette: this.palette,
1922
+ };
1923
+ merge$1(this.result, getCommons(opts));
2128
1924
  }
1925
+ addGraphic() { }
2129
1926
  getResult() {
2130
1927
  return this.result;
2131
1928
  }
2132
- ;
2133
- /**
2134
- * Formatea un valor utilizando el callback inyectado.
2135
- */
2136
- formatCellValue(value, key) {
2137
- return this.valueFormatter(value, key);
2138
- }
2139
- // Setters
2140
- /**
2141
- * Permite inyectar un formateador de valores externo.
2142
- */
2143
1929
  setValueFormatter(formatter) {
2144
1930
  if (formatter) {
2145
1931
  this.valueFormatter = formatter;
2146
1932
  }
2147
1933
  }
2148
- /**
2149
- * Permite inyectar una paleta de colores básica.
2150
- */
2151
1934
  setPalette(palette) {
2152
1935
  if (palette) {
2153
1936
  this.palette = palette;
2154
1937
  }
2155
1938
  }
2156
- /**
2157
- * Permite inyectar un resolver de colores dinámico.
2158
- */
2159
1939
  setColorResolver(resolver) {
2160
1940
  if (resolver) {
2161
1941
  this.colorResolver = resolver;
2162
1942
  }
2163
1943
  }
2164
- // Utils
2165
- getCategoryAxisOptions(data, overrides) {
2166
- // No explicit data needed on category axis when using ECharts dataset
2167
- const categoryAxisOptionsOverrides = {
2168
- ...overrides.categoryAxis[0]
2169
- };
2170
- const categoryAxisOptions = getCategoryAxisOptions(categoryAxisOptionsOverrides);
2171
- return categoryAxisOptions;
1944
+ }
1945
+
1946
+ /**
1947
+ * Director de Builds.
1948
+ */
1949
+ class VSECDirector {
1950
+ builder = undefined;
1951
+ constructor(builder) {
1952
+ this.builder = builder;
2172
1953
  }
2173
- getValueAxisOptions(data, overrides) {
2174
- const valueAxisOptions = getValueAxisOptions();
2175
- return valueAxisOptions;
1954
+ makeBar(data, overrides, opts = {}) {
1955
+ if (this.builder instanceof EChartBuilder == false) {
1956
+ return;
1957
+ }
1958
+ ;
1959
+ const { valueFormatter = undefined, palette = undefined, colorResolver = undefined, axisTypes = {
1960
+ x: 'category',
1961
+ y: 'value',
1962
+ // TODO agregar radius y angle axis
1963
+ } } = opts;
1964
+ this.builder.reset();
1965
+ // El orden importa, primero callbacks y despues componentes.
1966
+ // chart callbaks
1967
+ if (valueFormatter)
1968
+ this.builder.setValueFormatter(valueFormatter);
1969
+ if (palette)
1970
+ this.builder.setPalette(palette);
1971
+ if (colorResolver)
1972
+ this.builder.setColorResolver(colorResolver);
1973
+ const product = this.builder.baseProduct;
1974
+ const seriesOverrides = merge$1({}, product.baseOptions.series, overrides[product.chartKey].series);
1975
+ // chart components
1976
+ this.builder.addCommons();
1977
+ const seriesOptions = { axisTypes };
1978
+ this.builder.addSeries(data, seriesOverrides, seriesOptions);
1979
+ this.builder.addXAxis(data, overrides.axis, axisTypes.x);
1980
+ this.builder.addYAxis(data, overrides.axis, axisTypes.y);
1981
+ this.builder.addTooltip(data, overrides.tooltip);
1982
+ this.builder.addLegend();
1983
+ }
1984
+ makeBarRadial(data, overrides, opts = {}) {
1985
+ if (this.builder instanceof EChartBuilder == false) {
1986
+ return;
1987
+ }
1988
+ ;
1989
+ const { valueFormatter = undefined, palette = undefined, colorResolver = undefined, axisTypes = {
1990
+ x: 'category',
1991
+ y: 'value',
1992
+ // TODO agregar radius y angle axis
1993
+ } } = opts;
1994
+ this.builder.reset();
1995
+ // El orden importa, primero callbacks y despues componentes.
1996
+ // chart callbaks
1997
+ if (valueFormatter)
1998
+ this.builder.setValueFormatter(valueFormatter);
1999
+ if (palette)
2000
+ this.builder.setPalette(palette);
2001
+ if (colorResolver)
2002
+ this.builder.setColorResolver(colorResolver);
2003
+ const product = this.builder.baseProduct;
2004
+ const seriesOverrides = merge$1({}, product.baseOptions.series, overrides[product.chartKey].series);
2005
+ // chart components
2006
+ this.builder.addCommons();
2007
+ const seriesOptions = { axisTypes, coordinateSystem: 'polar' };
2008
+ this.builder.addSeries(data, seriesOverrides, seriesOptions);
2009
+ this.builder.addPolar();
2010
+ this.builder.addAngleAxis(data, overrides['axis']);
2011
+ this.builder.addRadiusAxis(data, overrides['axis']);
2012
+ this.builder.addTooltip(data, overrides.tooltip);
2013
+ this.builder.addLegend();
2014
+ }
2015
+ makeLine(data, overrides, opts = {}) {
2016
+ if (this.builder instanceof EChartBuilder == false) {
2017
+ return;
2018
+ }
2019
+ ;
2020
+ const { valueFormatter = undefined, palette = undefined, colorResolver = undefined, axisTypes = {
2021
+ x: 'category',
2022
+ y: 'value',
2023
+ // TODO agregar radius y angle axis
2024
+ } } = opts;
2025
+ this.builder.reset();
2026
+ // El orden importa, primero callbacks y despues componentes.
2027
+ // chart callbaks
2028
+ if (valueFormatter)
2029
+ this.builder.setValueFormatter(valueFormatter);
2030
+ if (palette)
2031
+ this.builder.setPalette(palette);
2032
+ if (colorResolver)
2033
+ this.builder.setColorResolver(colorResolver);
2034
+ const product = this.builder.baseProduct;
2035
+ const seriesOverrides = merge$1({}, product.baseOptions.series, overrides[product.chartKey].series);
2036
+ // chart components
2037
+ this.builder.addCommons();
2038
+ const seriesOptions = { axisTypes };
2039
+ this.builder.addSeries(data, seriesOverrides, seriesOptions);
2040
+ this.builder.addXAxis(data, overrides.axis, axisTypes.x);
2041
+ this.builder.addYAxis(data, overrides.axis, axisTypes.y);
2042
+ this.builder.addTooltip(data, overrides.tooltip);
2043
+ this.builder.addLegend();
2044
+ }
2045
+ makeScatter(data, overrides, opts = {}) {
2046
+ if (this.builder instanceof EChartBuilder == false) {
2047
+ return;
2048
+ }
2049
+ ;
2050
+ const { valueFormatter = undefined, palette = undefined, colorResolver = undefined, axisTypes = {
2051
+ x: 'category',
2052
+ y: 'value',
2053
+ } } = opts;
2054
+ this.builder.reset();
2055
+ // El orden importa, primero callbacks y despues componentes.
2056
+ // chart callbaks
2057
+ if (valueFormatter)
2058
+ this.builder.setValueFormatter(valueFormatter);
2059
+ if (palette)
2060
+ this.builder.setPalette(palette);
2061
+ if (colorResolver)
2062
+ this.builder.setColorResolver(colorResolver);
2063
+ const product = this.builder.baseProduct;
2064
+ const seriesOverrides = merge$1({}, product.baseOptions.series, overrides[product.chartKey].series);
2065
+ // chart components
2066
+ this.builder.addCommons();
2067
+ const seriesOptions = { axisTypes };
2068
+ this.builder.addSeries(data, seriesOverrides, seriesOptions);
2069
+ this.builder.addXAxis(data, overrides.axis, axisTypes.x);
2070
+ this.builder.addYAxis(data, overrides.axis, axisTypes.y);
2071
+ this.builder.addTooltip(data, overrides.tooltip);
2072
+ this.builder.addLegend();
2073
+ }
2074
+ makeRing(data, overrides, opts = {}) {
2075
+ if (this.builder instanceof RingBuilder == false) {
2076
+ return;
2077
+ }
2078
+ ;
2079
+ const { valueFormatter = undefined, palette = undefined, colorResolver = undefined, } = opts;
2080
+ this.builder.reset();
2081
+ // El orden importa, primero callbacks y despues componentes.
2082
+ // chart callbaks
2083
+ if (valueFormatter)
2084
+ this.builder.setValueFormatter(valueFormatter);
2085
+ if (palette)
2086
+ this.builder.setPalette(palette);
2087
+ if (colorResolver)
2088
+ this.builder.setColorResolver(colorResolver);
2089
+ const product = this.builder.baseProduct;
2090
+ const seriesOverrides = merge$1({}, product.baseOptions.series, overrides[product.chartKey].series);
2091
+ // chart components
2092
+ this.builder.addCommons();
2093
+ this.builder.addSeries(data, seriesOverrides);
2094
+ this.builder.addGraphic();
2095
+ this.builder.addTooltip(data, overrides.tooltip);
2096
+ this.builder.addLegend();
2097
+ }
2098
+ makePie(data, overrides, opts = {}) {
2099
+ if (this.builder instanceof PieBuilder == false) {
2100
+ return;
2101
+ }
2102
+ ;
2103
+ const { valueFormatter = undefined, palette = undefined, colorResolver = undefined, } = opts;
2104
+ this.builder.reset();
2105
+ // El orden importa, primero callbacks y despues componentes.
2106
+ // chart callbaks
2107
+ if (valueFormatter)
2108
+ this.builder.setValueFormatter(valueFormatter);
2109
+ if (palette)
2110
+ this.builder.setPalette(palette);
2111
+ if (colorResolver)
2112
+ this.builder.setColorResolver(colorResolver);
2113
+ const product = this.builder.baseProduct;
2114
+ const seriesOverrides = merge$1({}, product.baseOptions.series, overrides[product.chartKey].series);
2115
+ // chart components
2116
+ this.builder.addCommons();
2117
+ this.builder.addSeries(data, seriesOverrides);
2118
+ this.builder.addTooltip(data, overrides.tooltip);
2119
+ this.builder.addLegend();
2120
+ }
2121
+ makeFunnel(data, overrides, opts = {}) {
2122
+ if (this.builder instanceof FunnelBuilder == false) {
2123
+ return;
2124
+ }
2125
+ ;
2126
+ const { valueFormatter = undefined, palette = undefined, colorResolver = undefined, } = opts;
2127
+ this.builder.reset();
2128
+ // El orden importa, primero callbacks y despues componentes.
2129
+ // chart callbaks
2130
+ if (valueFormatter)
2131
+ this.builder.setValueFormatter(valueFormatter);
2132
+ if (palette)
2133
+ this.builder.setPalette(palette);
2134
+ if (colorResolver)
2135
+ this.builder.setColorResolver(colorResolver);
2136
+ const product = this.builder.baseProduct;
2137
+ const seriesOverrides = merge$1({}, product.baseOptions.series, overrides[product.chartKey].series);
2138
+ // chart components
2139
+ this.builder.addCommons();
2140
+ this.builder.addSeries(data, seriesOverrides);
2141
+ this.builder.addTooltip(data, overrides.tooltip);
2142
+ this.builder.addLegend();
2143
+ }
2144
+ makeSunburst(data, overrides, opts = {}) {
2145
+ if (this.builder instanceof SunburstBuilder == false) {
2146
+ return;
2147
+ }
2148
+ ;
2149
+ const { valueFormatter = undefined, palette = undefined, colorResolver = undefined, } = opts;
2150
+ this.builder.reset();
2151
+ // El orden importa, primero callbacks y despues componentes.
2152
+ // chart callbaks
2153
+ if (valueFormatter)
2154
+ this.builder.setValueFormatter(valueFormatter);
2155
+ if (palette)
2156
+ this.builder.setPalette(palette);
2157
+ if (colorResolver)
2158
+ this.builder.setColorResolver(colorResolver);
2159
+ const product = this.builder.baseProduct;
2160
+ const seriesOverrides = merge$1({}, product.baseOptions.series, overrides[product.chartKey].series);
2161
+ // chart components
2162
+ this.builder.addCommons();
2163
+ this.builder.addSeries(data, seriesOverrides);
2164
+ this.builder.addTooltip(data, overrides.tooltip);
2165
+ }
2166
+ makeSankey(data, overrides, opts = {}) {
2167
+ if (this.builder instanceof SankeyBuilder == false) {
2168
+ return;
2169
+ }
2170
+ ;
2171
+ const { valueFormatter = undefined, palette = undefined, colorResolver = undefined, } = opts;
2172
+ this.builder.reset();
2173
+ // El orden importa, primero callbacks y despues componentes.
2174
+ // chart callbaks
2175
+ if (valueFormatter)
2176
+ this.builder.setValueFormatter(valueFormatter);
2177
+ if (palette)
2178
+ this.builder.setPalette(palette);
2179
+ if (colorResolver)
2180
+ this.builder.setColorResolver(colorResolver);
2181
+ const product = this.builder.baseProduct;
2182
+ const seriesOverrides = merge$1({}, product.baseOptions.series, overrides[product.chartKey].series);
2183
+ // chart components
2184
+ this.builder.addCommons();
2185
+ this.builder.addSeries(data, seriesOverrides);
2186
+ this.builder.addTooltip(data, overrides.tooltip);
2187
+ }
2188
+ makeBoxplot(data, overrides, opts = {}) {
2189
+ if (this.builder instanceof BoxPlotBuilder == false) {
2190
+ return;
2191
+ }
2192
+ const { valueFormatter = undefined, palette = undefined, colorResolver = undefined, axisTypes = {
2193
+ x: 'value',
2194
+ y: 'category',
2195
+ }, } = opts;
2196
+ this.builder.reset();
2197
+ // El orden importa, primero callbacks y despues componentes.
2198
+ // chart callbaks
2199
+ if (valueFormatter)
2200
+ this.builder.setValueFormatter(valueFormatter);
2201
+ if (palette)
2202
+ this.builder.setPalette(palette);
2203
+ if (colorResolver)
2204
+ this.builder.setColorResolver(colorResolver);
2205
+ const product = this.builder.baseProduct;
2206
+ const seriesOverrides = merge$1({}, product.baseOptions.series, overrides[product.chartKey].series);
2207
+ // chart components
2208
+ this.builder.addCommons();
2209
+ const configOpts = { axisTypes };
2210
+ this.builder.addDataset(data);
2211
+ this.builder.addSeries(data, seriesOverrides, configOpts);
2212
+ this.builder.addXAxis(data, overrides.axis, axisTypes.x);
2213
+ this.builder.addYAxis(data, overrides.axis, axisTypes.y);
2214
+ this.builder.addTooltip(data, overrides.tooltip);
2215
+ this.builder.addDataZoom();
2216
+ }
2217
+ }
2218
+
2219
+ /**
2220
+ * EchartsRingComponent
2221
+ *
2222
+ * Especialista en visualización de tipo Ring. Soporta multi-medidas y KPI central.
2223
+ * @see {@link vs-echarts/docs/charts/ring-patterns.md}
2224
+ */
2225
+ class EchartsRingComponent extends BaseEchartsComponent {
2226
+ baseSeriesOptions = {
2227
+ type: 'pie',
2228
+ center: ['50%', '50%'],
2229
+ avoidLabelOverlap: true,
2230
+ minAngle: 3,
2231
+ selectedMode: 'single',
2232
+ selectedOffset: 4,
2233
+ itemStyle: {
2234
+ borderColor: '#fff',
2235
+ },
2236
+ label: { show: false },
2237
+ emphasis: {
2238
+ scale: true,
2239
+ scaleSize: 2,
2240
+ },
2241
+ select: {
2242
+ itemStyle: {
2243
+ borderColor: EChartsTokens.sBorderColor,
2244
+ shadowColor: EChartsTokens.sShadowColor,
2245
+ borderWidth: 1,
2246
+ shadowBlur: 4,
2247
+ },
2248
+ },
2249
+ animationType: 'scale',
2250
+ animationEasing: 'elasticOut',
2251
+ };
2252
+ baseProduct = {
2253
+ chartKey: 'ring',
2254
+ baseOptions: {
2255
+ series: this.baseSeriesOptions,
2256
+ }
2257
+ };
2258
+ builder = new RingBuilder(this.baseProduct);
2259
+ director = new VSECDirector(this.builder);
2260
+ lastSelectedSeriesIndex = null;
2261
+ lastSelectedDataIndex = null;
2262
+ selectedPercent = null;
2263
+ currentGraphicText = '';
2264
+ constructor() {
2265
+ super();
2266
+ }
2267
+ make() {
2268
+ const makeOpts = {
2269
+ valueFormatter: this.valueFormatter,
2270
+ palette: this.palette,
2271
+ colorResolver: this.colorResolver,
2272
+ };
2273
+ this.director.makeRing(this.data, this.optionsOverrides, makeOpts);
2274
+ }
2275
+ onInputChanges(changes) {
2276
+ // Reset selection only if data changed
2277
+ if (changes['data']) {
2278
+ this.lastSelectedSeriesIndex = null;
2279
+ this.lastSelectedDataIndex = null;
2280
+ this.selectedPercent = null;
2281
+ this.currentGraphicText = '';
2282
+ }
2283
+ super.onInputChanges(changes);
2284
+ }
2285
+ /**
2286
+ * Maneja clics en los sectores del ring.
2287
+ * Soporta múltiples series (anillos) y actualiza el KPI central.
2288
+ */
2289
+ onChartClick(event) {
2290
+ if (this.chartInstance && event && event.dataIndex !== undefined) {
2291
+ const isSameSelection = event.seriesIndex === this.lastSelectedSeriesIndex &&
2292
+ event.dataIndex === this.lastSelectedDataIndex;
2293
+ if (isSameSelection) {
2294
+ // Toggle OFF
2295
+ this.lastSelectedSeriesIndex = null;
2296
+ this.lastSelectedDataIndex = null;
2297
+ this.selectedPercent = null;
2298
+ this.setGraphicText('');
2299
+ }
2300
+ else {
2301
+ // SELECT
2302
+ this.lastSelectedSeriesIndex = event.seriesIndex;
2303
+ this.lastSelectedDataIndex = event.dataIndex;
2304
+ this.selectedPercent = (event.percent !== undefined) ? event.percent + '%' : '';
2305
+ this.setGraphicText(this.selectedPercent);
2306
+ }
2307
+ this.chartClick.emit({
2308
+ type: 'cross-filter',
2309
+ data: {
2310
+ category: event.name,
2311
+ serie: event.seriesName,
2312
+ value: event.value
2313
+ }
2314
+ });
2315
+ }
2316
+ }
2317
+ onChartMouseOver(event) {
2318
+ if (this.selectedPercent === null && event && event.percent !== undefined) {
2319
+ this.setGraphicText(event.percent + '%');
2320
+ }
2321
+ }
2322
+ onChartMouseOut(event) {
2323
+ if (this.selectedPercent === null) {
2324
+ this.setGraphicText('');
2325
+ }
2326
+ }
2327
+ /**
2328
+ * Actualiza el texto del Graphic central y persiste la selección en el modelo de opciones.
2329
+ */
2330
+ setGraphicText(text) {
2331
+ this.currentGraphicText = text;
2332
+ // Persistencia de GRAPHIC (KPI central)
2333
+ this.chartInstance?.setOption({
2334
+ graphic: {
2335
+ style: {
2336
+ text: this.currentGraphicText,
2337
+ opacity: this.currentGraphicText ? 1 : 0,
2338
+ }
2339
+ }
2340
+ });
2341
+ }
2342
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: EchartsRingComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2343
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.19", type: EchartsRingComponent, isStandalone: true, selector: "vs-echarts-ring", usesInheritance: true, ngImport: i0, template: "<div class=\"echarts-container\" \n echarts \n [options]=\"{}\"\n [initOpts]=\"initOptions\"\n [autoResize]=\"true\" \n (chartInit)=\"onChartInit($event)\" \n (chartClick)=\"onChartClick($event)\" \n (chartMouseOver)=\"onChartMouseOver($event)\" \n (chartMouseOut)=\"onChartMouseOut($event)\" \n (chartSelectChanged)=\"onChartSelectChanged($event, { fixPieDataIndexInside: true })\"\n></div>\n ", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: NgxEchartsDirective, selector: "echarts, [echarts]", inputs: ["options", "theme", "initOpts", "merge", "autoResize", "loading", "loadingType", "loadingOpts"], outputs: ["chartInit", "optionsError", "chartClick", "chartDblClick", "chartMouseDown", "chartMouseMove", "chartMouseUp", "chartMouseOver", "chartMouseOut", "chartGlobalOut", "chartContextMenu", "chartHighlight", "chartDownplay", "chartSelectChanged", "chartLegendSelectChanged", "chartLegendSelected", "chartLegendUnselected", "chartLegendLegendSelectAll", "chartLegendLegendInverseSelect", "chartLegendScroll", "chartDataZoom", "chartDataRangeSelected", "chartGraphRoam", "chartGeoRoam", "chartTreeRoam", "chartTimelineChanged", "chartTimelinePlayChanged", "chartRestore", "chartDataViewChanged", "chartMagicTypeChanged", "chartGeoSelectChanged", "chartGeoSelected", "chartGeoUnselected", "chartAxisAreaSelected", "chartBrush", "chartBrushEnd", "chartBrushSelected", "chartGlobalCursorTaken", "chartRendered", "chartFinished"], exportAs: ["echarts"] }] });
2344
+ }
2345
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: EchartsRingComponent, decorators: [{
2346
+ type: Component,
2347
+ args: [{ selector: 'vs-echarts-ring', standalone: true, imports: [
2348
+ CommonModule,
2349
+ NgxEchartsDirective,
2350
+ ], template: "<div class=\"echarts-container\" \n echarts \n [options]=\"{}\"\n [initOpts]=\"initOptions\"\n [autoResize]=\"true\" \n (chartInit)=\"onChartInit($event)\" \n (chartClick)=\"onChartClick($event)\" \n (chartMouseOver)=\"onChartMouseOver($event)\" \n (chartMouseOut)=\"onChartMouseOut($event)\" \n (chartSelectChanged)=\"onChartSelectChanged($event, { fixPieDataIndexInside: true })\"\n></div>\n ", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"] }]
2351
+ }], ctorParameters: () => [] });
2352
+
2353
+ /**
2354
+ * EchartsPieComponent
2355
+ *
2356
+ * Especialista en visualización de tipo Pie (Torta y Anillos concéntricos).
2357
+ * La primera serie se dibuja como un gráfico de torta tradicional (lleno) y
2358
+ * las subsecuentes como anillos concéntricos alrededor.
2359
+ */
2360
+ class EchartsPieComponent extends BaseEchartsComponent {
2361
+ baseSeriesOptions = {
2362
+ type: 'pie',
2363
+ center: ['50%', '50%'],
2364
+ avoidLabelOverlap: true,
2365
+ minAngle: 3,
2366
+ selectedMode: 'single',
2367
+ selectedOffset: 4,
2368
+ emphasis: {
2369
+ scale: true,
2370
+ scaleSize: 2,
2371
+ },
2372
+ select: {
2373
+ itemStyle: {
2374
+ borderColor: EChartsTokens.sBorderColor,
2375
+ shadowColor: EChartsTokens.sShadowColor,
2376
+ borderWidth: 1,
2377
+ shadowBlur: 4,
2378
+ },
2379
+ },
2380
+ animationType: 'scale',
2381
+ animationEasing: 'elasticOut',
2382
+ };
2383
+ baseProduct = {
2384
+ chartKey: 'pie',
2385
+ baseOptions: {
2386
+ series: this.baseSeriesOptions,
2387
+ }
2388
+ };
2389
+ builder = new PieBuilder(this.baseProduct);
2390
+ director = new VSECDirector(this.builder);
2391
+ constructor() {
2392
+ super();
2393
+ }
2394
+ make() {
2395
+ const makeOpts = {
2396
+ valueFormatter: this.valueFormatter,
2397
+ palette: this.palette,
2398
+ colorResolver: this.colorResolver,
2399
+ };
2400
+ this.director.makePie(this.data, this.optionsOverrides, makeOpts);
2401
+ }
2402
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: EchartsPieComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2403
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.19", type: EchartsPieComponent, isStandalone: true, selector: "vs-echarts-pie", usesInheritance: true, ngImport: i0, template: "<div\n class=\"echarts-container\"\n echarts\n [options]=\"{}\"\n [initOpts]=\"initOptions\"\n [autoResize]=\"true\"\n (chartInit)=\"onChartInit($event)\"\n (chartClick)=\"onChartClick($event)\"\n (chartSelectChanged)=\"onChartSelectChanged($event, { fixPieDataIndexInside: true })\"\n></div>\n", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: NgxEchartsDirective, selector: "echarts, [echarts]", inputs: ["options", "theme", "initOpts", "merge", "autoResize", "loading", "loadingType", "loadingOpts"], outputs: ["chartInit", "optionsError", "chartClick", "chartDblClick", "chartMouseDown", "chartMouseMove", "chartMouseUp", "chartMouseOver", "chartMouseOut", "chartGlobalOut", "chartContextMenu", "chartHighlight", "chartDownplay", "chartSelectChanged", "chartLegendSelectChanged", "chartLegendSelected", "chartLegendUnselected", "chartLegendLegendSelectAll", "chartLegendLegendInverseSelect", "chartLegendScroll", "chartDataZoom", "chartDataRangeSelected", "chartGraphRoam", "chartGeoRoam", "chartTreeRoam", "chartTimelineChanged", "chartTimelinePlayChanged", "chartRestore", "chartDataViewChanged", "chartMagicTypeChanged", "chartGeoSelectChanged", "chartGeoSelected", "chartGeoUnselected", "chartAxisAreaSelected", "chartBrush", "chartBrushEnd", "chartBrushSelected", "chartGlobalCursorTaken", "chartRendered", "chartFinished"], exportAs: ["echarts"] }] });
2404
+ }
2405
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: EchartsPieComponent, decorators: [{
2406
+ type: Component,
2407
+ args: [{ selector: 'vs-echarts-pie', standalone: true, imports: [
2408
+ CommonModule,
2409
+ NgxEchartsDirective,
2410
+ ], template: "<div\n class=\"echarts-container\"\n echarts\n [options]=\"{}\"\n [initOpts]=\"initOptions\"\n [autoResize]=\"true\"\n (chartInit)=\"onChartInit($event)\"\n (chartClick)=\"onChartClick($event)\"\n (chartSelectChanged)=\"onChartSelectChanged($event, { fixPieDataIndexInside: true })\"\n></div>\n", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"] }]
2411
+ }], ctorParameters: () => [] });
2412
+
2413
+ /**
2414
+ * EchartsFunnelComponent
2415
+ *
2416
+ * Component for Funnel visualization. Supports single and multiple measures.
2417
+ */
2418
+ class EchartsFunnelComponent extends BaseEchartsComponent {
2419
+ baseSeriesOptions = {
2420
+ type: 'funnel',
2421
+ left: '10%',
2422
+ width: '80%',
2423
+ minSize: '0.01%',
2424
+ maxSize: '100%',
2425
+ sort: 'descending',
2426
+ gap: 2,
2427
+ label: {
2428
+ show: true,
2429
+ position: 'inside'
2430
+ },
2431
+ labelLine: {
2432
+ show: false
2433
+ },
2434
+ itemStyle: {
2435
+ borderColor: '#fff',
2436
+ borderWidth: 1
2437
+ },
2438
+ emphasis: {
2439
+ label: {
2440
+ fontSize: 16
2441
+ }
2442
+ },
2443
+ selectedMode: 'single',
2444
+ select: {
2445
+ label: {
2446
+ fontSize: 16
2447
+ },
2448
+ itemStyle: {
2449
+ borderWidth: 1,
2450
+ borderColor: EChartsTokens.sBorderColor,
2451
+ shadowColor: EChartsTokens.sShadowColor,
2452
+ shadowBlur: 6,
2453
+ }
2454
+ },
2455
+ };
2456
+ baseProduct = {
2457
+ chartKey: 'funnel',
2458
+ baseOptions: {
2459
+ series: this.baseSeriesOptions,
2460
+ }
2461
+ };
2462
+ builder = new FunnelBuilder(this.baseProduct);
2463
+ director = new VSECDirector(this.builder);
2464
+ constructor() {
2465
+ super();
2466
+ }
2467
+ make() {
2468
+ const makeOpts = {
2469
+ valueFormatter: this.valueFormatter,
2470
+ palette: this.palette,
2471
+ colorResolver: this.colorResolver,
2472
+ };
2473
+ this.director.makeFunnel(this.data, this.optionsOverrides, makeOpts);
2176
2474
  }
2475
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: EchartsFunnelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2476
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.19", type: EchartsFunnelComponent, isStandalone: true, selector: "vs-echarts-funnel", usesInheritance: true, ngImport: i0, template: "<div class=\"echarts-container\" echarts \n [options]=\"{}\"\n [initOpts]=\"initOptions\" \n [autoResize]=\"true\" \n (chartInit)=\"onChartInit($event)\" \n (chartClick)=\"onChartClick($event)\" \n (chartSelectChanged)=\"onChartSelectChanged($event, { fixPieDataIndexInside: true })\"\n></div>\n", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: NgxEchartsDirective, selector: "echarts, [echarts]", inputs: ["options", "theme", "initOpts", "merge", "autoResize", "loading", "loadingType", "loadingOpts"], outputs: ["chartInit", "optionsError", "chartClick", "chartDblClick", "chartMouseDown", "chartMouseMove", "chartMouseUp", "chartMouseOver", "chartMouseOut", "chartGlobalOut", "chartContextMenu", "chartHighlight", "chartDownplay", "chartSelectChanged", "chartLegendSelectChanged", "chartLegendSelected", "chartLegendUnselected", "chartLegendLegendSelectAll", "chartLegendLegendInverseSelect", "chartLegendScroll", "chartDataZoom", "chartDataRangeSelected", "chartGraphRoam", "chartGeoRoam", "chartTreeRoam", "chartTimelineChanged", "chartTimelinePlayChanged", "chartRestore", "chartDataViewChanged", "chartMagicTypeChanged", "chartGeoSelectChanged", "chartGeoSelected", "chartGeoUnselected", "chartAxisAreaSelected", "chartBrush", "chartBrushEnd", "chartBrushSelected", "chartGlobalCursorTaken", "chartRendered", "chartFinished"], exportAs: ["echarts"] }] });
2177
2477
  }
2478
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: EchartsFunnelComponent, decorators: [{
2479
+ type: Component,
2480
+ args: [{ selector: 'vs-echarts-funnel', standalone: true, imports: [
2481
+ CommonModule,
2482
+ NgxEchartsDirective,
2483
+ ], template: "<div class=\"echarts-container\" echarts \n [options]=\"{}\"\n [initOpts]=\"initOptions\" \n [autoResize]=\"true\" \n (chartInit)=\"onChartInit($event)\" \n (chartClick)=\"onChartClick($event)\" \n (chartSelectChanged)=\"onChartSelectChanged($event, { fixPieDataIndexInside: true })\"\n></div>\n", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"] }]
2484
+ }], ctorParameters: () => [] });
2178
2485
 
2179
2486
  class EchartsBarComponent extends BaseEchartsComponent {
2180
2487
  /**
@@ -2232,14 +2539,14 @@ class EchartsBarComponent extends BaseEchartsComponent {
2232
2539
  this.director.makeBar(this.data, this.optionsOverrides, makeBarOpts);
2233
2540
  }
2234
2541
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: EchartsBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2235
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.19", type: EchartsBarComponent, isStandalone: true, selector: "vs-echarts-bar", providers: [provideVSEcharts()], usesInheritance: true, ngImport: i0, template: "<div class=\"echarts-container\" echarts \n [options]=\"{}\"\n [initOpts]=\"initOptions\" \n [autoResize]=\"true\" \n (chartInit)=\"onChartInit($event)\" \n (chartClick)=\"onChartClick($event)\" \n (chartSelectChanged)=\"onChartSelectChanged($event)\"\n></div>\n", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: NgxEchartsDirective, selector: "echarts, [echarts]", inputs: ["options", "theme", "initOpts", "merge", "autoResize", "loading", "loadingType", "loadingOpts"], outputs: ["chartInit", "optionsError", "chartClick", "chartDblClick", "chartMouseDown", "chartMouseMove", "chartMouseUp", "chartMouseOver", "chartMouseOut", "chartGlobalOut", "chartContextMenu", "chartHighlight", "chartDownplay", "chartSelectChanged", "chartLegendSelectChanged", "chartLegendSelected", "chartLegendUnselected", "chartLegendLegendSelectAll", "chartLegendLegendInverseSelect", "chartLegendScroll", "chartDataZoom", "chartDataRangeSelected", "chartGraphRoam", "chartGeoRoam", "chartTreeRoam", "chartTimelineChanged", "chartTimelinePlayChanged", "chartRestore", "chartDataViewChanged", "chartMagicTypeChanged", "chartGeoSelectChanged", "chartGeoSelected", "chartGeoUnselected", "chartAxisAreaSelected", "chartBrush", "chartBrushEnd", "chartBrushSelected", "chartGlobalCursorTaken", "chartRendered", "chartFinished"], exportAs: ["echarts"] }] });
2542
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.19", type: EchartsBarComponent, isStandalone: true, selector: "vs-echarts-bar", usesInheritance: true, ngImport: i0, template: "<div class=\"echarts-container\" echarts \n [options]=\"{}\"\n [initOpts]=\"initOptions\" \n [autoResize]=\"true\" \n (chartInit)=\"onChartInit($event)\" \n (chartClick)=\"onChartClick($event)\" \n (chartSelectChanged)=\"onChartSelectChanged($event)\"\n></div>\n", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: NgxEchartsDirective, selector: "echarts, [echarts]", inputs: ["options", "theme", "initOpts", "merge", "autoResize", "loading", "loadingType", "loadingOpts"], outputs: ["chartInit", "optionsError", "chartClick", "chartDblClick", "chartMouseDown", "chartMouseMove", "chartMouseUp", "chartMouseOver", "chartMouseOut", "chartGlobalOut", "chartContextMenu", "chartHighlight", "chartDownplay", "chartSelectChanged", "chartLegendSelectChanged", "chartLegendSelected", "chartLegendUnselected", "chartLegendLegendSelectAll", "chartLegendLegendInverseSelect", "chartLegendScroll", "chartDataZoom", "chartDataRangeSelected", "chartGraphRoam", "chartGeoRoam", "chartTreeRoam", "chartTimelineChanged", "chartTimelinePlayChanged", "chartRestore", "chartDataViewChanged", "chartMagicTypeChanged", "chartGeoSelectChanged", "chartGeoSelected", "chartGeoUnselected", "chartAxisAreaSelected", "chartBrush", "chartBrushEnd", "chartBrushSelected", "chartGlobalCursorTaken", "chartRendered", "chartFinished"], exportAs: ["echarts"] }] });
2236
2543
  }
2237
2544
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: EchartsBarComponent, decorators: [{
2238
2545
  type: Component,
2239
2546
  args: [{ selector: 'vs-echarts-bar', standalone: true, imports: [
2240
2547
  CommonModule,
2241
2548
  NgxEchartsDirective,
2242
- ], providers: [provideVSEcharts()], template: "<div class=\"echarts-container\" echarts \n [options]=\"{}\"\n [initOpts]=\"initOptions\" \n [autoResize]=\"true\" \n (chartInit)=\"onChartInit($event)\" \n (chartClick)=\"onChartClick($event)\" \n (chartSelectChanged)=\"onChartSelectChanged($event)\"\n></div>\n", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"] }]
2549
+ ], template: "<div class=\"echarts-container\" echarts \n [options]=\"{}\"\n [initOpts]=\"initOptions\" \n [autoResize]=\"true\" \n (chartInit)=\"onChartInit($event)\" \n (chartClick)=\"onChartClick($event)\" \n (chartSelectChanged)=\"onChartSelectChanged($event)\"\n></div>\n", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"] }]
2243
2550
  }], ctorParameters: () => [] });
2244
2551
 
2245
2552
  class EChartsHBarComponent extends EchartsBarComponent {
@@ -2270,14 +2577,14 @@ class EChartsHBarComponent extends EchartsBarComponent {
2270
2577
  this.director.makeBar(this.data, this.optionsOverrides, makeOpts);
2271
2578
  }
2272
2579
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: EChartsHBarComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
2273
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.19", type: EChartsHBarComponent, isStandalone: true, selector: "vs-echarts-hbar", providers: [provideVSEcharts()], usesInheritance: true, ngImport: i0, template: "<div class=\"echarts-container\" echarts \n [options]=\"{}\"\n [initOpts]=\"initOptions\" \n [autoResize]=\"true\" \n (chartInit)=\"onChartInit($event)\" \n (chartClick)=\"onChartClick($event)\" \n (chartSelectChanged)=\"onChartSelectChanged($event)\"\n></div>\n", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: NgxEchartsDirective, selector: "echarts, [echarts]", inputs: ["options", "theme", "initOpts", "merge", "autoResize", "loading", "loadingType", "loadingOpts"], outputs: ["chartInit", "optionsError", "chartClick", "chartDblClick", "chartMouseDown", "chartMouseMove", "chartMouseUp", "chartMouseOver", "chartMouseOut", "chartGlobalOut", "chartContextMenu", "chartHighlight", "chartDownplay", "chartSelectChanged", "chartLegendSelectChanged", "chartLegendSelected", "chartLegendUnselected", "chartLegendLegendSelectAll", "chartLegendLegendInverseSelect", "chartLegendScroll", "chartDataZoom", "chartDataRangeSelected", "chartGraphRoam", "chartGeoRoam", "chartTreeRoam", "chartTimelineChanged", "chartTimelinePlayChanged", "chartRestore", "chartDataViewChanged", "chartMagicTypeChanged", "chartGeoSelectChanged", "chartGeoSelected", "chartGeoUnselected", "chartAxisAreaSelected", "chartBrush", "chartBrushEnd", "chartBrushSelected", "chartGlobalCursorTaken", "chartRendered", "chartFinished"], exportAs: ["echarts"] }] });
2580
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.19", type: EChartsHBarComponent, isStandalone: true, selector: "vs-echarts-hbar", usesInheritance: true, ngImport: i0, template: "<div class=\"echarts-container\" echarts \n [options]=\"{}\"\n [initOpts]=\"initOptions\" \n [autoResize]=\"true\" \n (chartInit)=\"onChartInit($event)\" \n (chartClick)=\"onChartClick($event)\" \n (chartSelectChanged)=\"onChartSelectChanged($event)\"\n></div>\n", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: NgxEchartsDirective, selector: "echarts, [echarts]", inputs: ["options", "theme", "initOpts", "merge", "autoResize", "loading", "loadingType", "loadingOpts"], outputs: ["chartInit", "optionsError", "chartClick", "chartDblClick", "chartMouseDown", "chartMouseMove", "chartMouseUp", "chartMouseOver", "chartMouseOut", "chartGlobalOut", "chartContextMenu", "chartHighlight", "chartDownplay", "chartSelectChanged", "chartLegendSelectChanged", "chartLegendSelected", "chartLegendUnselected", "chartLegendLegendSelectAll", "chartLegendLegendInverseSelect", "chartLegendScroll", "chartDataZoom", "chartDataRangeSelected", "chartGraphRoam", "chartGeoRoam", "chartTreeRoam", "chartTimelineChanged", "chartTimelinePlayChanged", "chartRestore", "chartDataViewChanged", "chartMagicTypeChanged", "chartGeoSelectChanged", "chartGeoSelected", "chartGeoUnselected", "chartAxisAreaSelected", "chartBrush", "chartBrushEnd", "chartBrushSelected", "chartGlobalCursorTaken", "chartRendered", "chartFinished"], exportAs: ["echarts"] }] });
2274
2581
  }
2275
2582
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: EChartsHBarComponent, decorators: [{
2276
2583
  type: Component,
2277
2584
  args: [{ selector: 'vs-echarts-hbar', standalone: true, imports: [
2278
2585
  CommonModule,
2279
2586
  NgxEchartsDirective,
2280
- ], providers: [provideVSEcharts()], template: "<div class=\"echarts-container\" echarts \n [options]=\"{}\"\n [initOpts]=\"initOptions\" \n [autoResize]=\"true\" \n (chartInit)=\"onChartInit($event)\" \n (chartClick)=\"onChartClick($event)\" \n (chartSelectChanged)=\"onChartSelectChanged($event)\"\n></div>\n", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"] }]
2587
+ ], template: "<div class=\"echarts-container\" echarts \n [options]=\"{}\"\n [initOpts]=\"initOptions\" \n [autoResize]=\"true\" \n (chartInit)=\"onChartInit($event)\" \n (chartClick)=\"onChartClick($event)\" \n (chartSelectChanged)=\"onChartSelectChanged($event)\"\n></div>\n", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"] }]
2281
2588
  }] });
2282
2589
 
2283
2590
  class EChartsBarStackedComponent extends EchartsBarComponent {
@@ -2300,14 +2607,14 @@ class EChartsBarStackedComponent extends EchartsBarComponent {
2300
2607
  builder = new EChartBuilder(this.variantBaseProduct);
2301
2608
  director = new VSECDirector(this.builder);
2302
2609
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: EChartsBarStackedComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
2303
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.19", type: EChartsBarStackedComponent, isStandalone: true, selector: "vs-echarts-stacked-bar", providers: [provideVSEcharts()], usesInheritance: true, ngImport: i0, template: "<div class=\"echarts-container\" echarts \n [options]=\"{}\"\n [initOpts]=\"initOptions\" \n [autoResize]=\"true\" \n (chartInit)=\"onChartInit($event)\" \n (chartClick)=\"onChartClick($event)\" \n (chartSelectChanged)=\"onChartSelectChanged($event)\"\n></div>\n", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: NgxEchartsDirective, selector: "echarts, [echarts]", inputs: ["options", "theme", "initOpts", "merge", "autoResize", "loading", "loadingType", "loadingOpts"], outputs: ["chartInit", "optionsError", "chartClick", "chartDblClick", "chartMouseDown", "chartMouseMove", "chartMouseUp", "chartMouseOver", "chartMouseOut", "chartGlobalOut", "chartContextMenu", "chartHighlight", "chartDownplay", "chartSelectChanged", "chartLegendSelectChanged", "chartLegendSelected", "chartLegendUnselected", "chartLegendLegendSelectAll", "chartLegendLegendInverseSelect", "chartLegendScroll", "chartDataZoom", "chartDataRangeSelected", "chartGraphRoam", "chartGeoRoam", "chartTreeRoam", "chartTimelineChanged", "chartTimelinePlayChanged", "chartRestore", "chartDataViewChanged", "chartMagicTypeChanged", "chartGeoSelectChanged", "chartGeoSelected", "chartGeoUnselected", "chartAxisAreaSelected", "chartBrush", "chartBrushEnd", "chartBrushSelected", "chartGlobalCursorTaken", "chartRendered", "chartFinished"], exportAs: ["echarts"] }] });
2610
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.19", type: EChartsBarStackedComponent, isStandalone: true, selector: "vs-echarts-stacked-bar", usesInheritance: true, ngImport: i0, template: "<div class=\"echarts-container\" echarts \n [options]=\"{}\"\n [initOpts]=\"initOptions\" \n [autoResize]=\"true\" \n (chartInit)=\"onChartInit($event)\" \n (chartClick)=\"onChartClick($event)\" \n (chartSelectChanged)=\"onChartSelectChanged($event)\"\n></div>\n", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: NgxEchartsDirective, selector: "echarts, [echarts]", inputs: ["options", "theme", "initOpts", "merge", "autoResize", "loading", "loadingType", "loadingOpts"], outputs: ["chartInit", "optionsError", "chartClick", "chartDblClick", "chartMouseDown", "chartMouseMove", "chartMouseUp", "chartMouseOver", "chartMouseOut", "chartGlobalOut", "chartContextMenu", "chartHighlight", "chartDownplay", "chartSelectChanged", "chartLegendSelectChanged", "chartLegendSelected", "chartLegendUnselected", "chartLegendLegendSelectAll", "chartLegendLegendInverseSelect", "chartLegendScroll", "chartDataZoom", "chartDataRangeSelected", "chartGraphRoam", "chartGeoRoam", "chartTreeRoam", "chartTimelineChanged", "chartTimelinePlayChanged", "chartRestore", "chartDataViewChanged", "chartMagicTypeChanged", "chartGeoSelectChanged", "chartGeoSelected", "chartGeoUnselected", "chartAxisAreaSelected", "chartBrush", "chartBrushEnd", "chartBrushSelected", "chartGlobalCursorTaken", "chartRendered", "chartFinished"], exportAs: ["echarts"] }] });
2304
2611
  }
2305
2612
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: EChartsBarStackedComponent, decorators: [{
2306
2613
  type: Component,
2307
2614
  args: [{ selector: 'vs-echarts-stacked-bar', standalone: true, imports: [
2308
2615
  CommonModule,
2309
2616
  NgxEchartsDirective,
2310
- ], providers: [provideVSEcharts()], template: "<div class=\"echarts-container\" echarts \n [options]=\"{}\"\n [initOpts]=\"initOptions\" \n [autoResize]=\"true\" \n (chartInit)=\"onChartInit($event)\" \n (chartClick)=\"onChartClick($event)\" \n (chartSelectChanged)=\"onChartSelectChanged($event)\"\n></div>\n", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"] }]
2617
+ ], template: "<div class=\"echarts-container\" echarts \n [options]=\"{}\"\n [initOpts]=\"initOptions\" \n [autoResize]=\"true\" \n (chartInit)=\"onChartInit($event)\" \n (chartClick)=\"onChartClick($event)\" \n (chartSelectChanged)=\"onChartSelectChanged($event)\"\n></div>\n", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"] }]
2311
2618
  }] });
2312
2619
 
2313
2620
  class EChartsHBarStackedComponent extends EchartsBarComponent {
@@ -2342,14 +2649,14 @@ class EChartsHBarStackedComponent extends EchartsBarComponent {
2342
2649
  this.director.makeBar(this.data, this.optionsOverrides, makeOpts);
2343
2650
  }
2344
2651
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: EChartsHBarStackedComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
2345
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.19", type: EChartsHBarStackedComponent, isStandalone: true, selector: "vs-echarts-hbar-stacked", providers: [provideVSEcharts()], usesInheritance: true, ngImport: i0, template: "<div class=\"echarts-container\" echarts \n [options]=\"{}\"\n [initOpts]=\"initOptions\" \n [autoResize]=\"true\" \n (chartInit)=\"onChartInit($event)\" \n (chartClick)=\"onChartClick($event)\" \n (chartSelectChanged)=\"onChartSelectChanged($event)\"\n></div>\n", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: NgxEchartsDirective, selector: "echarts, [echarts]", inputs: ["options", "theme", "initOpts", "merge", "autoResize", "loading", "loadingType", "loadingOpts"], outputs: ["chartInit", "optionsError", "chartClick", "chartDblClick", "chartMouseDown", "chartMouseMove", "chartMouseUp", "chartMouseOver", "chartMouseOut", "chartGlobalOut", "chartContextMenu", "chartHighlight", "chartDownplay", "chartSelectChanged", "chartLegendSelectChanged", "chartLegendSelected", "chartLegendUnselected", "chartLegendLegendSelectAll", "chartLegendLegendInverseSelect", "chartLegendScroll", "chartDataZoom", "chartDataRangeSelected", "chartGraphRoam", "chartGeoRoam", "chartTreeRoam", "chartTimelineChanged", "chartTimelinePlayChanged", "chartRestore", "chartDataViewChanged", "chartMagicTypeChanged", "chartGeoSelectChanged", "chartGeoSelected", "chartGeoUnselected", "chartAxisAreaSelected", "chartBrush", "chartBrushEnd", "chartBrushSelected", "chartGlobalCursorTaken", "chartRendered", "chartFinished"], exportAs: ["echarts"] }] });
2652
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.19", type: EChartsHBarStackedComponent, isStandalone: true, selector: "vs-echarts-hbar-stacked", usesInheritance: true, ngImport: i0, template: "<div class=\"echarts-container\" echarts \n [options]=\"{}\"\n [initOpts]=\"initOptions\" \n [autoResize]=\"true\" \n (chartInit)=\"onChartInit($event)\" \n (chartClick)=\"onChartClick($event)\" \n (chartSelectChanged)=\"onChartSelectChanged($event)\"\n></div>\n", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: NgxEchartsDirective, selector: "echarts, [echarts]", inputs: ["options", "theme", "initOpts", "merge", "autoResize", "loading", "loadingType", "loadingOpts"], outputs: ["chartInit", "optionsError", "chartClick", "chartDblClick", "chartMouseDown", "chartMouseMove", "chartMouseUp", "chartMouseOver", "chartMouseOut", "chartGlobalOut", "chartContextMenu", "chartHighlight", "chartDownplay", "chartSelectChanged", "chartLegendSelectChanged", "chartLegendSelected", "chartLegendUnselected", "chartLegendLegendSelectAll", "chartLegendLegendInverseSelect", "chartLegendScroll", "chartDataZoom", "chartDataRangeSelected", "chartGraphRoam", "chartGeoRoam", "chartTreeRoam", "chartTimelineChanged", "chartTimelinePlayChanged", "chartRestore", "chartDataViewChanged", "chartMagicTypeChanged", "chartGeoSelectChanged", "chartGeoSelected", "chartGeoUnselected", "chartAxisAreaSelected", "chartBrush", "chartBrushEnd", "chartBrushSelected", "chartGlobalCursorTaken", "chartRendered", "chartFinished"], exportAs: ["echarts"] }] });
2346
2653
  }
2347
2654
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: EChartsHBarStackedComponent, decorators: [{
2348
2655
  type: Component,
2349
2656
  args: [{ selector: 'vs-echarts-hbar-stacked', standalone: true, imports: [
2350
2657
  CommonModule,
2351
2658
  NgxEchartsDirective,
2352
- ], providers: [provideVSEcharts()], template: "<div class=\"echarts-container\" echarts \n [options]=\"{}\"\n [initOpts]=\"initOptions\" \n [autoResize]=\"true\" \n (chartInit)=\"onChartInit($event)\" \n (chartClick)=\"onChartClick($event)\" \n (chartSelectChanged)=\"onChartSelectChanged($event)\"\n></div>\n", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"] }]
2659
+ ], template: "<div class=\"echarts-container\" echarts \n [options]=\"{}\"\n [initOpts]=\"initOptions\" \n [autoResize]=\"true\" \n (chartInit)=\"onChartInit($event)\" \n (chartClick)=\"onChartClick($event)\" \n (chartSelectChanged)=\"onChartSelectChanged($event)\"\n></div>\n", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"] }]
2353
2660
  }] });
2354
2661
 
2355
2662
  class EChartsBarStackedRadialComponent extends EchartsBarComponent {
@@ -2381,14 +2688,14 @@ class EChartsBarStackedRadialComponent extends EchartsBarComponent {
2381
2688
  this.director.makeBarRadial(this.data, this.optionsOverrides, makeOpts);
2382
2689
  }
2383
2690
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: EChartsBarStackedRadialComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
2384
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.19", type: EChartsBarStackedRadialComponent, isStandalone: true, selector: "vs-echarts-bar-stacked-radial", providers: [provideVSEcharts()], usesInheritance: true, ngImport: i0, template: "<div class=\"echarts-container\" echarts \n [options]=\"{}\"\n [initOpts]=\"initOptions\" \n [autoResize]=\"true\" \n (chartInit)=\"onChartInit($event)\" \n (chartClick)=\"onChartClick($event)\" \n (chartSelectChanged)=\"onChartSelectChanged($event)\"\n></div>\n", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: NgxEchartsDirective, selector: "echarts, [echarts]", inputs: ["options", "theme", "initOpts", "merge", "autoResize", "loading", "loadingType", "loadingOpts"], outputs: ["chartInit", "optionsError", "chartClick", "chartDblClick", "chartMouseDown", "chartMouseMove", "chartMouseUp", "chartMouseOver", "chartMouseOut", "chartGlobalOut", "chartContextMenu", "chartHighlight", "chartDownplay", "chartSelectChanged", "chartLegendSelectChanged", "chartLegendSelected", "chartLegendUnselected", "chartLegendLegendSelectAll", "chartLegendLegendInverseSelect", "chartLegendScroll", "chartDataZoom", "chartDataRangeSelected", "chartGraphRoam", "chartGeoRoam", "chartTreeRoam", "chartTimelineChanged", "chartTimelinePlayChanged", "chartRestore", "chartDataViewChanged", "chartMagicTypeChanged", "chartGeoSelectChanged", "chartGeoSelected", "chartGeoUnselected", "chartAxisAreaSelected", "chartBrush", "chartBrushEnd", "chartBrushSelected", "chartGlobalCursorTaken", "chartRendered", "chartFinished"], exportAs: ["echarts"] }] });
2691
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.19", type: EChartsBarStackedRadialComponent, isStandalone: true, selector: "vs-echarts-bar-stacked-radial", usesInheritance: true, ngImport: i0, template: "<div class=\"echarts-container\" echarts \n [options]=\"{}\"\n [initOpts]=\"initOptions\" \n [autoResize]=\"true\" \n (chartInit)=\"onChartInit($event)\" \n (chartClick)=\"onChartClick($event)\" \n (chartSelectChanged)=\"onChartSelectChanged($event)\"\n></div>\n", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: NgxEchartsDirective, selector: "echarts, [echarts]", inputs: ["options", "theme", "initOpts", "merge", "autoResize", "loading", "loadingType", "loadingOpts"], outputs: ["chartInit", "optionsError", "chartClick", "chartDblClick", "chartMouseDown", "chartMouseMove", "chartMouseUp", "chartMouseOver", "chartMouseOut", "chartGlobalOut", "chartContextMenu", "chartHighlight", "chartDownplay", "chartSelectChanged", "chartLegendSelectChanged", "chartLegendSelected", "chartLegendUnselected", "chartLegendLegendSelectAll", "chartLegendLegendInverseSelect", "chartLegendScroll", "chartDataZoom", "chartDataRangeSelected", "chartGraphRoam", "chartGeoRoam", "chartTreeRoam", "chartTimelineChanged", "chartTimelinePlayChanged", "chartRestore", "chartDataViewChanged", "chartMagicTypeChanged", "chartGeoSelectChanged", "chartGeoSelected", "chartGeoUnselected", "chartAxisAreaSelected", "chartBrush", "chartBrushEnd", "chartBrushSelected", "chartGlobalCursorTaken", "chartRendered", "chartFinished"], exportAs: ["echarts"] }] });
2385
2692
  }
2386
2693
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: EChartsBarStackedRadialComponent, decorators: [{
2387
2694
  type: Component,
2388
2695
  args: [{ selector: 'vs-echarts-bar-stacked-radial', standalone: true, imports: [
2389
2696
  CommonModule,
2390
2697
  NgxEchartsDirective,
2391
- ], providers: [provideVSEcharts()], template: "<div class=\"echarts-container\" echarts \n [options]=\"{}\"\n [initOpts]=\"initOptions\" \n [autoResize]=\"true\" \n (chartInit)=\"onChartInit($event)\" \n (chartClick)=\"onChartClick($event)\" \n (chartSelectChanged)=\"onChartSelectChanged($event)\"\n></div>\n", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"] }]
2698
+ ], template: "<div class=\"echarts-container\" echarts \n [options]=\"{}\"\n [initOpts]=\"initOptions\" \n [autoResize]=\"true\" \n (chartInit)=\"onChartInit($event)\" \n (chartClick)=\"onChartClick($event)\" \n (chartSelectChanged)=\"onChartSelectChanged($event)\"\n></div>\n", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"] }]
2392
2699
  }] });
2393
2700
 
2394
2701
  class EchartsLineComponent extends BaseEchartsComponent {
@@ -2450,17 +2757,13 @@ class EchartsLineComponent extends BaseEchartsComponent {
2450
2757
  this.director.makeLine(this.data, this.optionsOverrides, makeOpts);
2451
2758
  }
2452
2759
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: EchartsLineComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2453
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.19", type: EchartsLineComponent, isStandalone: true, selector: "vs-echarts-line", providers: [
2454
- provideVSEcharts(),
2455
- ], usesInheritance: true, ngImport: i0, template: "<div\n class=\"echarts-container\"\n echarts\n [options]=\"{}\"\n [initOpts]=\"initOptions\"\n [autoResize]=\"true\"\n (chartInit)=\"onChartInit($event)\"\n (chartClick)=\"onChartClick($event)\"\n (chartSelectChanged)=\"onChartSelectChanged($event)\"\n></div>", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: NgxEchartsDirective, selector: "echarts, [echarts]", inputs: ["options", "theme", "initOpts", "merge", "autoResize", "loading", "loadingType", "loadingOpts"], outputs: ["chartInit", "optionsError", "chartClick", "chartDblClick", "chartMouseDown", "chartMouseMove", "chartMouseUp", "chartMouseOver", "chartMouseOut", "chartGlobalOut", "chartContextMenu", "chartHighlight", "chartDownplay", "chartSelectChanged", "chartLegendSelectChanged", "chartLegendSelected", "chartLegendUnselected", "chartLegendLegendSelectAll", "chartLegendLegendInverseSelect", "chartLegendScroll", "chartDataZoom", "chartDataRangeSelected", "chartGraphRoam", "chartGeoRoam", "chartTreeRoam", "chartTimelineChanged", "chartTimelinePlayChanged", "chartRestore", "chartDataViewChanged", "chartMagicTypeChanged", "chartGeoSelectChanged", "chartGeoSelected", "chartGeoUnselected", "chartAxisAreaSelected", "chartBrush", "chartBrushEnd", "chartBrushSelected", "chartGlobalCursorTaken", "chartRendered", "chartFinished"], exportAs: ["echarts"] }] });
2760
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.19", type: EchartsLineComponent, isStandalone: true, selector: "vs-echarts-line", usesInheritance: true, ngImport: i0, template: "<div\n class=\"echarts-container\"\n echarts\n [options]=\"{}\"\n [initOpts]=\"initOptions\"\n [autoResize]=\"true\"\n (chartInit)=\"onChartInit($event)\"\n (chartClick)=\"onChartClick($event)\"\n (chartSelectChanged)=\"onChartSelectChanged($event)\"\n></div>", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: NgxEchartsDirective, selector: "echarts, [echarts]", inputs: ["options", "theme", "initOpts", "merge", "autoResize", "loading", "loadingType", "loadingOpts"], outputs: ["chartInit", "optionsError", "chartClick", "chartDblClick", "chartMouseDown", "chartMouseMove", "chartMouseUp", "chartMouseOver", "chartMouseOut", "chartGlobalOut", "chartContextMenu", "chartHighlight", "chartDownplay", "chartSelectChanged", "chartLegendSelectChanged", "chartLegendSelected", "chartLegendUnselected", "chartLegendLegendSelectAll", "chartLegendLegendInverseSelect", "chartLegendScroll", "chartDataZoom", "chartDataRangeSelected", "chartGraphRoam", "chartGeoRoam", "chartTreeRoam", "chartTimelineChanged", "chartTimelinePlayChanged", "chartRestore", "chartDataViewChanged", "chartMagicTypeChanged", "chartGeoSelectChanged", "chartGeoSelected", "chartGeoUnselected", "chartAxisAreaSelected", "chartBrush", "chartBrushEnd", "chartBrushSelected", "chartGlobalCursorTaken", "chartRendered", "chartFinished"], exportAs: ["echarts"] }] });
2456
2761
  }
2457
2762
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: EchartsLineComponent, decorators: [{
2458
2763
  type: Component,
2459
2764
  args: [{ selector: 'vs-echarts-line', standalone: true, imports: [
2460
2765
  CommonModule,
2461
2766
  NgxEchartsDirective,
2462
- ], providers: [
2463
- provideVSEcharts(),
2464
2767
  ], template: "<div\n class=\"echarts-container\"\n echarts\n [options]=\"{}\"\n [initOpts]=\"initOptions\"\n [autoResize]=\"true\"\n (chartInit)=\"onChartInit($event)\"\n (chartClick)=\"onChartClick($event)\"\n (chartSelectChanged)=\"onChartSelectChanged($event)\"\n></div>", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"] }]
2465
2768
  }], ctorParameters: () => [] });
2466
2769
 
@@ -2478,14 +2781,14 @@ class EChartsAreaComponent extends EchartsLineComponent {
2478
2781
  builder = new EChartBuilder(this.variantBaseProduct);
2479
2782
  director = new VSECDirector(this.builder);
2480
2783
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: EChartsAreaComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
2481
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.19", type: EChartsAreaComponent, isStandalone: true, selector: "vs-echarts-area", providers: [provideVSEcharts()], usesInheritance: true, ngImport: i0, template: "<div\n class=\"echarts-container\"\n echarts\n [options]=\"{}\"\n [initOpts]=\"initOptions\"\n [autoResize]=\"true\"\n (chartInit)=\"onChartInit($event)\"\n (chartClick)=\"onChartClick($event)\"\n (chartSelectChanged)=\"onChartSelectChanged($event)\"\n></div>", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: NgxEchartsDirective, selector: "echarts, [echarts]", inputs: ["options", "theme", "initOpts", "merge", "autoResize", "loading", "loadingType", "loadingOpts"], outputs: ["chartInit", "optionsError", "chartClick", "chartDblClick", "chartMouseDown", "chartMouseMove", "chartMouseUp", "chartMouseOver", "chartMouseOut", "chartGlobalOut", "chartContextMenu", "chartHighlight", "chartDownplay", "chartSelectChanged", "chartLegendSelectChanged", "chartLegendSelected", "chartLegendUnselected", "chartLegendLegendSelectAll", "chartLegendLegendInverseSelect", "chartLegendScroll", "chartDataZoom", "chartDataRangeSelected", "chartGraphRoam", "chartGeoRoam", "chartTreeRoam", "chartTimelineChanged", "chartTimelinePlayChanged", "chartRestore", "chartDataViewChanged", "chartMagicTypeChanged", "chartGeoSelectChanged", "chartGeoSelected", "chartGeoUnselected", "chartAxisAreaSelected", "chartBrush", "chartBrushEnd", "chartBrushSelected", "chartGlobalCursorTaken", "chartRendered", "chartFinished"], exportAs: ["echarts"] }] });
2784
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.19", type: EChartsAreaComponent, isStandalone: true, selector: "vs-echarts-area", usesInheritance: true, ngImport: i0, template: "<div\n class=\"echarts-container\"\n echarts\n [options]=\"{}\"\n [initOpts]=\"initOptions\"\n [autoResize]=\"true\"\n (chartInit)=\"onChartInit($event)\"\n (chartClick)=\"onChartClick($event)\"\n (chartSelectChanged)=\"onChartSelectChanged($event)\"\n></div>", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: NgxEchartsDirective, selector: "echarts, [echarts]", inputs: ["options", "theme", "initOpts", "merge", "autoResize", "loading", "loadingType", "loadingOpts"], outputs: ["chartInit", "optionsError", "chartClick", "chartDblClick", "chartMouseDown", "chartMouseMove", "chartMouseUp", "chartMouseOver", "chartMouseOut", "chartGlobalOut", "chartContextMenu", "chartHighlight", "chartDownplay", "chartSelectChanged", "chartLegendSelectChanged", "chartLegendSelected", "chartLegendUnselected", "chartLegendLegendSelectAll", "chartLegendLegendInverseSelect", "chartLegendScroll", "chartDataZoom", "chartDataRangeSelected", "chartGraphRoam", "chartGeoRoam", "chartTreeRoam", "chartTimelineChanged", "chartTimelinePlayChanged", "chartRestore", "chartDataViewChanged", "chartMagicTypeChanged", "chartGeoSelectChanged", "chartGeoSelected", "chartGeoUnselected", "chartAxisAreaSelected", "chartBrush", "chartBrushEnd", "chartBrushSelected", "chartGlobalCursorTaken", "chartRendered", "chartFinished"], exportAs: ["echarts"] }] });
2482
2785
  }
2483
2786
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: EChartsAreaComponent, decorators: [{
2484
2787
  type: Component,
2485
2788
  args: [{ selector: 'vs-echarts-area', standalone: true, imports: [
2486
2789
  CommonModule,
2487
2790
  NgxEchartsDirective,
2488
- ], providers: [provideVSEcharts()], template: "<div\n class=\"echarts-container\"\n echarts\n [options]=\"{}\"\n [initOpts]=\"initOptions\"\n [autoResize]=\"true\"\n (chartInit)=\"onChartInit($event)\"\n (chartClick)=\"onChartClick($event)\"\n (chartSelectChanged)=\"onChartSelectChanged($event)\"\n></div>", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"] }]
2791
+ ], template: "<div\n class=\"echarts-container\"\n echarts\n [options]=\"{}\"\n [initOpts]=\"initOptions\"\n [autoResize]=\"true\"\n (chartInit)=\"onChartInit($event)\"\n (chartClick)=\"onChartClick($event)\"\n (chartSelectChanged)=\"onChartSelectChanged($event)\"\n></div>", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"] }]
2489
2792
  }] });
2490
2793
 
2491
2794
  class EChartsAreaStackComponent extends EchartsLineComponent {
@@ -2503,14 +2806,14 @@ class EChartsAreaStackComponent extends EchartsLineComponent {
2503
2806
  builder = new EChartBuilder(this.variantBaseProduct);
2504
2807
  director = new VSECDirector(this.builder);
2505
2808
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: EChartsAreaStackComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
2506
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.19", type: EChartsAreaStackComponent, isStandalone: true, selector: "vs-echarts-area-stack", providers: [provideVSEcharts()], usesInheritance: true, ngImport: i0, template: "<div\n class=\"echarts-container\"\n echarts\n [options]=\"{}\"\n [initOpts]=\"initOptions\"\n [autoResize]=\"true\"\n (chartInit)=\"onChartInit($event)\"\n (chartClick)=\"onChartClick($event)\"\n (chartSelectChanged)=\"onChartSelectChanged($event)\"\n></div>", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: NgxEchartsDirective, selector: "echarts, [echarts]", inputs: ["options", "theme", "initOpts", "merge", "autoResize", "loading", "loadingType", "loadingOpts"], outputs: ["chartInit", "optionsError", "chartClick", "chartDblClick", "chartMouseDown", "chartMouseMove", "chartMouseUp", "chartMouseOver", "chartMouseOut", "chartGlobalOut", "chartContextMenu", "chartHighlight", "chartDownplay", "chartSelectChanged", "chartLegendSelectChanged", "chartLegendSelected", "chartLegendUnselected", "chartLegendLegendSelectAll", "chartLegendLegendInverseSelect", "chartLegendScroll", "chartDataZoom", "chartDataRangeSelected", "chartGraphRoam", "chartGeoRoam", "chartTreeRoam", "chartTimelineChanged", "chartTimelinePlayChanged", "chartRestore", "chartDataViewChanged", "chartMagicTypeChanged", "chartGeoSelectChanged", "chartGeoSelected", "chartGeoUnselected", "chartAxisAreaSelected", "chartBrush", "chartBrushEnd", "chartBrushSelected", "chartGlobalCursorTaken", "chartRendered", "chartFinished"], exportAs: ["echarts"] }] });
2809
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.19", type: EChartsAreaStackComponent, isStandalone: true, selector: "vs-echarts-area-stack", usesInheritance: true, ngImport: i0, template: "<div\n class=\"echarts-container\"\n echarts\n [options]=\"{}\"\n [initOpts]=\"initOptions\"\n [autoResize]=\"true\"\n (chartInit)=\"onChartInit($event)\"\n (chartClick)=\"onChartClick($event)\"\n (chartSelectChanged)=\"onChartSelectChanged($event)\"\n></div>", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: NgxEchartsDirective, selector: "echarts, [echarts]", inputs: ["options", "theme", "initOpts", "merge", "autoResize", "loading", "loadingType", "loadingOpts"], outputs: ["chartInit", "optionsError", "chartClick", "chartDblClick", "chartMouseDown", "chartMouseMove", "chartMouseUp", "chartMouseOver", "chartMouseOut", "chartGlobalOut", "chartContextMenu", "chartHighlight", "chartDownplay", "chartSelectChanged", "chartLegendSelectChanged", "chartLegendSelected", "chartLegendUnselected", "chartLegendLegendSelectAll", "chartLegendLegendInverseSelect", "chartLegendScroll", "chartDataZoom", "chartDataRangeSelected", "chartGraphRoam", "chartGeoRoam", "chartTreeRoam", "chartTimelineChanged", "chartTimelinePlayChanged", "chartRestore", "chartDataViewChanged", "chartMagicTypeChanged", "chartGeoSelectChanged", "chartGeoSelected", "chartGeoUnselected", "chartAxisAreaSelected", "chartBrush", "chartBrushEnd", "chartBrushSelected", "chartGlobalCursorTaken", "chartRendered", "chartFinished"], exportAs: ["echarts"] }] });
2507
2810
  }
2508
2811
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: EChartsAreaStackComponent, decorators: [{
2509
2812
  type: Component,
2510
2813
  args: [{ selector: 'vs-echarts-area-stack', standalone: true, imports: [
2511
2814
  CommonModule,
2512
2815
  NgxEchartsDirective,
2513
- ], providers: [provideVSEcharts()], template: "<div\n class=\"echarts-container\"\n echarts\n [options]=\"{}\"\n [initOpts]=\"initOptions\"\n [autoResize]=\"true\"\n (chartInit)=\"onChartInit($event)\"\n (chartClick)=\"onChartClick($event)\"\n (chartSelectChanged)=\"onChartSelectChanged($event)\"\n></div>", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"] }]
2816
+ ], template: "<div\n class=\"echarts-container\"\n echarts\n [options]=\"{}\"\n [initOpts]=\"initOptions\"\n [autoResize]=\"true\"\n (chartInit)=\"onChartInit($event)\"\n (chartClick)=\"onChartClick($event)\"\n (chartSelectChanged)=\"onChartSelectChanged($event)\"\n></div>", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"] }]
2514
2817
  }] });
2515
2818
 
2516
2819
  class EchartsScatterComponent extends BaseEchartsComponent {
@@ -2570,110 +2873,16 @@ class EchartsScatterComponent extends BaseEchartsComponent {
2570
2873
  this.director.makeScatter(this.data, this.optionsOverrides, makeOpts);
2571
2874
  }
2572
2875
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: EchartsScatterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2573
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.19", type: EchartsScatterComponent, isStandalone: true, selector: "vs-echarts-scatter", providers: [provideVSEcharts()], usesInheritance: true, ngImport: i0, template: "<div class=\"echarts-container\" echarts \n [options]=\"{}\"\n [initOpts]=\"initOptions\" \n [autoResize]=\"true\" \n (chartInit)=\"onChartInit($event)\" \n (chartClick)=\"onChartClick($event)\" \n (chartSelectChanged)=\"onChartSelectChanged($event)\"\n></div>\n", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: NgxEchartsDirective, selector: "echarts, [echarts]", inputs: ["options", "theme", "initOpts", "merge", "autoResize", "loading", "loadingType", "loadingOpts"], outputs: ["chartInit", "optionsError", "chartClick", "chartDblClick", "chartMouseDown", "chartMouseMove", "chartMouseUp", "chartMouseOver", "chartMouseOut", "chartGlobalOut", "chartContextMenu", "chartHighlight", "chartDownplay", "chartSelectChanged", "chartLegendSelectChanged", "chartLegendSelected", "chartLegendUnselected", "chartLegendLegendSelectAll", "chartLegendLegendInverseSelect", "chartLegendScroll", "chartDataZoom", "chartDataRangeSelected", "chartGraphRoam", "chartGeoRoam", "chartTreeRoam", "chartTimelineChanged", "chartTimelinePlayChanged", "chartRestore", "chartDataViewChanged", "chartMagicTypeChanged", "chartGeoSelectChanged", "chartGeoSelected", "chartGeoUnselected", "chartAxisAreaSelected", "chartBrush", "chartBrushEnd", "chartBrushSelected", "chartGlobalCursorTaken", "chartRendered", "chartFinished"], exportAs: ["echarts"] }] });
2876
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.19", type: EchartsScatterComponent, isStandalone: true, selector: "vs-echarts-scatter", usesInheritance: true, ngImport: i0, template: "<div class=\"echarts-container\" echarts \n [options]=\"{}\"\n [initOpts]=\"initOptions\" \n [autoResize]=\"true\" \n (chartInit)=\"onChartInit($event)\" \n (chartClick)=\"onChartClick($event)\" \n (chartSelectChanged)=\"onChartSelectChanged($event)\"\n></div>\n", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: NgxEchartsDirective, selector: "echarts, [echarts]", inputs: ["options", "theme", "initOpts", "merge", "autoResize", "loading", "loadingType", "loadingOpts"], outputs: ["chartInit", "optionsError", "chartClick", "chartDblClick", "chartMouseDown", "chartMouseMove", "chartMouseUp", "chartMouseOver", "chartMouseOut", "chartGlobalOut", "chartContextMenu", "chartHighlight", "chartDownplay", "chartSelectChanged", "chartLegendSelectChanged", "chartLegendSelected", "chartLegendUnselected", "chartLegendLegendSelectAll", "chartLegendLegendInverseSelect", "chartLegendScroll", "chartDataZoom", "chartDataRangeSelected", "chartGraphRoam", "chartGeoRoam", "chartTreeRoam", "chartTimelineChanged", "chartTimelinePlayChanged", "chartRestore", "chartDataViewChanged", "chartMagicTypeChanged", "chartGeoSelectChanged", "chartGeoSelected", "chartGeoUnselected", "chartAxisAreaSelected", "chartBrush", "chartBrushEnd", "chartBrushSelected", "chartGlobalCursorTaken", "chartRendered", "chartFinished"], exportAs: ["echarts"] }] });
2574
2877
  }
2575
2878
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: EchartsScatterComponent, decorators: [{
2576
2879
  type: Component,
2577
2880
  args: [{ selector: 'vs-echarts-scatter', standalone: true, imports: [
2578
2881
  CommonModule,
2579
2882
  NgxEchartsDirective,
2580
- ], providers: [provideVSEcharts()], template: "<div class=\"echarts-container\" echarts \n [options]=\"{}\"\n [initOpts]=\"initOptions\" \n [autoResize]=\"true\" \n (chartInit)=\"onChartInit($event)\" \n (chartClick)=\"onChartClick($event)\" \n (chartSelectChanged)=\"onChartSelectChanged($event)\"\n></div>\n", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"] }]
2883
+ ], template: "<div class=\"echarts-container\" echarts \n [options]=\"{}\"\n [initOpts]=\"initOptions\" \n [autoResize]=\"true\" \n (chartInit)=\"onChartInit($event)\" \n (chartClick)=\"onChartClick($event)\" \n (chartSelectChanged)=\"onChartSelectChanged($event)\"\n></div>\n", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"] }]
2581
2884
  }], ctorParameters: () => [] });
2582
2885
 
2583
- class SunburstBuilder {
2584
- baseProduct;
2585
- valueFormatter = (value) => value.toLocaleString();
2586
- palette = [];
2587
- // TODO: Hay que implementar un valor por defecto.
2588
- colorResolver;
2589
- result = {};
2590
- constructor(baseProduct) {
2591
- this.baseProduct = baseProduct;
2592
- }
2593
- reset() {
2594
- this.result = {};
2595
- }
2596
- addSeries(data, overrides) {
2597
- if (!data || !data.source || data.source.length === 0) {
2598
- return;
2599
- }
2600
- const sunburstData = mapHierarchicalData(data.source, data.dimensions);
2601
- const depth = getTreeDepth(sunburstData);
2602
- const levels = [];
2603
- for (let i = 0; i <= depth; i++) {
2604
- levels.push({
2605
- label: {
2606
- show: false,
2607
- },
2608
- });
2609
- }
2610
- const dynamiSerieOptions = {
2611
- name: '',
2612
- data: sunburstData,
2613
- levels: levels
2614
- };
2615
- const serie = merge$1({}, dynamiSerieOptions, overrides);
2616
- if (this.colorResolver) {
2617
- if (!serie.itemStyle) {
2618
- serie.itemStyle = {};
2619
- }
2620
- serie.itemStyle.color = this.colorResolver;
2621
- }
2622
- this.result.series = serie;
2623
- }
2624
- addTooltip(data, overrides) {
2625
- merge$1(overrides, {
2626
- formatter: getTooltipFormatter(overrides.trigger || 'item', data, this.valueFormatter),
2627
- });
2628
- const tooltip = getTooltipOptions(overrides);
2629
- this.result.tooltip = tooltip;
2630
- }
2631
- addCommons() {
2632
- const opts = {
2633
- palette: this.palette,
2634
- };
2635
- merge$1(this.result, getCommons(opts));
2636
- }
2637
- addGraphic() { }
2638
- getResult() {
2639
- return this.result;
2640
- }
2641
- ;
2642
- addPolar() { }
2643
- addXAxis(data, overrides, type) { }
2644
- addYAxis(data, overrides, type) { }
2645
- addRadiusAxis(data, overrides) { }
2646
- addAngleAxis(data, overrides) { }
2647
- addLegend() { }
2648
- addDataZoom() { }
2649
- addDataset(data, opts) { }
2650
- // Setters
2651
- /**
2652
- * Permite inyectar un formateador de valores externo.
2653
- */
2654
- setValueFormatter(formatter) {
2655
- if (formatter) {
2656
- this.valueFormatter = formatter;
2657
- }
2658
- }
2659
- /**
2660
- * Permite inyectar una paleta de colores básica.
2661
- */
2662
- setPalette(palette) {
2663
- if (palette) {
2664
- this.palette = palette;
2665
- }
2666
- }
2667
- /**
2668
- * Permite inyectar un resolver de colores dinámico.
2669
- */
2670
- setColorResolver(resolver) {
2671
- if (resolver) {
2672
- this.colorResolver = resolver;
2673
- }
2674
- }
2675
- }
2676
-
2677
2886
  class EChartsSunburstComponent extends BaseEchartsComponent {
2678
2887
  baseSeriesOptions = {
2679
2888
  type: 'sunburst',
@@ -2712,168 +2921,16 @@ class EChartsSunburstComponent extends BaseEchartsComponent {
2712
2921
  this.director.makeSunburst(this.data, this.optionsOverrides, makeOpts);
2713
2922
  }
2714
2923
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: EChartsSunburstComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
2715
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.19", type: EChartsSunburstComponent, isStandalone: true, selector: "vs-echarts-sunburst", providers: [provideVSEcharts()], usesInheritance: true, ngImport: i0, template: "<div\n class=\"echarts-container\"\n echarts\n [options]=\"{}\"\n [initOpts]=\"initOptions\"\n [autoResize]=\"true\"\n (chartInit)=\"onChartInit($event)\"\n></div>", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: NgxEchartsDirective, selector: "echarts, [echarts]", inputs: ["options", "theme", "initOpts", "merge", "autoResize", "loading", "loadingType", "loadingOpts"], outputs: ["chartInit", "optionsError", "chartClick", "chartDblClick", "chartMouseDown", "chartMouseMove", "chartMouseUp", "chartMouseOver", "chartMouseOut", "chartGlobalOut", "chartContextMenu", "chartHighlight", "chartDownplay", "chartSelectChanged", "chartLegendSelectChanged", "chartLegendSelected", "chartLegendUnselected", "chartLegendLegendSelectAll", "chartLegendLegendInverseSelect", "chartLegendScroll", "chartDataZoom", "chartDataRangeSelected", "chartGraphRoam", "chartGeoRoam", "chartTreeRoam", "chartTimelineChanged", "chartTimelinePlayChanged", "chartRestore", "chartDataViewChanged", "chartMagicTypeChanged", "chartGeoSelectChanged", "chartGeoSelected", "chartGeoUnselected", "chartAxisAreaSelected", "chartBrush", "chartBrushEnd", "chartBrushSelected", "chartGlobalCursorTaken", "chartRendered", "chartFinished"], exportAs: ["echarts"] }] });
2924
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.19", type: EChartsSunburstComponent, isStandalone: true, selector: "vs-echarts-sunburst", usesInheritance: true, ngImport: i0, template: "<div\n class=\"echarts-container\"\n echarts\n [options]=\"{}\"\n [initOpts]=\"initOptions\"\n [autoResize]=\"true\"\n (chartInit)=\"onChartInit($event)\"\n></div>", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: NgxEchartsDirective, selector: "echarts, [echarts]", inputs: ["options", "theme", "initOpts", "merge", "autoResize", "loading", "loadingType", "loadingOpts"], outputs: ["chartInit", "optionsError", "chartClick", "chartDblClick", "chartMouseDown", "chartMouseMove", "chartMouseUp", "chartMouseOver", "chartMouseOut", "chartGlobalOut", "chartContextMenu", "chartHighlight", "chartDownplay", "chartSelectChanged", "chartLegendSelectChanged", "chartLegendSelected", "chartLegendUnselected", "chartLegendLegendSelectAll", "chartLegendLegendInverseSelect", "chartLegendScroll", "chartDataZoom", "chartDataRangeSelected", "chartGraphRoam", "chartGeoRoam", "chartTreeRoam", "chartTimelineChanged", "chartTimelinePlayChanged", "chartRestore", "chartDataViewChanged", "chartMagicTypeChanged", "chartGeoSelectChanged", "chartGeoSelected", "chartGeoUnselected", "chartAxisAreaSelected", "chartBrush", "chartBrushEnd", "chartBrushSelected", "chartGlobalCursorTaken", "chartRendered", "chartFinished"], exportAs: ["echarts"] }] });
2716
2925
  }
2717
2926
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: EChartsSunburstComponent, decorators: [{
2718
2927
  type: Component,
2719
2928
  args: [{ selector: 'vs-echarts-sunburst', standalone: true, imports: [
2720
2929
  CommonModule,
2721
2930
  NgxEchartsDirective,
2722
- ], providers: [provideVSEcharts()], template: "<div\n class=\"echarts-container\"\n echarts\n [options]=\"{}\"\n [initOpts]=\"initOptions\"\n [autoResize]=\"true\"\n (chartInit)=\"onChartInit($event)\"\n></div>", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"] }]
2931
+ ], template: "<div\n class=\"echarts-container\"\n echarts\n [options]=\"{}\"\n [initOpts]=\"initOptions\"\n [autoResize]=\"true\"\n (chartInit)=\"onChartInit($event)\"\n></div>", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"] }]
2723
2932
  }] });
2724
2933
 
2725
- /**
2726
- * SankeyBuilder
2727
- *
2728
- * Builder concreto para el gráfico Sankey (diagrama de flujos de izquierda a derecha).
2729
- */
2730
- class SankeyBuilder {
2731
- baseProduct;
2732
- valueFormatter = (value) => value.toLocaleString();
2733
- palette = [];
2734
- colorResolver;
2735
- result = {};
2736
- constructor(baseProduct) {
2737
- this.baseProduct = baseProduct;
2738
- }
2739
- reset() {
2740
- this.result = {};
2741
- }
2742
- addSeries(data, overrides) {
2743
- if (!data || !data.source || data.source.length === 0) {
2744
- return;
2745
- }
2746
- // Identificar medidas (todas las dimensiones excepto 'category')
2747
- const measureKeys = data.dimensions
2748
- .filter((d) => d.name !== "category")
2749
- .map((d) => d.name);
2750
- // Función auxiliar para sumarizar valores de medidas en caso de haber más de una
2751
- const getNodeValue = (node) => {
2752
- return measureKeys.reduce((sum, key) => sum + (Number(node[key]) || 0), 0);
2753
- };
2754
- const nodesMap = new Map();
2755
- const linksMap = new Map();
2756
- // Función recursiva para aplanar datos jerárquicos a nodos y enlaces
2757
- const traverse = (nodeList, level, parentId) => {
2758
- for (const node of nodeList) {
2759
- const category = node.category;
2760
- const currentId = `${category}___${level}`;
2761
- const value = getNodeValue(node);
2762
- nodesMap.set(currentId, (nodesMap.get(currentId) || 0) + value);
2763
- if (parentId) {
2764
- const linkKey = `${parentId}--->${currentId}`;
2765
- if (linksMap.has(linkKey)) {
2766
- linksMap.get(linkKey).value += value;
2767
- }
2768
- else {
2769
- linksMap.set(linkKey, {
2770
- source: parentId,
2771
- target: currentId,
2772
- value: value,
2773
- });
2774
- }
2775
- }
2776
- if (node.children && node.children.length > 0) {
2777
- traverse(node.children, level + 1, currentId);
2778
- }
2779
- }
2780
- };
2781
- // Comenzar el recorrido en el nivel 0
2782
- traverse(data.source, 0);
2783
- // al menos un nivel de links para dibujar.
2784
- if (linksMap.size === 0)
2785
- return;
2786
- // Mapear nodos acumulados a la estructura requerida por ECharts (name y opcionalmente color, sin value redundante)
2787
- const nodes = Array.from(nodesMap.keys()).map((currentId) => {
2788
- const category = currentId.split("___")[0];
2789
- const nodeItem = {
2790
- name: currentId,
2791
- };
2792
- if (this.colorResolver) {
2793
- const color = this.colorResolver({ name: category, data: nodeItem });
2794
- if (color) {
2795
- nodeItem.itemStyle = { color };
2796
- }
2797
- }
2798
- return nodeItem;
2799
- });
2800
- const dynamicSerieOptions = {
2801
- type: "sankey",
2802
- orient: "horizontal", // De izquierda a derecha
2803
- draggable: true,
2804
- emphasis: {
2805
- focus: "adjacency",
2806
- },
2807
- lineStyle: {
2808
- color: "source",
2809
- opacity: 0.25,
2810
- curveness: 0.5,
2811
- },
2812
- label: {
2813
- show: true,
2814
- position: "right",
2815
- fontFamily: "'Inter', 'Roboto', 'Open Sans', sans-serif",
2816
- fontSize: 10,
2817
- formatter: (params) => {
2818
- // Remover el sufijo de nivel de la etiqueta visual
2819
- return params.name.split("___")[0];
2820
- },
2821
- },
2822
- roam: true,
2823
- data: nodes,
2824
- links: Array.from(linksMap.values()),
2825
- };
2826
- const serie = merge$1({}, dynamicSerieOptions, overrides);
2827
- if (this.colorResolver && !serie.itemStyle) {
2828
- serie.itemStyle = {};
2829
- }
2830
- if (this.colorResolver && serie.itemStyle) {
2831
- serie.itemStyle.color = this.colorResolver;
2832
- }
2833
- this.result.series = serie;
2834
- }
2835
- addTooltip(data, overrides) {
2836
- merge$1(overrides, {
2837
- formatter: getTooltipFormatter(overrides.trigger || 'item', data, this.valueFormatter),
2838
- });
2839
- const tooltip = getTooltipOptions(overrides);
2840
- this.result.tooltip = tooltip;
2841
- }
2842
- addPolar() { }
2843
- addXAxis(data, overrides, type) { }
2844
- addYAxis(data, overrides, type) { }
2845
- addRadiusAxis(data, overrides) { }
2846
- addAngleAxis(data, overrides) { }
2847
- addLegend() { }
2848
- addDataZoom() { }
2849
- addDataset(data, opts) { }
2850
- addCommons() {
2851
- const opts = {
2852
- palette: this.palette,
2853
- };
2854
- merge$1(this.result, getCommons(opts));
2855
- }
2856
- addGraphic() { }
2857
- getResult() {
2858
- return this.result;
2859
- }
2860
- setValueFormatter(formatter) {
2861
- if (formatter) {
2862
- this.valueFormatter = formatter;
2863
- }
2864
- }
2865
- setPalette(palette) {
2866
- if (palette) {
2867
- this.palette = palette;
2868
- }
2869
- }
2870
- setColorResolver(resolver) {
2871
- if (resolver) {
2872
- this.colorResolver = resolver;
2873
- }
2874
- }
2875
- }
2876
-
2877
2934
  class EchartsSankeyComponent extends BaseEchartsComponent {
2878
2935
  baseSeriesOptions = {
2879
2936
  type: 'sankey',
@@ -2911,14 +2968,14 @@ class EchartsSankeyComponent extends BaseEchartsComponent {
2911
2968
  this.director.makeSankey(this.data, this.optionsOverrides, makeOpts);
2912
2969
  }
2913
2970
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: EchartsSankeyComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
2914
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.19", type: EchartsSankeyComponent, isStandalone: true, selector: "vs-echarts-sankey", providers: [provideVSEcharts()], usesInheritance: true, ngImport: i0, template: "<div\n class=\"echarts-container\"\n echarts\n [options]=\"{}\"\n [initOpts]=\"initOptions\"\n [autoResize]=\"true\"\n (chartInit)=\"onChartInit($event)\"\n (chartClick)=\"onChartClick($event)\"\n></div>\n", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: NgxEchartsDirective, selector: "echarts, [echarts]", inputs: ["options", "theme", "initOpts", "merge", "autoResize", "loading", "loadingType", "loadingOpts"], outputs: ["chartInit", "optionsError", "chartClick", "chartDblClick", "chartMouseDown", "chartMouseMove", "chartMouseUp", "chartMouseOver", "chartMouseOut", "chartGlobalOut", "chartContextMenu", "chartHighlight", "chartDownplay", "chartSelectChanged", "chartLegendSelectChanged", "chartLegendSelected", "chartLegendUnselected", "chartLegendLegendSelectAll", "chartLegendLegendInverseSelect", "chartLegendScroll", "chartDataZoom", "chartDataRangeSelected", "chartGraphRoam", "chartGeoRoam", "chartTreeRoam", "chartTimelineChanged", "chartTimelinePlayChanged", "chartRestore", "chartDataViewChanged", "chartMagicTypeChanged", "chartGeoSelectChanged", "chartGeoSelected", "chartGeoUnselected", "chartAxisAreaSelected", "chartBrush", "chartBrushEnd", "chartBrushSelected", "chartGlobalCursorTaken", "chartRendered", "chartFinished"], exportAs: ["echarts"] }] });
2971
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.19", type: EchartsSankeyComponent, isStandalone: true, selector: "vs-echarts-sankey", usesInheritance: true, ngImport: i0, template: "<div\n class=\"echarts-container\"\n echarts\n [options]=\"{}\"\n [initOpts]=\"initOptions\"\n [autoResize]=\"true\"\n (chartInit)=\"onChartInit($event)\"\n (chartClick)=\"onChartClick($event)\"\n></div>\n", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: NgxEchartsDirective, selector: "echarts, [echarts]", inputs: ["options", "theme", "initOpts", "merge", "autoResize", "loading", "loadingType", "loadingOpts"], outputs: ["chartInit", "optionsError", "chartClick", "chartDblClick", "chartMouseDown", "chartMouseMove", "chartMouseUp", "chartMouseOver", "chartMouseOut", "chartGlobalOut", "chartContextMenu", "chartHighlight", "chartDownplay", "chartSelectChanged", "chartLegendSelectChanged", "chartLegendSelected", "chartLegendUnselected", "chartLegendLegendSelectAll", "chartLegendLegendInverseSelect", "chartLegendScroll", "chartDataZoom", "chartDataRangeSelected", "chartGraphRoam", "chartGeoRoam", "chartTreeRoam", "chartTimelineChanged", "chartTimelinePlayChanged", "chartRestore", "chartDataViewChanged", "chartMagicTypeChanged", "chartGeoSelectChanged", "chartGeoSelected", "chartGeoUnselected", "chartAxisAreaSelected", "chartBrush", "chartBrushEnd", "chartBrushSelected", "chartGlobalCursorTaken", "chartRendered", "chartFinished"], exportAs: ["echarts"] }] });
2915
2972
  }
2916
2973
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: EchartsSankeyComponent, decorators: [{
2917
2974
  type: Component,
2918
2975
  args: [{ selector: 'vs-echarts-sankey', standalone: true, imports: [
2919
2976
  CommonModule,
2920
2977
  NgxEchartsDirective,
2921
- ], providers: [provideVSEcharts()], template: "<div\n class=\"echarts-container\"\n echarts\n [options]=\"{}\"\n [initOpts]=\"initOptions\"\n [autoResize]=\"true\"\n (chartInit)=\"onChartInit($event)\"\n (chartClick)=\"onChartClick($event)\"\n></div>\n", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"] }]
2978
+ ], template: "<div\n class=\"echarts-container\"\n echarts\n [options]=\"{}\"\n [initOpts]=\"initOptions\"\n [autoResize]=\"true\"\n (chartInit)=\"onChartInit($event)\"\n (chartClick)=\"onChartClick($event)\"\n></div>\n", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"] }]
2922
2979
  }] });
2923
2980
 
2924
2981
  class EChartsHBoxplotComponent extends BaseEchartsComponent {
@@ -2949,14 +3006,14 @@ class EChartsHBoxplotComponent extends BaseEchartsComponent {
2949
3006
  this.director.makeBoxplot(this.data, this.optionsOverrides, makeOpts);
2950
3007
  }
2951
3008
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: EChartsHBoxplotComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
2952
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.19", type: EChartsHBoxplotComponent, isStandalone: true, selector: "vs-echarts-hboxplot", providers: [provideVSEcharts()], usesInheritance: true, ngImport: i0, template: "<div\n class=\"echarts-container\"\n echarts\n [options]=\"{}\"\n [initOpts]=\"initOptions\"\n [autoResize]=\"true\"\n (chartInit)=\"onChartInit($event)\"\n></div>\n", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: NgxEchartsDirective, selector: "echarts, [echarts]", inputs: ["options", "theme", "initOpts", "merge", "autoResize", "loading", "loadingType", "loadingOpts"], outputs: ["chartInit", "optionsError", "chartClick", "chartDblClick", "chartMouseDown", "chartMouseMove", "chartMouseUp", "chartMouseOver", "chartMouseOut", "chartGlobalOut", "chartContextMenu", "chartHighlight", "chartDownplay", "chartSelectChanged", "chartLegendSelectChanged", "chartLegendSelected", "chartLegendUnselected", "chartLegendLegendSelectAll", "chartLegendLegendInverseSelect", "chartLegendScroll", "chartDataZoom", "chartDataRangeSelected", "chartGraphRoam", "chartGeoRoam", "chartTreeRoam", "chartTimelineChanged", "chartTimelinePlayChanged", "chartRestore", "chartDataViewChanged", "chartMagicTypeChanged", "chartGeoSelectChanged", "chartGeoSelected", "chartGeoUnselected", "chartAxisAreaSelected", "chartBrush", "chartBrushEnd", "chartBrushSelected", "chartGlobalCursorTaken", "chartRendered", "chartFinished"], exportAs: ["echarts"] }] });
3009
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.19", type: EChartsHBoxplotComponent, isStandalone: true, selector: "vs-echarts-hboxplot", usesInheritance: true, ngImport: i0, template: "<div\n class=\"echarts-container\"\n echarts\n [options]=\"{}\"\n [initOpts]=\"initOptions\"\n [autoResize]=\"true\"\n (chartInit)=\"onChartInit($event)\"\n></div>\n", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: NgxEchartsDirective, selector: "echarts, [echarts]", inputs: ["options", "theme", "initOpts", "merge", "autoResize", "loading", "loadingType", "loadingOpts"], outputs: ["chartInit", "optionsError", "chartClick", "chartDblClick", "chartMouseDown", "chartMouseMove", "chartMouseUp", "chartMouseOver", "chartMouseOut", "chartGlobalOut", "chartContextMenu", "chartHighlight", "chartDownplay", "chartSelectChanged", "chartLegendSelectChanged", "chartLegendSelected", "chartLegendUnselected", "chartLegendLegendSelectAll", "chartLegendLegendInverseSelect", "chartLegendScroll", "chartDataZoom", "chartDataRangeSelected", "chartGraphRoam", "chartGeoRoam", "chartTreeRoam", "chartTimelineChanged", "chartTimelinePlayChanged", "chartRestore", "chartDataViewChanged", "chartMagicTypeChanged", "chartGeoSelectChanged", "chartGeoSelected", "chartGeoUnselected", "chartAxisAreaSelected", "chartBrush", "chartBrushEnd", "chartBrushSelected", "chartGlobalCursorTaken", "chartRendered", "chartFinished"], exportAs: ["echarts"] }] });
2953
3010
  }
2954
3011
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: EChartsHBoxplotComponent, decorators: [{
2955
3012
  type: Component,
2956
3013
  args: [{ selector: 'vs-echarts-hboxplot', imports: [
2957
3014
  CommonModule,
2958
3015
  NgxEchartsDirective,
2959
- ], providers: [provideVSEcharts()], template: "<div\n class=\"echarts-container\"\n echarts\n [options]=\"{}\"\n [initOpts]=\"initOptions\"\n [autoResize]=\"true\"\n (chartInit)=\"onChartInit($event)\"\n></div>\n", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"] }]
3016
+ ], template: "<div\n class=\"echarts-container\"\n echarts\n [options]=\"{}\"\n [initOpts]=\"initOptions\"\n [autoResize]=\"true\"\n (chartInit)=\"onChartInit($event)\"\n></div>\n", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"] }]
2960
3017
  }] });
2961
3018
 
2962
3019
  // Interfaces de Inputs de Base EChart Component //
@@ -2973,5 +3030,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImpo
2973
3030
  * Generated bundle index. Do not edit.
2974
3031
  */
2975
3032
 
2976
- export { BaseEchartsComponent, EChartsAreaComponent, EChartsAreaStackComponent, EChartsBarStackedComponent, EChartsBarStackedRadialComponent, EChartsHBarComponent, EChartsHBarStackedComponent, EChartsHBoxplotComponent, EChartsSunburstComponent, EchartsBarComponent, EchartsFunnelComponent, EchartsLineComponent, EchartsPieComponent, EchartsRingComponent, EchartsSankeyComponent, EchartsScatterComponent, VSEchartsConfigService, defaultOptionsOverrides };
3033
+ export { BaseEchartsComponent, EChartsAreaComponent, EChartsAreaStackComponent, EChartsBarStackedComponent, EChartsBarStackedRadialComponent, EChartsHBarComponent, EChartsHBarStackedComponent, EChartsHBoxplotComponent, EChartsSunburstComponent, EchartsBarComponent, EchartsFunnelComponent, EchartsLineComponent, EchartsPieComponent, EchartsRingComponent, EchartsSankeyComponent, EchartsScatterComponent, VSEchartsConfigService, defaultOptionsOverrides, provideVSEcharts };
2977
3034
  //# sourceMappingURL=visionaris-bruno-vs-echarts.mjs.map