@vixoniccom/kpi-chart 0.0.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/README.md +53 -0
- package/build.zip +0 -0
- package/configuration/chartGroup/index.ts +135 -0
- package/configuration/generalGroup/index.ts +55 -0
- package/configuration/index.ts +12 -0
- package/configuration/styleGroup/index.ts +49 -0
- package/configuration/utils.ts +12 -0
- package/configuration.json +299 -0
- package/icon.png +0 -0
- package/package.json +37 -0
- package/src/components/App.tsx +182 -0
- package/src/components/ChartContainer/index.tsx +171 -0
- package/src/components/ChartLegend/index.tsx +66 -0
- package/src/components/FontLoader/index.tsx +47 -0
- package/src/components/FormattedText/index.tsx +88 -0
- package/src/components/utils.ts +238 -0
- package/src/global.d.ts +9 -0
- package/src/index.html +13 -0
- package/src/main.ts +37 -0
- package/src/parameters.d.ts +9 -0
- package/src/style.css +63 -0
- package/src/test/downloads/background.jpg +0 -0
- package/src/test/downloads/monserrat.ttf +0 -0
- package/src/test/parameters.json +47 -0
- package/tsconfig.json +27 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
|
+
|
|
5
|
+
### 0.0.1-beta.1 (2025-02-20)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **config:** prior config and functions added ([ea14546](https://github.com/Vixonic/store-sheets-kpi/commit/ea14546e56da053bf9412addbee7e5336d4ef58a))
|
|
11
|
+
* stacked bar graph & config changes ([e5af4c9](https://github.com/Vixonic/store-sheets-kpi/commit/e5af4c967cb8ab0f50c1494f2cbf65bb0514ac32))
|
|
12
|
+
|
|
13
|
+
### 0.0.1-beta.0 (2025-02-13)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Features
|
|
17
|
+
|
|
18
|
+
* **config:** prior config and functions added ([ea14546](https://bitbucket.org/vixonic_dev/sheets-kpi/commit/ea14546e56da053bf9412addbee7e5336d4ef58a))
|
package/README.md
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# KPI Charts
|
|
2
|
+
|
|
3
|
+
App para mostrar gráficos según indicadores KPI ingresados.
|
|
4
|
+
|
|
5
|
+
## Correr app
|
|
6
|
+
|
|
7
|
+
Para correr la app, seguir los siguientes pasos:
|
|
8
|
+
|
|
9
|
+
```shell
|
|
10
|
+
# Abrir terminal en bash
|
|
11
|
+
|
|
12
|
+
# Asegurarse que Git está instalado
|
|
13
|
+
# Visitar https://git-scm.com para descargar e instalar la consola Git si no está instalada
|
|
14
|
+
|
|
15
|
+
# Clonar repositorio
|
|
16
|
+
git clone git@bitbucket.org:vixonic_dev/sheets-kpi.git
|
|
17
|
+
|
|
18
|
+
# Navegar a la carpeta del proyecto
|
|
19
|
+
cd sheets-kpi
|
|
20
|
+
|
|
21
|
+
# Usar node version 14.0.0
|
|
22
|
+
nvm use 14.0.0
|
|
23
|
+
# Para verificar si esa versión está instalada, ejecutar:
|
|
24
|
+
nvm list
|
|
25
|
+
# Si no, instalar y usarla:
|
|
26
|
+
nvm install v14.0.0 && nvm use 14.0.0
|
|
27
|
+
|
|
28
|
+
# Instalar las dependencias
|
|
29
|
+
npm install
|
|
30
|
+
|
|
31
|
+
# Correr la app
|
|
32
|
+
npm run run
|
|
33
|
+
# o correr en modo debug (con hot-reload)
|
|
34
|
+
npm run watch
|
|
35
|
+
|
|
36
|
+
# Para hacer cambios en la configuración, cambiar el código en index.ts ubicado en la carpeta configuración, luego ejecutar:
|
|
37
|
+
npm run configuration
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Changelog
|
|
41
|
+
|
|
42
|
+
### [0.0.0]
|
|
43
|
+
|
|
44
|
+
#### Features
|
|
45
|
+
|
|
46
|
+
- Prior config added.
|
|
47
|
+
|
|
48
|
+
### [0.0.1]
|
|
49
|
+
|
|
50
|
+
#### Features
|
|
51
|
+
|
|
52
|
+
- Chart component added.
|
|
53
|
+
- More advanced config. added.
|
package/build.zip
ADDED
|
Binary file
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Group,
|
|
3
|
+
Label,
|
|
4
|
+
TextInput,
|
|
5
|
+
SelectInput,
|
|
6
|
+
TextFormat,
|
|
7
|
+
Switch,
|
|
8
|
+
NumberInput,
|
|
9
|
+
} from "@vixoniccom/modules";
|
|
10
|
+
import { ShowValidations } from "../utils";
|
|
11
|
+
|
|
12
|
+
// Configuración de estilo: gráfico, título, leyenda
|
|
13
|
+
export const chartGroup = new Group({
|
|
14
|
+
id: "chartGroup",
|
|
15
|
+
label: "Gráfico",
|
|
16
|
+
items: [
|
|
17
|
+
new Label({ label: "General" }),
|
|
18
|
+
new SelectInput({
|
|
19
|
+
id: "chartType",
|
|
20
|
+
label: "Tipo de gŕafico",
|
|
21
|
+
items: [
|
|
22
|
+
{ label: "Barras", value: "bar" },
|
|
23
|
+
{ label: "Líneas", value: "line" },
|
|
24
|
+
{ label: "Área", value: "area" },
|
|
25
|
+
{ label: "Dispersión", value: "bubble" },
|
|
26
|
+
],
|
|
27
|
+
defaultValue: "bar",
|
|
28
|
+
}),
|
|
29
|
+
new SelectInput({
|
|
30
|
+
id: "barOrientation",
|
|
31
|
+
label: "Orientación de barras",
|
|
32
|
+
items: [
|
|
33
|
+
{ label: "Vertical", value: "vertical" },
|
|
34
|
+
{ label: "Horizontal", value: "horizontal" },
|
|
35
|
+
],
|
|
36
|
+
defaultValue: "vertical",
|
|
37
|
+
show: ShowValidations.chartTypeIsBar,
|
|
38
|
+
}),
|
|
39
|
+
new Switch({
|
|
40
|
+
id: "barStacked",
|
|
41
|
+
label: "Barras",
|
|
42
|
+
displayOnTrue: "apiladas",
|
|
43
|
+
displayOnFalse: "normales",
|
|
44
|
+
defaultValue: false,
|
|
45
|
+
show: ShowValidations.chartTypeIsBar,
|
|
46
|
+
}),
|
|
47
|
+
new Switch({
|
|
48
|
+
id: "darkMode",
|
|
49
|
+
label: "Gráfico en modo",
|
|
50
|
+
displayOnTrue: "oscuro",
|
|
51
|
+
displayOnFalse: "claro",
|
|
52
|
+
defaultValue: false,
|
|
53
|
+
}),
|
|
54
|
+
new Label({ label: "Título" }),
|
|
55
|
+
new Switch({
|
|
56
|
+
id: "titleEnabled",
|
|
57
|
+
label: "Mostrar título",
|
|
58
|
+
defaultValue: false,
|
|
59
|
+
}),
|
|
60
|
+
new TextInput({
|
|
61
|
+
id: "title",
|
|
62
|
+
label: "Título",
|
|
63
|
+
show: ShowValidations.titleEnabled,
|
|
64
|
+
required: true,
|
|
65
|
+
}),
|
|
66
|
+
new TextFormat({
|
|
67
|
+
id: "titleTextFormat",
|
|
68
|
+
label: "Título",
|
|
69
|
+
description: "Formato de texto para el título del gráfico.",
|
|
70
|
+
show: ShowValidations.titleEnabled,
|
|
71
|
+
}),
|
|
72
|
+
new TextInput({
|
|
73
|
+
id: "titlePadding",
|
|
74
|
+
label: "Márgenes de título",
|
|
75
|
+
description: "Márgenes para dar espacio en cada lado al título.",
|
|
76
|
+
show: ShowValidations.titleEnabled,
|
|
77
|
+
}),
|
|
78
|
+
new Label({ label: "Leyenda" }),
|
|
79
|
+
new Switch({
|
|
80
|
+
id: "legendEnabled",
|
|
81
|
+
label: "Mostrar leyenda",
|
|
82
|
+
defaultValue: false,
|
|
83
|
+
}),
|
|
84
|
+
new TextFormat({
|
|
85
|
+
id: "legendTextFormat",
|
|
86
|
+
label: "Leyenda",
|
|
87
|
+
description: "Formato de texto para la leyenda del gráfico.",
|
|
88
|
+
show: ShowValidations.legendEnabled,
|
|
89
|
+
}),
|
|
90
|
+
new SelectInput({
|
|
91
|
+
id: "legendPosition",
|
|
92
|
+
label: "Posición de leyenda",
|
|
93
|
+
items: [
|
|
94
|
+
{ label: "Izquierda", value: "left" },
|
|
95
|
+
{ label: "Derecha", value: "right" },
|
|
96
|
+
],
|
|
97
|
+
defaultValue: "left",
|
|
98
|
+
show: ShowValidations.legendEnabled,
|
|
99
|
+
}),
|
|
100
|
+
new NumberInput({
|
|
101
|
+
id: "legendMargin",
|
|
102
|
+
label: "Separación",
|
|
103
|
+
description: "Distancia (en px.) entre leyenda y gráfico",
|
|
104
|
+
show: ShowValidations.legendEnabled,
|
|
105
|
+
}),
|
|
106
|
+
new NumberInput({
|
|
107
|
+
id: "circleSize",
|
|
108
|
+
label: "Tamaño círculo",
|
|
109
|
+
description: "Tamaño (en px.) del cículo de color en la leyenda.",
|
|
110
|
+
show: ShowValidations.legendEnabled,
|
|
111
|
+
}),
|
|
112
|
+
new Label({ label: "Eje vertical" }),
|
|
113
|
+
new Switch({
|
|
114
|
+
id: "yAxisEnabled",
|
|
115
|
+
label: "Mostrar métricas",
|
|
116
|
+
defaultValue: true,
|
|
117
|
+
}),
|
|
118
|
+
new Switch({
|
|
119
|
+
id: "showVerticalGrid",
|
|
120
|
+
label: "Mostrar líneas verticales",
|
|
121
|
+
defaultValue: true,
|
|
122
|
+
}),
|
|
123
|
+
new Label({ label: "Eje horizontal" }),
|
|
124
|
+
new Switch({
|
|
125
|
+
id: "xAxisEnabled",
|
|
126
|
+
label: "Mostrar métricas",
|
|
127
|
+
defaultValue: true,
|
|
128
|
+
}),
|
|
129
|
+
new Switch({
|
|
130
|
+
id: "showHorizontalGrid",
|
|
131
|
+
label: "Mostrar líneas horizontales",
|
|
132
|
+
defaultValue: true,
|
|
133
|
+
}),
|
|
134
|
+
],
|
|
135
|
+
});
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Group,
|
|
3
|
+
Label,
|
|
4
|
+
NumberInput,
|
|
5
|
+
NumberRangeValue,
|
|
6
|
+
RedirectButton,
|
|
7
|
+
SelectInput,
|
|
8
|
+
TextInput,
|
|
9
|
+
} from "@vixoniccom/modules";
|
|
10
|
+
|
|
11
|
+
// Configuración general: URL fuente, cantidad de columnas y filas, tiempo de actualización y mensaje por defecto
|
|
12
|
+
export const generalGroup = new Group({
|
|
13
|
+
id: "generalGroup",
|
|
14
|
+
label: "General",
|
|
15
|
+
items: [
|
|
16
|
+
new Label({ label: "Datos" }),
|
|
17
|
+
new TextInput({
|
|
18
|
+
id: "url",
|
|
19
|
+
label: "URL de planilla",
|
|
20
|
+
description: "URL de la fuente de datos.",
|
|
21
|
+
required: true,
|
|
22
|
+
}),
|
|
23
|
+
new RedirectButton({
|
|
24
|
+
id: "urlRedirectButton",
|
|
25
|
+
label: "Ir al documento",
|
|
26
|
+
}),
|
|
27
|
+
new NumberInput({
|
|
28
|
+
id: "maxColumnsNumber",
|
|
29
|
+
label: "Cantidad de columnas",
|
|
30
|
+
range: new NumberRangeValue(1, 10, 1),
|
|
31
|
+
description:
|
|
32
|
+
"Máxima cantidad de columnas por mostrar (sin considerar categoría). Entre 1 y 10 (3 por defecto).",
|
|
33
|
+
}),
|
|
34
|
+
new NumberInput({
|
|
35
|
+
id: "maxRowsNumber",
|
|
36
|
+
label: "Cantidad de filas",
|
|
37
|
+
range: new NumberRangeValue(1, 100, 1),
|
|
38
|
+
description:
|
|
39
|
+
"Máxima cantidad de filas por mostrar. Entre 1 y 100 (6 por defecto).",
|
|
40
|
+
}),
|
|
41
|
+
new SelectInput({
|
|
42
|
+
id: "updateTime",
|
|
43
|
+
label: "Actualización",
|
|
44
|
+
items: [
|
|
45
|
+
{ label: "5 minutos", value: 300000 },
|
|
46
|
+
{ label: "10 minutos", value: 600000 },
|
|
47
|
+
{ label: "15 minutos", value: 900000 },
|
|
48
|
+
{ label: "30 minutos", value: 1800000 },
|
|
49
|
+
{ label: "1 hora", value: 3600000 },
|
|
50
|
+
],
|
|
51
|
+
description: "Periodo de actualización de datos.",
|
|
52
|
+
defaultValue: 600000,
|
|
53
|
+
}),
|
|
54
|
+
],
|
|
55
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Configuration } from "@vixoniccom/modules";
|
|
2
|
+
import { generalGroup } from "./generalGroup";
|
|
3
|
+
import { chartGroup } from "./chartGroup";
|
|
4
|
+
import { styleGroup } from "./styleGroup";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Clase que dictamina el esquema y es utilizada para generación de archivos
|
|
8
|
+
de configuración.
|
|
9
|
+
*/
|
|
10
|
+
export const configuration: Configuration = new Configuration({
|
|
11
|
+
schema: [generalGroup, chartGroup, styleGroup],
|
|
12
|
+
});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Group,
|
|
3
|
+
Label,
|
|
4
|
+
TextInput,
|
|
5
|
+
TextFormat,
|
|
6
|
+
SelectAssetKna,
|
|
7
|
+
Switch,
|
|
8
|
+
} from "@vixoniccom/modules";
|
|
9
|
+
import { ShowValidations } from "../utils";
|
|
10
|
+
|
|
11
|
+
// Configuración de estilo: padding, fondo y formato de texto por defecto
|
|
12
|
+
export const styleGroup = new Group({
|
|
13
|
+
id: "styleGroup",
|
|
14
|
+
label: "Estilo",
|
|
15
|
+
items: [
|
|
16
|
+
new Label({
|
|
17
|
+
label: "Contenido",
|
|
18
|
+
}),
|
|
19
|
+
new TextInput({
|
|
20
|
+
id: "appPadding",
|
|
21
|
+
label: "Márgenes de aplicación",
|
|
22
|
+
description: "Márgenes para dar espacio en cada lado.",
|
|
23
|
+
}),
|
|
24
|
+
new SelectAssetKna({
|
|
25
|
+
id: "backgroundImage",
|
|
26
|
+
label: "Fondo",
|
|
27
|
+
extensions: ["jpg", "png"],
|
|
28
|
+
}),
|
|
29
|
+
new Switch({
|
|
30
|
+
id: "customMessageEnabled",
|
|
31
|
+
label: "Mostrar mensaje",
|
|
32
|
+
displayOnFalse: "del sistema",
|
|
33
|
+
displayOnTrue: "personalizado",
|
|
34
|
+
defaultValue: false,
|
|
35
|
+
}),
|
|
36
|
+
new TextInput({
|
|
37
|
+
id: "customMessage",
|
|
38
|
+
label: "Mensaje personalizado",
|
|
39
|
+
description: "Mensaje para mostrar en caso de datos inexistentes.",
|
|
40
|
+
required: true,
|
|
41
|
+
show: ShowValidations.customMessageEnabled,
|
|
42
|
+
}),
|
|
43
|
+
new TextFormat({
|
|
44
|
+
id: "systemMessageTextFormat",
|
|
45
|
+
label: "Formato de mensaje",
|
|
46
|
+
description: "Formato de texto para mensaje del sistema/personalizado.",
|
|
47
|
+
}),
|
|
48
|
+
],
|
|
49
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Declaración de condiciones de visualización de configuraciones
|
|
2
|
+
const titleEnabled = "{{titleEnabled}} === true";
|
|
3
|
+
const legendEnabled = "{{legendEnabled}} === true";
|
|
4
|
+
const chartTypeIsBar = "{{chartType}} === 'bar'";
|
|
5
|
+
const customMessageEnabled = "{{customMessageEnabled}} === true";
|
|
6
|
+
|
|
7
|
+
export const ShowValidations = {
|
|
8
|
+
titleEnabled,
|
|
9
|
+
legendEnabled,
|
|
10
|
+
chartTypeIsBar,
|
|
11
|
+
customMessageEnabled,
|
|
12
|
+
};
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema": [
|
|
3
|
+
{
|
|
4
|
+
"id": "generalGroup",
|
|
5
|
+
"label": "General",
|
|
6
|
+
"type": "group",
|
|
7
|
+
"items": [
|
|
8
|
+
{
|
|
9
|
+
"type": "label",
|
|
10
|
+
"label": "Datos"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"id": "url",
|
|
14
|
+
"label": "URL de planilla",
|
|
15
|
+
"type": "text-input",
|
|
16
|
+
"description": "URL de la fuente de datos.",
|
|
17
|
+
"required": true
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"id": "urlRedirectButton",
|
|
21
|
+
"label": "Ir al documento",
|
|
22
|
+
"type": "redirect-button"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"id": "maxColumnsNumber",
|
|
26
|
+
"label": "Cantidad de columnas",
|
|
27
|
+
"type": "number-input",
|
|
28
|
+
"range": "[1:10:1]",
|
|
29
|
+
"description": "Máxima cantidad de columnas por mostrar (sin considerar categoría). Entre 1 y 10 (3 por defecto)."
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"id": "maxRowsNumber",
|
|
33
|
+
"label": "Cantidad de filas",
|
|
34
|
+
"type": "number-input",
|
|
35
|
+
"range": "[1:100:1]",
|
|
36
|
+
"description": "Máxima cantidad de filas por mostrar. Entre 1 y 100 (6 por defecto)."
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"id": "updateTime",
|
|
40
|
+
"label": "Actualización",
|
|
41
|
+
"type": "select-input",
|
|
42
|
+
"description": "Periodo de actualización de datos.",
|
|
43
|
+
"items": [
|
|
44
|
+
{
|
|
45
|
+
"label": "5 minutos",
|
|
46
|
+
"value": 300000
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"label": "10 minutos",
|
|
50
|
+
"value": 600000
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"label": "15 minutos",
|
|
54
|
+
"value": 900000
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"label": "30 minutos",
|
|
58
|
+
"value": 1800000
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"label": "1 hora",
|
|
62
|
+
"value": 3600000
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
"defaultValue": 600000
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"id": "chartGroup",
|
|
71
|
+
"label": "Gráfico",
|
|
72
|
+
"type": "group",
|
|
73
|
+
"items": [
|
|
74
|
+
{
|
|
75
|
+
"type": "label",
|
|
76
|
+
"label": "General"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"id": "chartType",
|
|
80
|
+
"label": "Tipo de gŕafico",
|
|
81
|
+
"type": "select-input",
|
|
82
|
+
"items": [
|
|
83
|
+
{
|
|
84
|
+
"label": "Barras",
|
|
85
|
+
"value": "bar"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"label": "Líneas",
|
|
89
|
+
"value": "line"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"label": "Área",
|
|
93
|
+
"value": "area"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"label": "Dispersión",
|
|
97
|
+
"value": "bubble"
|
|
98
|
+
}
|
|
99
|
+
],
|
|
100
|
+
"defaultValue": "bar"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"id": "barOrientation",
|
|
104
|
+
"label": "Orientación de barras",
|
|
105
|
+
"show": "{{chartType}} === 'bar'",
|
|
106
|
+
"type": "select-input",
|
|
107
|
+
"items": [
|
|
108
|
+
{
|
|
109
|
+
"label": "Vertical",
|
|
110
|
+
"value": "vertical"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"label": "Horizontal",
|
|
114
|
+
"value": "horizontal"
|
|
115
|
+
}
|
|
116
|
+
],
|
|
117
|
+
"defaultValue": "vertical"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"id": "barStacked",
|
|
121
|
+
"label": "Barras",
|
|
122
|
+
"show": "{{chartType}} === 'bar'",
|
|
123
|
+
"type": "switch",
|
|
124
|
+
"defaultValue": false,
|
|
125
|
+
"displayOnTrue": "apiladas",
|
|
126
|
+
"displayOnFalse": "normales"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"id": "darkMode",
|
|
130
|
+
"label": "Gráfico en modo",
|
|
131
|
+
"type": "switch",
|
|
132
|
+
"defaultValue": false,
|
|
133
|
+
"displayOnTrue": "oscuro",
|
|
134
|
+
"displayOnFalse": "claro"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"type": "label",
|
|
138
|
+
"label": "Título"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"id": "titleEnabled",
|
|
142
|
+
"label": "Mostrar título",
|
|
143
|
+
"type": "switch",
|
|
144
|
+
"defaultValue": false
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"id": "title",
|
|
148
|
+
"label": "Título",
|
|
149
|
+
"show": "{{titleEnabled}} === true",
|
|
150
|
+
"type": "text-input",
|
|
151
|
+
"required": true
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"id": "titleTextFormat",
|
|
155
|
+
"label": "Título",
|
|
156
|
+
"show": "{{titleEnabled}} === true",
|
|
157
|
+
"type": "text-format",
|
|
158
|
+
"description": "Formato de texto para el título del gráfico."
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"id": "titlePadding",
|
|
162
|
+
"label": "Márgenes de título",
|
|
163
|
+
"show": "{{titleEnabled}} === true",
|
|
164
|
+
"type": "text-input",
|
|
165
|
+
"description": "Márgenes para dar espacio en cada lado al título."
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"type": "label",
|
|
169
|
+
"label": "Leyenda"
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"id": "legendEnabled",
|
|
173
|
+
"label": "Mostrar leyenda",
|
|
174
|
+
"type": "switch",
|
|
175
|
+
"defaultValue": false
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"id": "legendTextFormat",
|
|
179
|
+
"label": "Leyenda",
|
|
180
|
+
"show": "{{legendEnabled}} === true",
|
|
181
|
+
"type": "text-format",
|
|
182
|
+
"description": "Formato de texto para la leyenda del gráfico."
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"id": "legendPosition",
|
|
186
|
+
"label": "Posición de leyenda",
|
|
187
|
+
"show": "{{legendEnabled}} === true",
|
|
188
|
+
"type": "select-input",
|
|
189
|
+
"items": [
|
|
190
|
+
{
|
|
191
|
+
"label": "Izquierda",
|
|
192
|
+
"value": "left"
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"label": "Derecha",
|
|
196
|
+
"value": "right"
|
|
197
|
+
}
|
|
198
|
+
],
|
|
199
|
+
"defaultValue": "left"
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
"id": "legendMargin",
|
|
203
|
+
"label": "Separación",
|
|
204
|
+
"show": "{{legendEnabled}} === true",
|
|
205
|
+
"type": "number-input",
|
|
206
|
+
"description": "Distancia (en px.) entre leyenda y gráfico"
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"id": "circleSize",
|
|
210
|
+
"label": "Tamaño círculo",
|
|
211
|
+
"show": "{{legendEnabled}} === true",
|
|
212
|
+
"type": "number-input",
|
|
213
|
+
"description": "Tamaño (en px.) del cículo de color en la leyenda."
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"type": "label",
|
|
217
|
+
"label": "Eje vertical"
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
"id": "yAxisEnabled",
|
|
221
|
+
"label": "Mostrar métricas",
|
|
222
|
+
"type": "switch",
|
|
223
|
+
"defaultValue": true
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
"id": "showVerticalGrid",
|
|
227
|
+
"label": "Mostrar líneas verticales",
|
|
228
|
+
"type": "switch",
|
|
229
|
+
"defaultValue": true
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
"type": "label",
|
|
233
|
+
"label": "Eje horizontal"
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
"id": "xAxisEnabled",
|
|
237
|
+
"label": "Mostrar métricas",
|
|
238
|
+
"type": "switch",
|
|
239
|
+
"defaultValue": true
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
"id": "showHorizontalGrid",
|
|
243
|
+
"label": "Mostrar líneas horizontales",
|
|
244
|
+
"type": "switch",
|
|
245
|
+
"defaultValue": true
|
|
246
|
+
}
|
|
247
|
+
]
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
"id": "styleGroup",
|
|
251
|
+
"label": "Estilo",
|
|
252
|
+
"type": "group",
|
|
253
|
+
"items": [
|
|
254
|
+
{
|
|
255
|
+
"type": "label",
|
|
256
|
+
"label": "Contenido"
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
"id": "appPadding",
|
|
260
|
+
"label": "Márgenes de aplicación",
|
|
261
|
+
"type": "text-input",
|
|
262
|
+
"description": "Márgenes para dar espacio en cada lado."
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
"id": "backgroundImage",
|
|
266
|
+
"label": "Fondo",
|
|
267
|
+
"type": "select-asset-kna-input",
|
|
268
|
+
"extensions": [
|
|
269
|
+
"jpg",
|
|
270
|
+
"png"
|
|
271
|
+
],
|
|
272
|
+
"multiple": false
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"id": "customMessageEnabled",
|
|
276
|
+
"label": "Mostrar mensaje",
|
|
277
|
+
"type": "switch",
|
|
278
|
+
"defaultValue": false,
|
|
279
|
+
"displayOnTrue": "personalizado",
|
|
280
|
+
"displayOnFalse": "del sistema"
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
"id": "customMessage",
|
|
284
|
+
"label": "Mensaje personalizado",
|
|
285
|
+
"show": "{{customMessageEnabled}} === true",
|
|
286
|
+
"type": "text-input",
|
|
287
|
+
"description": "Mensaje para mostrar en caso de datos inexistentes.",
|
|
288
|
+
"required": true
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
"id": "systemMessageTextFormat",
|
|
292
|
+
"label": "Formato de mensaje",
|
|
293
|
+
"type": "text-format",
|
|
294
|
+
"description": "Formato de texto para mensaje del sistema/personalizado."
|
|
295
|
+
}
|
|
296
|
+
]
|
|
297
|
+
}
|
|
298
|
+
]
|
|
299
|
+
}
|
package/icon.png
ADDED
|
Binary file
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vixoniccom/kpi-chart",
|
|
3
|
+
"alias": "KPI Chart",
|
|
4
|
+
"description": "Muestra gráficos según indicadores KPI.",
|
|
5
|
+
"color": "#FF0031",
|
|
6
|
+
"license": "ISC",
|
|
7
|
+
"tags": [],
|
|
8
|
+
"author": {
|
|
9
|
+
"name": "Lorenzo Alfaro Bravo"
|
|
10
|
+
},
|
|
11
|
+
"version": "0.0.1-beta.1",
|
|
12
|
+
"scripts": {
|
|
13
|
+
"prepublishOnly": "vixonic-module-packager --mode=build",
|
|
14
|
+
"watch": "vixonic-module-packager --mode=watch",
|
|
15
|
+
"run": "vixonic-module-packager --mode=run",
|
|
16
|
+
"configuration": "vixonic-module-packager --mode generate-configuration",
|
|
17
|
+
"configuration:validate": "vixonic-module-packager --mode validate-configuration",
|
|
18
|
+
"release": "standard-version",
|
|
19
|
+
"prerelease-beta": "standard-version --prerelease beta",
|
|
20
|
+
"prerelease-dev": "standard-version --prerelease dev"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"axios": "^1.7.9",
|
|
24
|
+
"localforage": "^1.10.0",
|
|
25
|
+
"react": "^17.0.2",
|
|
26
|
+
"react-charts": "^3.0.0-beta.57",
|
|
27
|
+
"react-dom": "^17.0.2"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@types/node": "^14.0.0",
|
|
31
|
+
"@types/react": "^18.3.12",
|
|
32
|
+
"@types/react-dom": "^18.3.1",
|
|
33
|
+
"@vixoniccom/module-packager": "^2.10.1",
|
|
34
|
+
"@vixoniccom/modules": "^2.19.0",
|
|
35
|
+
"standard-version": "^9.5.0"
|
|
36
|
+
}
|
|
37
|
+
}
|