@vixoniccom/kpi-chart 0.0.2-dev.18 → 0.0.2-dev.2

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.
@@ -0,0 +1,98 @@
1
+ name: Publish to NPM
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ - main
8
+
9
+ jobs:
10
+ publish:
11
+ # Solo ejecutar si es un push a main/master
12
+ if: github.event_name == 'push'
13
+ runs-on: ubuntu-latest
14
+
15
+ steps:
16
+ - name: Checkout code
17
+ uses: actions/checkout@v4
18
+ with:
19
+ fetch-depth: 0
20
+
21
+ - name: Setup Node.js 20
22
+ uses: actions/setup-node@v4
23
+ with:
24
+ node-version: '20'
25
+ registry-url: 'https://registry.npmjs.org'
26
+ scope: '@vixoniccom'
27
+
28
+ - name: Configure npm authentication
29
+ run: |
30
+ echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
31
+ echo "@vixoniccom:registry=https://registry.npmjs.org/" >> ~/.npmrc
32
+ echo "registry=https://registry.npmjs.org/" >> ~/.npmrc
33
+
34
+ - name: Cache node modules
35
+ uses: actions/cache@v4
36
+ with:
37
+ path: ~/.npm
38
+ key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
39
+ restore-keys: |
40
+ ${{ runner.os }}-node-
41
+
42
+ - name: Install dependencies
43
+ run: npm ci
44
+ env:
45
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
46
+
47
+ - name: Build package
48
+ run: npm run prepublish
49
+ env:
50
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
51
+
52
+ - name: Verify build.zip exists
53
+ run: |
54
+ if [ ! -f "build.zip" ]; then
55
+ echo "❌ Error: build.zip not found after build process"
56
+ exit 1
57
+ fi
58
+ echo "✅ build.zip found successfully"
59
+ ls -la build.zip
60
+
61
+ - name: Check if version already exists on npm
62
+ id: check-version
63
+ run: |
64
+ PACKAGE_NAME=$(node -p "require('./package.json').name")
65
+ PACKAGE_VERSION=$(node -p "require('./package.json').version")
66
+
67
+ echo "Checking if $PACKAGE_NAME@$PACKAGE_VERSION exists on npm..."
68
+
69
+ if npm view "$PACKAGE_NAME@$PACKAGE_VERSION" version 2>/dev/null; then
70
+ echo "version-exists=true" >> $GITHUB_OUTPUT
71
+ echo "⚠️ Version $PACKAGE_VERSION already exists on npm"
72
+ else
73
+ echo "version-exists=false" >> $GITHUB_OUTPUT
74
+ echo "✅ Version $PACKAGE_VERSION does not exist on npm - ready to publish"
75
+ fi
76
+
77
+ - name: Publish to npm
78
+ if: steps.check-version.outputs.version-exists == 'false'
79
+ run: |
80
+ echo "Publishing to npm..."
81
+ npm publish --access public
82
+ env:
83
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
84
+
85
+ - name: Publication success
86
+ if: steps.check-version.outputs.version-exists == 'false'
87
+ run: |
88
+ PACKAGE_NAME=$(node -p "require('./package.json').name")
89
+ PACKAGE_VERSION=$(node -p "require('./package.json').version")
90
+ echo "🎉 Successfully published $PACKAGE_NAME@$PACKAGE_VERSION to npm!"
91
+ echo "📦 Package includes build.zip with the compiled application"
92
+
93
+ - name: Skip publication
94
+ if: steps.check-version.outputs.version-exists == 'true'
95
+ run: |
96
+ PACKAGE_VERSION=$(node -p "require('./package.json').version")
97
+ echo "⏭️ Skipping publication - version $PACKAGE_VERSION already exists on npm"
98
+ echo "💡 To publish a new version, update the version in package.json or run 'npm run release'"
@@ -3,7 +3,7 @@ name: Sonarqube Analysis
3
3
  on:
4
4
  push:
5
5
  branches:
6
- - main
6
+ - development
7
7
  pull_request:
8
8
  types: [opened, synchronize, reopened]
9
9
 
@@ -11,19 +11,19 @@ jobs:
11
11
  sonarqube:
12
12
  runs-on: ubuntu-latest
13
13
  steps:
14
- - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
14
+ - uses: actions/checkout@v4
15
15
  with:
16
16
  # Disabling shallow clone is recommended for improving relevancy of reporting.
17
17
  fetch-depth: 0
18
18
 
19
19
  - name: SonarQube Scan
20
- uses: sonarsource/sonarqube-scan-action@22918119ff8e1ca75a623e15c8296b6ea4fbe28f # v8.2.1
20
+ uses: sonarsource/sonarqube-scan-action@master
21
21
  env:
22
22
  SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
23
23
  SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
24
24
 
25
25
  - name: SonarQube Quality Gate Check
26
- uses: sonarsource/sonarqube-quality-gate-action@cf038b0e0cdecfa9e56c198bbb7d21d751d62c3b # v1.2.0
26
+ uses: sonarsource/sonarqube-quality-gate-action@master
27
27
  timeout-minutes: 5
28
28
  env:
29
29
  SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
package/CHANGELOG.md CHANGED
@@ -2,106 +2,6 @@
2
2
 
3
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
4
 
5
- ### [0.0.2-dev.18](https://github.com/Vixonic/store-sheets-kpi/compare/v0.0.2-dev.17...v0.0.2-dev.18) (2026-11-10)
6
-
7
-
8
- ### Features
9
-
10
- * VXD-545 allow uploading the background image only from a PC ([6e62fc2](https://github.com/Vixonic/store-sheets-kpi/commit/6e62fc2546eff70bf026bfad9122e4ab1f987f01))
11
-
12
- ### [0.0.2-dev.17](https://github.com/Vixonic/store-sheets-kpi/compare/v0.0.2-dev.16...v0.0.2-dev.17) (2026-11-10)
13
-
14
-
15
- ### Bug Fixes
16
-
17
- * VXD-545 avoid CSS that older player browsers do not support ([90114c7](https://github.com/Vixonic/store-sheets-kpi/commit/90114c78750ffe91aa18d82192592c9d6f404744))
18
-
19
- ### [0.0.2-dev.16](https://github.com/Vixonic/store-sheets-kpi/compare/v0.0.2-dev.15...v0.0.2-dev.16) (2026-11-10)
20
-
21
-
22
- ### Bug Fixes
23
-
24
- * VXD-545 keep the no data message on a single line ([2ca7466](https://github.com/Vixonic/store-sheets-kpi/commit/2ca746645f0fd0f7e869864ea6c0da21eacb7f65))
25
- * VXD-545 parse header units without backtracking regex ([0b7efa8](https://github.com/Vixonic/store-sheets-kpi/commit/0b7efa83529f52b751332d2509b32f6c8a45bd9e))
26
-
27
- ### [0.0.2-dev.15](https://github.com/Vixonic/store-sheets-kpi/compare/v0.0.2-dev.14...v0.0.2-dev.15) (2026-11-09)
28
-
29
-
30
- ### Features
31
-
32
- * VXD-545 plot the charts kept by the app over the KpiService tabs ([2f96e60](https://github.com/Vixonic/store-sheets-kpi/commit/2f96e60a352a1e37aec28b0bfe7a65d206407381))
33
-
34
- ### [0.0.2-dev.14](https://github.com/Vixonic/store-sheets-kpi/compare/v0.0.2-dev.13...v0.0.2-dev.14) (2026-11-05)
35
-
36
-
37
- ### Features
38
-
39
- * VXD-545 use the KpiService type for the documents service ([e115d3f](https://github.com/Vixonic/store-sheets-kpi/commit/e115d3f64bbbb7a2f7476a5b2e6100db0cb2a353))
40
-
41
- ### [0.0.2-dev.13](https://github.com/Vixonic/store-sheets-kpi/compare/v0.0.2-dev.12...v0.0.2-dev.13) (2026-11-05)
42
-
43
-
44
- ### Features
45
-
46
- * VXD-545 adjust appearance inputs to the new design ([5fc0c94](https://github.com/Vixonic/store-sheets-kpi/commit/5fc0c94bb40d0361a6bc83716ae14dc99c7f375d))
47
- * VXD-545 show the charts of the kpi service in rotation ([bcd5b90](https://github.com/Vixonic/store-sheets-kpi/commit/bcd5b9030dd0d24aff494ca6390bbb344b0f8958))
48
-
49
-
50
- ### Bug Fixes
51
-
52
- * VXD-545 use left value for title alignment and update modules ([2bcd34a](https://github.com/Vixonic/store-sheets-kpi/commit/2bcd34ae1a2aa4fdf5cc804ca8e1377ae6bce49f))
53
-
54
- ### [0.0.2-dev.12](https://github.com/Vixonic/store-sheets-kpi/compare/v0.0.2-dev.11...v0.0.2-dev.12) (2026-10-30)
55
-
56
-
57
- ### Features
58
-
59
- * VXD-545 organize appearance configuration into sections and blocks ([d5cc6f6](https://github.com/Vixonic/store-sheets-kpi/commit/d5cc6f63e08609856489fbb97056dab070d74503))
60
-
61
- ### [0.0.2-dev.11](https://github.com/Vixonic/store-sheets-kpi/compare/v0.0.2-dev.8...v0.0.2-dev.11) (2026-10-28)
62
-
63
-
64
- ### Features
65
-
66
- * VXD-545 restructure configuration into chart and appearance groups ([3b20176](https://github.com/Vixonic/store-sheets-kpi/commit/3b20176be4f99830a519daf7dd6c8035455051ad))
67
- * VXD-901 Add text formatting options for chart values and labels ([6cc17ad](https://github.com/Vixonic/store-sheets-kpi/commit/6cc17ad7f28337c973589784dfeca4544d3dbf73))
68
-
69
-
70
- ### Bug Fixes
71
-
72
- * fixed pipeline ([121e14c](https://github.com/Vixonic/store-sheets-kpi/commit/121e14c5f3f58a0c7c5f24a7a9ca5e44e40b84c2))
73
-
74
- ### [0.0.2-dev.10](https://github.com/Vixonic/store-sheets-kpi/compare/v0.0.2-dev.9...v0.0.2-dev.10) (2026-08-04)
75
-
76
- ### [0.0.2-dev.9](https://github.com/Vixonic/store-sheets-kpi/compare/v0.0.2-dev.8...v0.0.2-dev.9) (2026-08-04)
77
-
78
-
79
- ### Features
80
-
81
- * VXD-901 Add text formatting options for chart values and labels ([6cc17ad](https://github.com/Vixonic/store-sheets-kpi/commit/6cc17ad7f28337c973589784dfeca4544d3dbf73))
82
-
83
-
84
- ### Bug Fixes
85
-
86
- * fixed pipeline ([121e14c](https://github.com/Vixonic/store-sheets-kpi/commit/121e14c5f3f58a0c7c5f24a7a9ca5e44e40b84c2))
87
-
88
- ### [0.0.2-dev.8](https://github.com/Vixonic/store-sheets-kpi/compare/v0.0.2-dev.7...v0.0.2-dev.8) (2026-03-19)
89
-
90
- ### [0.0.2-dev.7](https://github.com/Vixonic/store-sheets-kpi/compare/v0.0.2-dev.6...v0.0.2-dev.7) (2026-03-19)
91
-
92
- ### [0.0.2-dev.6](https://github.com/Vixonic/store-sheets-kpi/compare/v0.0.2-dev.5...v0.0.2-dev.6) (2026-03-19)
93
-
94
-
95
- ### Features
96
-
97
- * VXD-866 Adds option to show data labels in charts and removes alphabetical order when generating the chart ([f0b7a37](https://github.com/Vixonic/store-sheets-kpi/commit/f0b7a37d129366ca83e3fd96d612ecb7bb2f8d7d))
98
-
99
- ### [0.0.2-dev.5](https://github.com/Vixonic/store-sheets-kpi/compare/v0.0.2-dev.4...v0.0.2-dev.5) (2026-03-04)
100
-
101
- ### [0.0.2-dev.4](https://github.com/Vixonic/store-sheets-kpi/compare/v0.0.2-dev.3...v0.0.2-dev.4) (2026-03-04)
102
-
103
- ### [0.0.2-dev.3](https://github.com/Vixonic/store-sheets-kpi/compare/v0.0.2-dev.2...v0.0.2-dev.3) (2026-03-04)
104
-
105
5
  ### [0.0.2-dev.2](https://github.com/Vixonic/store-sheets-kpi/compare/v0.0.2-dev.1...v0.0.2-dev.2) (2026-03-04)
106
6
 
107
7
  ### [0.0.2-dev.1](https://github.com/Vixonic/store-sheets-kpi/compare/v0.0.2-dev.0...v0.0.2-dev.1) (2025-09-11)
package/build.zip CHANGED
Binary file
@@ -1,23 +1,135 @@
1
1
  import {
2
2
  Group,
3
- KpiChartsInput,
4
- ServiceInput,
3
+ Label,
4
+ TextInput,
5
+ SelectInput,
6
+ TextFormat,
7
+ Switch,
8
+ NumberInput,
5
9
  } from "@vixoniccom/modules";
10
+ import { ShowValidations } from "../utils";
6
11
 
12
+ // Configuración de estilo: gráfico, título, leyenda
7
13
  export const chartGroup = new Group({
8
14
  id: "chartGroup",
9
- label: "Gráficos",
10
- groupType: "sheetSelection",
15
+ label: "Gráfico",
11
16
  items: [
12
- new ServiceInput({
13
- id: 'documentServices',
14
- label: 'Planillas',
15
- serviceType: 'KpiService',
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",
16
28
  }),
17
- // Gráfico de cada pestaña del servicio; se edita en la vista de planillas de la plataforma.
18
- new KpiChartsInput({
19
- id: 'documentCharts',
20
- serviceInputId: 'documentServices',
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,
21
133
  }),
22
134
  ],
23
- })
135
+ });
@@ -0,0 +1,33 @@
1
+ import {
2
+ Group,
3
+ Label,
4
+ SelectInput,
5
+ ServiceInput,
6
+ } from "@vixoniccom/modules";
7
+
8
+ // Configuración general: URL fuente, cantidad de columnas y filas, tiempo de actualización y mensaje por defecto
9
+ export const generalGroup = new Group({
10
+ id: "generalGroup",
11
+ label: "General",
12
+ items: [
13
+ new Label({ label: "Datos" }),
14
+ new ServiceInput({
15
+ id: 'documentService',
16
+ label: 'Documento',
17
+ serviceType: 'SheetsReaderService',
18
+ }),
19
+ new SelectInput({
20
+ id: "updateTime",
21
+ label: "Actualización",
22
+ items: [
23
+ { label: "5 minutos", value: 300000 },
24
+ { label: "10 minutos", value: 600000 },
25
+ { label: "15 minutos", value: 900000 },
26
+ { label: "30 minutos", value: 1800000 },
27
+ { label: "1 hora", value: 3600000 },
28
+ ],
29
+ description: "Periodo de actualización de datos.",
30
+ defaultValue: 600000,
31
+ }),
32
+ ],
33
+ });
@@ -1,7 +1,12 @@
1
1
  import { Configuration } from "@vixoniccom/modules";
2
+ import { generalGroup } from "./generalGroup";
2
3
  import { chartGroup } from "./chartGroup";
3
- import { appearanceGroup } from "./appearanceGroup";
4
+ import { styleGroup } from "./styleGroup";
4
5
 
6
+ /**
7
+ * Clase que dictamina el esquema y es utilizada para generación de archivos
8
+ de configuración.
9
+ */
5
10
  export const configuration: Configuration = new Configuration({
6
- schema: [chartGroup, appearanceGroup],
7
- })
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
+ });
@@ -1,5 +1,12 @@
1
- const showGuidelines = "{{showGuidelines}} === true"
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";
2
6
 
3
7
  export const ShowValidations = {
4
- showGuidelines,
5
- }
8
+ titleEnabled,
9
+ legendEnabled,
10
+ chartTypeIsBar,
11
+ customMessageEnabled,
12
+ };
@@ -1,215 +1,277 @@
1
1
  {
2
2
  "schema": [
3
3
  {
4
- "id": "chartGroup",
5
- "label": "Gráficos",
4
+ "id": "generalGroup",
5
+ "label": "General",
6
6
  "type": "group",
7
7
  "items": [
8
8
  {
9
- "id": "documentServices",
10
- "label": "Planillas",
9
+ "type": "label",
10
+ "label": "Datos"
11
+ },
12
+ {
13
+ "id": "documentService",
14
+ "label": "Documento",
11
15
  "type": "service-input",
12
- "serviceType": "KpiService"
16
+ "serviceType": "SheetsReaderService"
13
17
  },
14
18
  {
15
- "id": "documentCharts",
16
- "label": "",
17
- "type": "kpi-charts-input",
18
- "serviceInputId": "documentServices"
19
+ "id": "updateTime",
20
+ "label": "Actualización",
21
+ "type": "select-input",
22
+ "description": "Periodo de actualización de datos.",
23
+ "items": [
24
+ {
25
+ "label": "5 minutos",
26
+ "value": 300000
27
+ },
28
+ {
29
+ "label": "10 minutos",
30
+ "value": 600000
31
+ },
32
+ {
33
+ "label": "15 minutos",
34
+ "value": 900000
35
+ },
36
+ {
37
+ "label": "30 minutos",
38
+ "value": 1800000
39
+ },
40
+ {
41
+ "label": "1 hora",
42
+ "value": 3600000
43
+ }
44
+ ],
45
+ "defaultValue": 600000
19
46
  }
20
- ],
21
- "groupType": "sheetSelection"
47
+ ]
22
48
  },
23
49
  {
24
- "id": "appearanceGroup",
25
- "label": "Apariencia",
50
+ "id": "chartGroup",
51
+ "label": "Gráfico",
26
52
  "type": "group",
27
53
  "items": [
28
54
  {
29
- "id": "designSection",
30
- "label": "Diseño",
31
- "type": "section",
32
- "labelContent": false,
33
- "muiIcon": "Brush",
34
- "items": [
35
- {
36
- "type": "block",
37
- "id": "designBlock",
38
- "divider": false,
39
- "items": [
40
- {
41
- "id": "backgroundColor",
42
- "label": "Color de fondo",
43
- "type": "color-picker",
44
- "description": "Si subes una imagen de fondo, esta tapa el color.",
45
- "output": "auto",
46
- "inLine": true
47
- },
48
- {
49
- "id": "backgroundImage",
50
- "label": "Imagen de fondo",
51
- "type": "select-asset-kna-input",
52
- "description": "JPG o PNG 16:9. Usa imágenes sobrias para que el gráfico se lea.",
53
- "extensions": [
54
- "jpg",
55
- "png"
56
- ],
57
- "multiple": false,
58
- "pcOnly": true
59
- }
60
- ]
61
- }
62
- ]
55
+ "type": "label",
56
+ "label": "General"
63
57
  },
64
58
  {
65
- "id": "colorsSection",
66
- "label": "Colores",
67
- "type": "section",
68
- "labelContent": false,
69
- "muiIcon": "ColorLens",
59
+ "id": "chartType",
60
+ "label": "Tipo de gŕafico",
61
+ "type": "select-input",
70
62
  "items": [
71
63
  {
72
- "type": "block",
73
- "id": "colorsBlock",
74
- "divider": false,
75
- "items": [
76
- {
77
- "id": "showGuidelines",
78
- "label": "Mostrar líneas guía y eje",
79
- "type": "switch",
80
- "defaultValue": false
81
- },
82
- {
83
- "id": "guidelineColor",
84
- "label": "Líneas guía",
85
- "show": "{{showGuidelines}} === true",
86
- "type": "color-picker",
87
- "output": "auto",
88
- "inLine": true
89
- }
90
- ]
64
+ "label": "Barras",
65
+ "value": "bar"
66
+ },
67
+ {
68
+ "label": "Líneas",
69
+ "value": "line"
70
+ },
71
+ {
72
+ "label": "Área",
73
+ "value": "area"
74
+ },
75
+ {
76
+ "label": "Dispersión",
77
+ "value": "bubble"
91
78
  }
92
- ]
79
+ ],
80
+ "defaultValue": "bar"
93
81
  },
94
82
  {
95
- "id": "textSection",
96
- "label": "Texto",
97
- "type": "section",
98
- "labelContent": false,
99
- "muiIcon": "Title",
83
+ "id": "barOrientation",
84
+ "label": "Orientación de barras",
85
+ "show": "{{chartType}} === 'bar'",
86
+ "type": "select-input",
100
87
  "items": [
101
88
  {
102
- "type": "block",
103
- "id": "titleTextBlock",
104
- "label": "Título",
105
- "description": "Nombre del gráfico, arriba.",
106
- "divider": false,
107
- "items": [
108
- {
109
- "id": "titleTypography",
110
- "label": "Tipografía",
111
- "type": "text-format",
112
- "hidePicker": true
113
- },
114
- {
115
- "id": "titleAlignment",
116
- "label": "Alineación",
117
- "type": "select-input",
118
- "items": [
119
- {
120
- "label": "Izquierda",
121
- "value": "left"
122
- },
123
- {
124
- "label": "Centro",
125
- "value": "center"
126
- }
127
- ],
128
- "defaultValue": "left",
129
- "inLine": true
130
- },
131
- {
132
- "id": "titleFontColor",
133
- "label": "Color",
134
- "type": "color-picker",
135
- "output": "auto",
136
- "inLine": true
137
- }
138
- ]
139
- },
140
- {
141
- "type": "block",
142
- "id": "tagTextBlock",
143
- "label": "Etiquetas",
144
- "description": "Categorías, leyenda y n´mero de los ejes.",
145
- "divider": true,
146
- "items": [
147
- {
148
- "id": "tagsTypography",
149
- "label": "Tipografía",
150
- "type": "text-format",
151
- "hidePicker": true
152
- },
153
- {
154
- "id": "legendFontColor",
155
- "label": "Color",
156
- "type": "color-picker",
157
- "output": "auto",
158
- "inLine": true
159
- }
160
- ]
89
+ "label": "Vertical",
90
+ "value": "vertical"
161
91
  },
162
92
  {
163
- "type": "block",
164
- "id": "valuesTextBlock",
165
- "label": "Valores",
166
- "description": "Cifra de cada barra, punto o porción.",
167
- "divider": true,
168
- "items": [
169
- {
170
- "id": "valuesTypography",
171
- "label": "Tipografía",
172
- "type": "text-format",
173
- "hidePicker": true
174
- },
175
- {
176
- "id": "valuesFontColor",
177
- "label": "Color",
178
- "type": "color-picker",
179
- "output": "auto",
180
- "inLine": true
181
- }
182
- ]
93
+ "label": "Horizontal",
94
+ "value": "horizontal"
183
95
  }
184
- ]
96
+ ],
97
+ "defaultValue": "vertical"
98
+ },
99
+ {
100
+ "id": "barStacked",
101
+ "label": "Barras",
102
+ "show": "{{chartType}} === 'bar'",
103
+ "type": "switch",
104
+ "defaultValue": false,
105
+ "displayOnTrue": "apiladas",
106
+ "displayOnFalse": "normales"
107
+ },
108
+ {
109
+ "id": "darkMode",
110
+ "label": "Gráfico en modo",
111
+ "type": "switch",
112
+ "defaultValue": false,
113
+ "displayOnTrue": "oscuro",
114
+ "displayOnFalse": "claro"
115
+ },
116
+ {
117
+ "type": "label",
118
+ "label": "Título"
119
+ },
120
+ {
121
+ "id": "titleEnabled",
122
+ "label": "Mostrar título",
123
+ "type": "switch",
124
+ "defaultValue": false
125
+ },
126
+ {
127
+ "id": "title",
128
+ "label": "Título",
129
+ "show": "{{titleEnabled}} === true",
130
+ "type": "text-input",
131
+ "required": true
132
+ },
133
+ {
134
+ "id": "titleTextFormat",
135
+ "label": "Título",
136
+ "show": "{{titleEnabled}} === true",
137
+ "type": "text-format",
138
+ "description": "Formato de texto para el título del gráfico."
139
+ },
140
+ {
141
+ "id": "titlePadding",
142
+ "label": "Márgenes de título",
143
+ "show": "{{titleEnabled}} === true",
144
+ "type": "text-input",
145
+ "description": "Márgenes para dar espacio en cada lado al título."
185
146
  },
186
147
  {
187
- "id": "marginSection",
188
- "label": "Márgenes",
189
- "type": "section",
190
- "labelContent": false,
191
- "muiIcon": "FitScreen",
148
+ "type": "label",
149
+ "label": "Leyenda"
150
+ },
151
+ {
152
+ "id": "legendEnabled",
153
+ "label": "Mostrar leyenda",
154
+ "type": "switch",
155
+ "defaultValue": false
156
+ },
157
+ {
158
+ "id": "legendTextFormat",
159
+ "label": "Leyenda",
160
+ "show": "{{legendEnabled}} === true",
161
+ "type": "text-format",
162
+ "description": "Formato de texto para la leyenda del gráfico."
163
+ },
164
+ {
165
+ "id": "legendPosition",
166
+ "label": "Posición de leyenda",
167
+ "show": "{{legendEnabled}} === true",
168
+ "type": "select-input",
192
169
  "items": [
193
170
  {
194
- "type": "block",
195
- "id": "marginBlock",
196
- "divider": false,
197
- "items": [
198
- {
199
- "id": "appMargin",
200
- "label": "",
201
- "type": "margin-input",
202
- "unit": "px",
203
- "defaultValue": {
204
- "top": 0,
205
- "left": 0,
206
- "bottom": 0,
207
- "right": 0
208
- }
209
- }
210
- ]
171
+ "label": "Izquierda",
172
+ "value": "left"
173
+ },
174
+ {
175
+ "label": "Derecha",
176
+ "value": "right"
211
177
  }
212
- ]
178
+ ],
179
+ "defaultValue": "left"
180
+ },
181
+ {
182
+ "id": "legendMargin",
183
+ "label": "Separación",
184
+ "show": "{{legendEnabled}} === true",
185
+ "type": "number-input",
186
+ "description": "Distancia (en px.) entre leyenda y gráfico"
187
+ },
188
+ {
189
+ "id": "circleSize",
190
+ "label": "Tamaño círculo",
191
+ "show": "{{legendEnabled}} === true",
192
+ "type": "number-input",
193
+ "description": "Tamaño (en px.) del cículo de color en la leyenda."
194
+ },
195
+ {
196
+ "type": "label",
197
+ "label": "Eje vertical"
198
+ },
199
+ {
200
+ "id": "yAxisEnabled",
201
+ "label": "Mostrar métricas",
202
+ "type": "switch",
203
+ "defaultValue": true
204
+ },
205
+ {
206
+ "id": "showVerticalGrid",
207
+ "label": "Mostrar líneas verticales",
208
+ "type": "switch",
209
+ "defaultValue": true
210
+ },
211
+ {
212
+ "type": "label",
213
+ "label": "Eje horizontal"
214
+ },
215
+ {
216
+ "id": "xAxisEnabled",
217
+ "label": "Mostrar métricas",
218
+ "type": "switch",
219
+ "defaultValue": true
220
+ },
221
+ {
222
+ "id": "showHorizontalGrid",
223
+ "label": "Mostrar líneas horizontales",
224
+ "type": "switch",
225
+ "defaultValue": true
226
+ }
227
+ ]
228
+ },
229
+ {
230
+ "id": "styleGroup",
231
+ "label": "Estilo",
232
+ "type": "group",
233
+ "items": [
234
+ {
235
+ "type": "label",
236
+ "label": "Contenido"
237
+ },
238
+ {
239
+ "id": "appPadding",
240
+ "label": "Márgenes de aplicación",
241
+ "type": "text-input",
242
+ "description": "Márgenes para dar espacio en cada lado."
243
+ },
244
+ {
245
+ "id": "backgroundImage",
246
+ "label": "Fondo",
247
+ "type": "select-asset-kna-input",
248
+ "extensions": [
249
+ "jpg",
250
+ "png"
251
+ ],
252
+ "multiple": false
253
+ },
254
+ {
255
+ "id": "customMessageEnabled",
256
+ "label": "Mostrar mensaje",
257
+ "type": "switch",
258
+ "defaultValue": false,
259
+ "displayOnTrue": "personalizado",
260
+ "displayOnFalse": "del sistema"
261
+ },
262
+ {
263
+ "id": "customMessage",
264
+ "label": "Mensaje personalizado",
265
+ "show": "{{customMessageEnabled}} === true",
266
+ "type": "text-input",
267
+ "description": "Mensaje para mostrar en caso de datos inexistentes.",
268
+ "required": true
269
+ },
270
+ {
271
+ "id": "systemMessageTextFormat",
272
+ "label": "Formato de mensaje",
273
+ "type": "text-format",
274
+ "description": "Formato de texto para mensaje del sistema/personalizado."
213
275
  }
214
276
  ]
215
277
  }
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@vixoniccom/kpi-chart",
3
3
  "alias": "KPI Chart",
4
- "description": "Muestra uno o más gráficos en rotación según indicadores KPI.",
4
+ "description": "Muestra un gráfico según indicadores KPI.",
5
5
  "color": "#009900",
6
6
  "license": "ISC",
7
7
  "tags": [],
8
8
  "author": {
9
9
  "name": "Lorenzo Alfaro Bravo"
10
10
  },
11
- "version": "0.0.2-dev.18",
11
+ "version": "0.0.2-dev.2",
12
12
  "scripts": {
13
- "prepublish": "vixonic-module-packager --mode=build",
13
+ "prepublishOnly": "vixonic-module-packager --mode=build",
14
14
  "watch": "vixonic-module-packager --mode=watch",
15
15
  "run": "vixonic-module-packager --mode=run",
16
16
  "configuration": "vixonic-module-packager --mode generate-configuration",
@@ -21,14 +21,15 @@
21
21
  },
22
22
  "dependencies": {
23
23
  "react": "^17.0.2",
24
+ "react-charts": "^3.0.0-beta.57",
24
25
  "react-dom": "^17.0.2",
25
26
  "react-loader-spinner": "^6.1.6"
26
27
  },
27
28
  "devDependencies": {
28
29
  "@types/react": "^17.0.2",
29
30
  "@types/react-dom": "^17.0.11",
30
- "@vixoniccom/module-packager": "2.15.0-dev.11",
31
- "@vixoniccom/modules": "2.27.0-dev.11",
31
+ "@vixoniccom/module-packager": "^2.13.0",
32
+ "@vixoniccom/modules": "^2.23.1",
32
33
  "standard-version": "^9.5.0"
33
34
  }
34
35
  }
@@ -1,2 +1 @@
1
- sonar.projectKey=Vixonic_store-sheets-kpi_12e7b95b-fc91-4f7e-a0e7-1dd33cc0de3d
2
- sonar.exclusions=.github/**/*
1
+ sonar.projectKey=Vixonic_store-sheets-kpi_12e7b95b-fc91-4f7e-a0e7-1dd33cc0de3d
@@ -1,20 +0,0 @@
1
- name: Deploy job
2
-
3
- on:
4
- pull_request:
5
- branches:
6
- - main
7
- types: [closed]
8
- workflow_dispatch:
9
-
10
- jobs:
11
- release:
12
- if: github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == true
13
- uses: Vixonic/github-workflows/.github/workflows/store-release.yml@d8dcbbbb14ef6f9b944ce0a079940fea4d7c9ba5 # main
14
- with:
15
- app-name: store-sheets-kpi
16
- secrets:
17
- PRIVATE_TOKEN_GITHUB: ${{ secrets.PRIVATE_TOKEN_GITHUB }}
18
- NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
19
- JIRA_TOKEN: ${{ secrets.JIRA_TOKEN }}
20
- EP_JIRA_COMPONENT: ${{ secrets.EP_JIRA_COMPONENT }}
@@ -1,146 +0,0 @@
1
- import {
2
- Block,
3
- ColorPicker,
4
- Group,
5
- MarginInput,
6
- Section,
7
- SelectAssetKna,
8
- SelectInput,
9
- Switch,
10
- TextFormat,
11
- } from "@vixoniccom/modules";
12
- import { ShowValidations } from "../utils";
13
-
14
- export const appearanceGroup = new Group({
15
- id: "appearanceGroup",
16
- label: "Apariencia",
17
- items: [
18
- new Section({
19
- id: 'designSection',
20
- label: 'Diseño',
21
- muiIcon: 'Brush',
22
- items: [
23
- new Block({
24
- id: 'designBlock',
25
- items: [
26
- new ColorPicker({
27
- id: 'backgroundColor',
28
- label: 'Color de fondo',
29
- description: 'Si subes una imagen de fondo, esta tapa el color.',
30
- }),
31
- new SelectAssetKna({
32
- id: 'backgroundImage',
33
- label: 'Imagen de fondo',
34
- extensions: ['jpg', 'png'],
35
- multiple: false,
36
- description: 'JPG o PNG 16:9. Usa imágenes sobrias para que el gráfico se lea.',
37
- pcOnly: true,
38
- }),
39
- ],
40
- }),
41
- ],
42
- }),
43
- new Section({
44
- id: 'colorsSection',
45
- label: 'Colores',
46
- muiIcon: 'ColorLens',
47
- items: [
48
- new Block({
49
- id: 'colorsBlock',
50
- items: [
51
- new Switch({
52
- id: 'showGuidelines',
53
- label: 'Mostrar líneas guía y eje',
54
- defaultValue: false
55
- }),
56
- new ColorPicker({
57
- id: 'guidelineColor',
58
- label: 'Líneas guía',
59
- show: ShowValidations.showGuidelines
60
- }),
61
- ],
62
- }),
63
- ],
64
- }),
65
- new Section({
66
- id: 'textSection',
67
- label: 'Texto',
68
- muiIcon: 'Title',
69
- items: [
70
- new Block({
71
- id: 'titleTextBlock',
72
- label: 'Título',
73
- description: 'Nombre del gráfico, arriba.',
74
- items: [
75
- new TextFormat({
76
- id: 'titleTypography',
77
- label: 'Tipografía',
78
- hidePicker: true,
79
- }),
80
- new SelectInput({
81
- id: 'titleAlignment',
82
- label: 'Alineación',
83
- items: [{ label: 'Izquierda', value: 'left' }, { label: 'Centro', value: 'center'}],
84
- defaultValue: 'left',
85
- inLine: true,
86
- }),
87
- new ColorPicker({
88
- id: 'titleFontColor',
89
- label: 'Color',
90
- }),
91
- ],
92
- }),
93
- new Block({
94
- id: 'tagTextBlock',
95
- label: 'Etiquetas',
96
- description: 'Categorías, leyenda y n´mero de los ejes.',
97
- items: [
98
- new TextFormat({
99
- id: 'tagsTypography',
100
- label: 'Tipografía',
101
- hidePicker: true,
102
- }),
103
- new ColorPicker({
104
- id: 'legendFontColor',
105
- label: 'Color',
106
- }),
107
- ],
108
- divider: true,
109
- }),
110
- new Block({
111
- id: 'valuesTextBlock',
112
- label: 'Valores',
113
- description: 'Cifra de cada barra, punto o porción.',
114
- items: [
115
- new TextFormat({
116
- id: 'valuesTypography',
117
- label: 'Tipografía',
118
- hidePicker: true,
119
- }),
120
- new ColorPicker({
121
- id: 'valuesFontColor',
122
- label: 'Color',
123
- }),
124
- ],
125
- divider: true,
126
- }),
127
- ],
128
- }),
129
- new Section({
130
- id: 'marginSection',
131
- label: 'Márgenes',
132
- muiIcon: 'FitScreen',
133
- items: [
134
- new Block({
135
- id: 'marginBlock',
136
- items: [
137
- new MarginInput({
138
- id: 'appMargin',
139
- defaultValue: { top: 0, left: 0, bottom: 0, right: 0 }
140
- }),
141
- ],
142
- }),
143
- ],
144
- }),
145
- ],
146
- })
package/renovate.json DELETED
@@ -1,4 +0,0 @@
1
- {
2
- "$schema": "https://docs.renovatebot.com/renovate-schema.json",
3
- "extends": ["github>Vixonic/renovate-config"]
4
- }