@patternfly-java/charts 0.0.9 → 0.0.11

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@patternfly-java/charts",
3
3
  "private": false,
4
- "version": "0.0.9",
4
+ "version": "0.0.11",
5
5
  "description": "Web Components wrapper around PatternFly React Charts",
6
6
  "homepage": "https://patternfly-java.github.io/",
7
7
  "repository": {
@@ -22,18 +22,18 @@
22
22
  "clean": "rimraf .parcel-cache dist"
23
23
  },
24
24
  "devDependencies": {
25
- "parcel": "^2.16.3",
25
+ "parcel": "^2.16.4",
26
26
  "rimraf": "^6.1.2"
27
27
  },
28
28
  "dependencies": {
29
- "lit": "^3.3.1",
30
- "react": "^19.2.3",
31
- "react-dom": "^19.2.3",
29
+ "lit": "^3.3.2",
30
+ "react": "^19.2.4",
31
+ "react-dom": "^19.2.4",
32
32
  "hoist-non-react-statics": "^3.3.2",
33
- "@patternfly/react-charts": "^8.4.0",
33
+ "@patternfly/react-charts": "^8.4.1",
34
34
  "@patternfly/react-styles": "^6.4.0",
35
35
  "@patternfly/react-tokens": "^6.4.0",
36
- "lodash": "^4.17.21",
36
+ "lodash": "^4.17.23",
37
37
  "tslib": "^2.8.1",
38
38
  "victory-area": "^37.3.6",
39
39
  "victory-axis": "^37.3.6",
package/src/charts.js CHANGED
@@ -23,8 +23,10 @@ import './components/pfj-chart-bullet.js';
23
23
  import './components/pfj-chart-donut.js';
24
24
  import './components/pfj-chart-donut-utilization.js';
25
25
  import './components/pfj-chart-donut-threshold.js';
26
+ import './components/pfj-chart-pie.js';
26
27
 
27
28
  export {ChartBulletWebComponent} from './components/pfj-chart-bullet.js';
28
29
  export {ChartDonutWebComponent} from './components/pfj-chart-donut.js';
29
30
  export {ChartDonutUtilizationWebComponent} from './components/pfj-chart-donut-utilization.js';
30
31
  export {ChartDonutThresholdWebComponent} from './components/pfj-chart-donut-threshold.js';
32
+ export {ChartPieWebComponent} from './components/pfj-chart-pie.js';
@@ -55,6 +55,9 @@ export class ChartBulletWebComponent extends ReactWrapperElement {
55
55
  } else if (this.getAttribute('comparative-warning-measure-legend-data')) {
56
56
  extraProps.comparativeWarningMeasureLegendData = parseAttrValue('comparative-warning-measure-legend-data', this.getAttribute('comparative-warning-measure-legend-data'));
57
57
  }
58
+ if (this._maxDomain !== undefined) {
59
+ extraProps.maxDomain = Number(this._maxDomain);
60
+ }
58
61
  if (this._primaryDotMeasureData && typeof this._primaryDotMeasureData !== 'string') {
59
62
  extraProps.primaryDotMeasureData = this._primaryDotMeasureData;
60
63
  } else if (this.getAttribute('primary-dot-measure-data')) {
@@ -0,0 +1,46 @@
1
+ /*
2
+ * Copyright 2023 Red Hat
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * https://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import {parseAttrValue, ReactWrapperElement} from '../react-wrapper.js';
17
+ import { ChartPie } from '@patternfly/react-charts/victory';
18
+
19
+ export class ChartPieWebComponent extends ReactWrapperElement {
20
+
21
+ constructor() {
22
+ super();
23
+ this._colorScale = undefined;
24
+ }
25
+
26
+ getReactComponent() {
27
+ const extraProps = {};
28
+ if (this._colorScale && typeof this._colorScale !== 'string') {
29
+ extraProps.colorScale = this._colorScale;
30
+ } else if (this.getAttribute('color-scale')) {
31
+ extraProps.colorScale = parseAttrValue('color-scale', this.getAttribute('color-scale'));
32
+ }
33
+ return [ChartPie, extraProps];
34
+ }
35
+
36
+ get colorScale() {
37
+ return this._colorScale;
38
+ }
39
+
40
+ set colorScale(value) {
41
+ this._colorScale = value;
42
+ this._notifyChange();
43
+ }
44
+ }
45
+
46
+ customElements.define('pfj-chart-pie', ChartPieWebComponent);
@@ -94,7 +94,6 @@ export class ReactWrapperElement extends LitElement {
94
94
  this._data = undefined; // any | any[]
95
95
  this._height = undefined; // number
96
96
  this._labels = undefined; // (data: any) => string
97
- this._legendAllowWrap = undefined; // boolean
98
97
  this._legendData = undefined; // { name?: string; symbol?: { fill?: string; type?: string; }; }[]
99
98
  this._legendOrientation = undefined; // string
100
99
  this._legendPosition = undefined; // string
@@ -261,15 +260,6 @@ export class ReactWrapperElement extends LitElement {
261
260
  this._notifyChange();
262
261
  }
263
262
 
264
- get legendAllowWrap() {
265
- return this._legendAllowWrap;
266
- }
267
-
268
- set legendAllowWrap(value) {
269
- this._legendAllowWrap = value;
270
- this._notifyChange();
271
- }
272
-
273
263
  get legendData() {
274
264
  return this._legendData;
275
265
  }
@@ -369,9 +359,6 @@ export class ReactWrapperElement extends LitElement {
369
359
  if (this._labels !== undefined) {
370
360
  commonProps.labels = this._labels;
371
361
  }
372
- if (this._legendAllowWrap !== undefined) {
373
- commonProps.legendAllowWrap = this._legendAllowWrap;
374
- }
375
362
  if (this._legendData && typeof this._legendData !== 'string') {
376
363
  commonProps.legendData = this._legendData;
377
364
  } else if (this.getAttribute('legend-data')) {