@patternfly-java/charts 0.0.10 → 0.0.12
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/README.md +1 -0
- package/package.json +7 -7
- package/src/charts.js +2 -0
- package/src/components/pfj-chart-pie.js +46 -0
- package/dist/charts.js +0 -166
- package/dist/charts.js.map +0 -1
- package/dist/demo.html +0 -61254
package/README.md
CHANGED
|
@@ -12,6 +12,7 @@ The following web components are available:
|
|
|
12
12
|
- `<pfj-chart-donut-threshold>` → [`ChartDonutThreshold`](https://www.patternfly.org/charts/donut-utilization-chart#donut-utilization-threshold-examples)
|
|
13
13
|
- `<pfj-chart-donut-utilization>` → [`ChartDonutUtilization`](https://www.patternfly.org/charts/donut-utilization-chart#donut-utilization-examples)
|
|
14
14
|
- `<pfj-chart-bullet>` → [`ChartBullet`](https://www.patternfly.org/charts/bullet-chart)
|
|
15
|
+
- `<pfj-chart-pie>` → [`ChartPie`](https://www.patternfly.org/charts/pie-chart)
|
|
15
16
|
|
|
16
17
|
## Installation
|
|
17
18
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly-java/charts",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.12",
|
|
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.
|
|
25
|
+
"parcel": "^2.16.4",
|
|
26
26
|
"rimraf": "^6.1.2"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"lit": "^3.3.
|
|
30
|
-
"react": "^19.2.
|
|
31
|
-
"react-dom": "^19.2.
|
|
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.
|
|
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.
|
|
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';
|
|
@@ -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);
|