@circutor/charts 0.0.19 → 0.0.21

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.
Files changed (2) hide show
  1. package/package.json +3 -3
  2. package/readme.md +111 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@circutor/charts",
3
- "version": "0.0.19",
3
+ "version": "0.0.21",
4
4
  "description": "Stencil Component Starter",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -29,7 +29,7 @@
29
29
  },
30
30
  "repository": {
31
31
  "type": "git",
32
- "url": "https://github.com/ionic-team/stencil-component-starter.git"
32
+ "url": "https://gitlab.com/circutor/cloud/myc-web-charts.git"
33
33
  },
34
34
  "files": [
35
35
  "dist/",
@@ -56,5 +56,5 @@
56
56
  "puppeteer": "^21.9.0"
57
57
  },
58
58
  "license": "MIT",
59
- "gitHead": "63ce31f5a3364f8c13910b90c12f1cc95557ed80"
59
+ "gitHead": "e028b97d43fcb4704607349eed2e891fccecf907"
60
60
  }
package/readme.md CHANGED
@@ -1 +1,112 @@
1
1
  [![Built With Stencil](https://img.shields.io/badge/-Built%20With%20Stencil-16161d.svg?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjIuMSwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCA1MTIgNTEyIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1MTIgNTEyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI%2BCjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI%2BCgkuc3Qwe2ZpbGw6I0ZGRkZGRjt9Cjwvc3R5bGU%2BCjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik00MjQuNywzNzMuOWMwLDM3LjYtNTUuMSw2OC42LTkyLjcsNjguNkgxODAuNGMtMzcuOSwwLTkyLjctMzAuNy05Mi43LTY4LjZ2LTMuNmgzMzYuOVYzNzMuOXoiLz4KPHBhdGggY2xhc3M9InN0MCIgZD0iTTQyNC43LDI5Mi4xSDE4MC40Yy0zNy42LDAtOTIuNy0zMS05Mi43LTY4LjZ2LTMuNkgzMzJjMzcuNiwwLDkyLjcsMzEsOTIuNyw2OC42VjI5Mi4xeiIvPgo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNNDI0LjcsMTQxLjdIODcuN3YtMy42YzAtMzcuNiw1NC44LTY4LjYsOTIuNy02OC42SDMzMmMzNy45LDAsOTIuNywzMC43LDkyLjcsNjguNlYxNDEuN3oiLz4KPC9zdmc%2BCg%3D%3D&colorA=16161d&style=flat-square)](https://stenciljs.com)
2
+
3
+ ### MYC Charts
4
+
5
+ This repository aims to make the charts used by the Cloud team in their web applications accessible to the rest of the organization. This will facilitate their reuse, standardization, and maintenance across different projects.
6
+
7
+ ### How to Use
8
+
9
+ **Base Scenario**: We want to use the ITIC curve chart.
10
+
11
+ #### As a Web Component
12
+
13
+ To use the chart as a Web Component, simply import it from the CDN in your HTML code.
14
+
15
+ ```html
16
+ <script type="module" src="https://unpkg.com/@circutor/charts/dist/charts/charts.esm.js"></script>
17
+ <script nomodule src="https://unpkg.com/@circutor/charts/dist/charts/charts.js"></script>
18
+ ```
19
+
20
+ Then, you can directly insert the chart into your HTML:
21
+
22
+ ```html
23
+ <itic-chart
24
+ groups='[{"groupName":"L1,L2,L3","points":[{"duration":230,"voltage":93.46,"ts":"2024-06-26T20:23:45.220000+02:00"}],"color":"#00B388"},{"groupName":"L2","points":[{"duration":20,"voltage":0.4000000000000057,"ts":"2025-01-26T23:04:34.840000+01:00"}],"color":"#20262C"}]'
25
+ ></itic-chart>
26
+ ```
27
+
28
+ <details>
29
+ <summary>Complete example</summary>
30
+
31
+ ```html
32
+ <!DOCTYPE html>
33
+ <html lang="es">
34
+ <head>
35
+ <meta charset="UTF-8" />
36
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
37
+ <title>Charts</title>
38
+
39
+ <script type="module" src="https://unpkg.com/@circutor/charts/dist/charts/charts.esm.js"></script>
40
+ <script nomodule src="https://unpkg.com/@circutor/charts/dist/charts/charts.js"></script>
41
+
42
+ <style>
43
+ body {
44
+ font-family: Arial, sans-serif;
45
+ text-align: center;
46
+ padding: 20px;
47
+ }
48
+ mi-componente {
49
+ display: block;
50
+ margin-top: 20px;
51
+ }
52
+ </style>
53
+ </head>
54
+ <body>
55
+ <itic-chart
56
+ groups='[{"groupName":"L1,L2,L3","points":[{"duration":230,"voltage":93.46,"ts":"2024-06-26T20:23:45.220000+02:00"}],"color":"#00B388"},{"groupName":"L2","points":[{"duration":20,"voltage":0.4000000000000057,"ts":"2025-01-26T23:04:34.840000+01:00"}],"color":"#20262C"}]'
57
+ ></itic-chart>
58
+ </body>
59
+ </html>
60
+ ```
61
+
62
+ </details>
63
+
64
+ #### From a React Application
65
+
66
+ 1. **Install the package**
67
+ First, you need to install the `@circutor/charts-react` package in your project:
68
+
69
+ ```
70
+ npm install @circutor/charts-react
71
+ ```
72
+
73
+ 2. **Import the component**
74
+ Then, import the component into your React file:
75
+
76
+ ```javascript
77
+ import { IticChart } from '@circutor/charts-react';`>
78
+ ```
79
+
80
+ 3. **Use the component**
81
+ Now, you can use the chart in your application like any other React component. Just pass the necessary data and configurations:
82
+
83
+ ```html
84
+ <IticChart
85
+ groups={[
86
+ {
87
+ groupName: "L1,L2,L3",
88
+ points: [
89
+ {
90
+ duration: 230,
91
+ voltage: 93.46,
92
+ ts: "2024-06-26T20:23:45.220000+02:00",
93
+ },
94
+ ],
95
+ color: "#00B388",
96
+ },
97
+ {
98
+ groupName: "L2",
99
+ points: [
100
+ {
101
+ duration: 20,
102
+ voltage: 0.4000000000000057,
103
+ ts: "2025-01-26T23:04:34.840000+01:00",
104
+ },
105
+ ],
106
+ color: "#20262C",
107
+ },
108
+ ]}
109
+ ></IticChart>
110
+ ```
111
+
112
+ Remember to consult the documentation for each component for more details and configuration options.