@ansible/ansible-ui-framework 0.0.448 → 0.0.450

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,10 @@
1
+ /// <reference types="react" />
2
+ export declare function PageDashboardChart(props: {
3
+ groups: {
4
+ color: string;
5
+ values: {
6
+ label: string;
7
+ value: number;
8
+ }[];
9
+ }[];
10
+ }): JSX.Element;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __values = (this && this.__values) || function(o) {
14
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
15
+ if (m) return m.call(o);
16
+ if (o && typeof o.length === "number") return {
17
+ next: function () {
18
+ if (o && i >= o.length) o = void 0;
19
+ return { value: o && o[i++], done: !o };
20
+ }
21
+ };
22
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.PageDashboardChart = void 0;
26
+ var jsx_runtime_1 = require("react/jsx-runtime");
27
+ var react_charts_1 = require("@patternfly/react-charts");
28
+ var PageChartContainer_1 = require("./PageChartContainer");
29
+ function PageDashboardChart(props) {
30
+ var groups = props.groups;
31
+ groups = groups.filter(function (group) {
32
+ var e_1, _a;
33
+ try {
34
+ for (var _b = __values(group.values), _c = _b.next(); !_c.done; _c = _b.next()) {
35
+ var value = _c.value;
36
+ if (value.value !== 0)
37
+ return true;
38
+ }
39
+ }
40
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
41
+ finally {
42
+ try {
43
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
44
+ }
45
+ finally { if (e_1) throw e_1.error; }
46
+ }
47
+ return false;
48
+ });
49
+ return ((0, jsx_runtime_1.jsx)(PageChartContainer_1.PageChartContainer, { children: function (size) { return ((0, jsx_runtime_1.jsxs)(react_charts_1.Chart, __assign({ padding: { bottom: 27, left: 40, right: 0, top: 5 }, colorScale: groups.map(function (group) { return group.color; }), width: size.width, height: size.height, animate: true }, { children: [(0, jsx_runtime_1.jsx)(react_charts_1.ChartAxis, { fixLabelOverlap: true, tickFormat: function (date) { return "".concat(new Date(date).toLocaleDateString()); } }), (0, jsx_runtime_1.jsx)(react_charts_1.ChartAxis, { dependentAxis: true, showGrid: true }), (0, jsx_runtime_1.jsx)(react_charts_1.ChartStack, { children: groups.map(function (group, index) { return ((0, jsx_runtime_1.jsx)(react_charts_1.ChartArea, { data: group.values.map(function (value) { return ({ x: value.label, y: value.value }); }), interpolation: "monotoneX" }, index)); }) })] }))); } }));
50
+ }
51
+ exports.PageDashboardChart = PageDashboardChart;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ansible/ansible-ui-framework",
3
3
  "description": "A framework for building applications using PatternFly.",
4
- "version": "0.0.448",
4
+ "version": "0.0.450",
5
5
  "author": "Red Hat",
6
6
  "license": "MIT",
7
7
  "repository": {