playbook_ui 11.12.0 → 11.12.1.pre.alpha.charts1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/index.js +0 -1
- data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.tsx +145 -0
- data/app/pb_kits/playbook/pb_button/_button.scss +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/ChartsTypes.ts +2 -0
- data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.tsx +216 -0
- data/app/pb_kits/playbook/pb_circle_chart/circle_chart.html.erb +9 -21
- data/app/pb_kits/playbook/pb_circle_chart/circle_chart.rb +7 -47
- data/app/pb_kits/playbook/pb_dashboard/pbChartsColorsHelper.ts +16 -0
- data/app/pb_kits/playbook/pb_dashboard/{pbChartsDarkTheme.js → pbChartsDarkTheme.ts} +6 -21
- data/app/pb_kits/playbook/pb_dashboard/{pbChartsLightTheme.js → pbChartsLightTheme.ts} +6 -21
- data/app/pb_kits/playbook/pb_dashboard/themeTypes.ts +16 -0
- data/app/pb_kits/playbook/pb_gauge/_gauge.scss +4 -0
- data/app/pb_kits/playbook/pb_gauge/_gauge.tsx +213 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_complex.html.erb +1 -1
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_complex.jsx +8 -8
- data/app/pb_kits/playbook/pb_gauge/gauge.html.erb +1 -11
- data/app/pb_kits/playbook/pb_gauge/gauge.rb +3 -8
- data/app/pb_kits/playbook/pb_line_graph/_line_graph.tsx +148 -0
- data/app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.tsx +111 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_tooltip.jsx +1 -1
- data/app/pb_kits/playbook/playbook-rails-react-bindings.js +4 -0
- data/app/pb_kits/playbook/playbook-rails.js +0 -4
- data/lib/playbook/version.rb +2 -2
- metadata +14 -12
- data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.jsx +0 -111
- data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.jsx +0 -151
- data/app/pb_kits/playbook/pb_gauge/_gauge.jsx +0 -112
- data/app/pb_kits/playbook/pb_line_graph/_line_graph.jsx +0 -113
- data/app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.jsx +0 -79
- data/app/pb_kits/playbook/plugins/pb_chart.js +0 -322
@@ -0,0 +1,213 @@
|
|
1
|
+
import React, { useState, useEffect, useRef } from "react";
|
2
|
+
import classnames from "classnames";
|
3
|
+
import HighchartsReact from "highcharts-react-official";
|
4
|
+
import Highcharts from "highcharts";
|
5
|
+
import { highchartsTheme } from "../pb_dashboard/pbChartsLightTheme";
|
6
|
+
import { highchartsDarkTheme } from "../pb_dashboard/pbChartsDarkTheme";
|
7
|
+
import mapColors from "../pb_dashboard/pbChartsColorsHelper";
|
8
|
+
import highchartsMore from "highcharts/highcharts-more";
|
9
|
+
import solidGauge from "highcharts/modules/solid-gauge";
|
10
|
+
import defaultColors from "../tokens/exports/_colors.scss";
|
11
|
+
import typography from "../tokens/exports/_typography.scss";
|
12
|
+
|
13
|
+
import { buildAriaProps, buildCss, buildDataProps } from "../utilities/props";
|
14
|
+
import { globalProps } from "../utilities/globalProps";
|
15
|
+
|
16
|
+
type GaugeProps = {
|
17
|
+
aria: { [key: string]: string };
|
18
|
+
className?: string;
|
19
|
+
chartData?: { name: string; value: number[] | number }[];
|
20
|
+
dark?: Boolean;
|
21
|
+
data?: { [key: string]: string };
|
22
|
+
disableAnimation?: boolean;
|
23
|
+
fullCircle?: boolean;
|
24
|
+
height?: string;
|
25
|
+
id?: string;
|
26
|
+
max?: number;
|
27
|
+
min?: number;
|
28
|
+
prefix?: string;
|
29
|
+
showLabels?: boolean;
|
30
|
+
style?: string;
|
31
|
+
suffix?: string;
|
32
|
+
title?: string;
|
33
|
+
tooltipHtml?: string;
|
34
|
+
colors: string[];
|
35
|
+
minorTickInterval: any;
|
36
|
+
circumference: number[];
|
37
|
+
};
|
38
|
+
|
39
|
+
const Gauge = ({
|
40
|
+
aria = {},
|
41
|
+
className,
|
42
|
+
chartData,
|
43
|
+
dark = false,
|
44
|
+
data = {},
|
45
|
+
disableAnimation = false,
|
46
|
+
fullCircle = false,
|
47
|
+
height = null,
|
48
|
+
id,
|
49
|
+
max = 100,
|
50
|
+
min = 0,
|
51
|
+
prefix = "",
|
52
|
+
showLabels = false,
|
53
|
+
style = "solidgauge",
|
54
|
+
suffix = "",
|
55
|
+
title = "",
|
56
|
+
tooltipHtml = '<span style="font-weight: bold; color:{point.color};">●</span>{point.name}: ' +
|
57
|
+
"<b>{point.y}</b>",
|
58
|
+
colors = [],
|
59
|
+
minorTickInterval = null,
|
60
|
+
circumference = fullCircle ? [0, 360] : [-100, 100],
|
61
|
+
...props
|
62
|
+
}: GaugeProps) => {
|
63
|
+
const ariaProps = buildAriaProps(aria);
|
64
|
+
const dataProps = buildDataProps(data);
|
65
|
+
highchartsMore(Highcharts);
|
66
|
+
solidGauge(Highcharts);
|
67
|
+
const setupTheme = () => {
|
68
|
+
dark
|
69
|
+
? Highcharts.setOptions(highchartsDarkTheme)
|
70
|
+
: Highcharts.setOptions(highchartsTheme);
|
71
|
+
};
|
72
|
+
setupTheme();
|
73
|
+
|
74
|
+
//set tooltip directly to prevent being overriden by Highcharts defaults
|
75
|
+
Highcharts.setOptions({
|
76
|
+
tooltip: {
|
77
|
+
pointFormat: tooltipHtml,
|
78
|
+
followPointer: true,
|
79
|
+
},
|
80
|
+
});
|
81
|
+
|
82
|
+
const css = buildCss({
|
83
|
+
pb_gauge_kit: true,
|
84
|
+
});
|
85
|
+
|
86
|
+
const componentDidMount = useRef(false);
|
87
|
+
const [options, setOptions] = useState({});
|
88
|
+
|
89
|
+
useEffect(() => {
|
90
|
+
const formattedChartData = chartData.map((obj: any) => {
|
91
|
+
obj.y = obj.value;
|
92
|
+
delete obj.value;
|
93
|
+
return obj;
|
94
|
+
});
|
95
|
+
|
96
|
+
const staticOptions = {
|
97
|
+
chart: {
|
98
|
+
events: {
|
99
|
+
load() {
|
100
|
+
setTimeout(this.reflow.bind(this), 0);
|
101
|
+
},
|
102
|
+
},
|
103
|
+
type: style,
|
104
|
+
height: height,
|
105
|
+
},
|
106
|
+
title: {
|
107
|
+
text: title,
|
108
|
+
},
|
109
|
+
yAxis: {
|
110
|
+
min: min,
|
111
|
+
max: max,
|
112
|
+
lineWidth: 0,
|
113
|
+
tickWidth: 0,
|
114
|
+
minorTickInterval: minorTickInterval,
|
115
|
+
tickAmount: 2,
|
116
|
+
tickPositions: [min, max],
|
117
|
+
labels: {
|
118
|
+
y: 26,
|
119
|
+
enabled: showLabels,
|
120
|
+
},
|
121
|
+
},
|
122
|
+
credits: false,
|
123
|
+
series: [
|
124
|
+
{
|
125
|
+
data: formattedChartData,
|
126
|
+
},
|
127
|
+
],
|
128
|
+
pane: {
|
129
|
+
center: ["50%", "50%"],
|
130
|
+
size: "90%",
|
131
|
+
startAngle: circumference[0],
|
132
|
+
endAngle: circumference[1],
|
133
|
+
background: {
|
134
|
+
borderWidth: 20,
|
135
|
+
innerRadius: "90%",
|
136
|
+
outerRadius: "90%",
|
137
|
+
shape: "arc",
|
138
|
+
className: "gauge-pane",
|
139
|
+
},
|
140
|
+
},
|
141
|
+
colors:
|
142
|
+
colors !== undefined && colors.length > 0
|
143
|
+
? mapColors(colors)
|
144
|
+
: highchartsTheme.colors,
|
145
|
+
plotOptions: {
|
146
|
+
series: {
|
147
|
+
animation: !disableAnimation,
|
148
|
+
},
|
149
|
+
solidgauge: {
|
150
|
+
borderColor:
|
151
|
+
colors !== undefined && colors.length === 1
|
152
|
+
? mapColors(colors).join()
|
153
|
+
: highchartsTheme.colors[0],
|
154
|
+
borderWidth: 20,
|
155
|
+
radius: 90,
|
156
|
+
innerRadius: "90%",
|
157
|
+
dataLabels: {
|
158
|
+
borderWidth: 0,
|
159
|
+
color: defaultColors.text_lt_default,
|
160
|
+
enabled: true,
|
161
|
+
format:
|
162
|
+
`<span class="prefix">${prefix}</span>` +
|
163
|
+
'<span class="fix">{y:,f}</span>' +
|
164
|
+
`<span class="suffix">${suffix}</span>`,
|
165
|
+
style: {
|
166
|
+
fontFamily: typography.font_family_base,
|
167
|
+
fontWeight: typography.regular,
|
168
|
+
fontSize: typography.heading_2,
|
169
|
+
},
|
170
|
+
y: -26,
|
171
|
+
},
|
172
|
+
},
|
173
|
+
},
|
174
|
+
};
|
175
|
+
|
176
|
+
setOptions({ ...staticOptions });
|
177
|
+
|
178
|
+
if (document.querySelector(".prefix")) {
|
179
|
+
document.querySelectorAll(".prefix").forEach((prefix) => {
|
180
|
+
prefix.setAttribute("y", "28");
|
181
|
+
});
|
182
|
+
document
|
183
|
+
.querySelectorAll(".fix")
|
184
|
+
.forEach((fix) => fix.setAttribute("y", "38"));
|
185
|
+
}
|
186
|
+
|
187
|
+
if (componentDidMount.current) {
|
188
|
+
Highcharts.charts.forEach((chart: any) => {
|
189
|
+
if (chart && chart.renderTo.id === id) {
|
190
|
+
chart.series[0].setData([chartData[0].value]);
|
191
|
+
chart.series[0].data[0].name = chartData[0].name;
|
192
|
+
}
|
193
|
+
});
|
194
|
+
} else {
|
195
|
+
componentDidMount.current = true;
|
196
|
+
}
|
197
|
+
}, [chartData]);
|
198
|
+
|
199
|
+
return (
|
200
|
+
<HighchartsReact
|
201
|
+
containerProps={{
|
202
|
+
className: classnames(css, globalProps(props)),
|
203
|
+
id: id,
|
204
|
+
...ariaProps,
|
205
|
+
...dataProps,
|
206
|
+
}}
|
207
|
+
highcharts={Highcharts}
|
208
|
+
options={options}
|
209
|
+
/>
|
210
|
+
);
|
211
|
+
};
|
212
|
+
|
213
|
+
export default Gauge;
|
@@ -71,26 +71,26 @@ const GaugeComplex = (props) => (
|
|
71
71
|
orientation="column"
|
72
72
|
wrap
|
73
73
|
>
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
74
|
+
<Body
|
75
|
+
color="light"
|
76
|
+
text="% Abandoned"
|
77
|
+
/>
|
78
78
|
<Flex wrap>
|
79
79
|
<FlexItem
|
80
80
|
fixedSize="150px"
|
81
81
|
overflow="hidden"
|
82
82
|
shrink
|
83
|
-
>
|
83
|
+
>
|
84
84
|
<Gauge
|
85
85
|
chartData={data}
|
86
86
|
disableAnimation
|
87
|
-
height="
|
87
|
+
height="150"
|
88
88
|
id="gauge-complex"
|
89
89
|
suffix="%"
|
90
90
|
{...props}
|
91
91
|
/>
|
92
|
-
|
93
|
-
</Flex>
|
92
|
+
</FlexItem>
|
93
|
+
</Flex>
|
94
94
|
</Flex>
|
95
95
|
</Flex>
|
96
96
|
</Card>
|
@@ -1,12 +1,2 @@
|
|
1
|
-
<%=
|
2
|
-
id: object.id,
|
3
|
-
data: object.data,
|
4
|
-
class: object.classname) %>
|
5
|
-
<% content_for :pb_js do %>
|
6
|
-
<%= javascript_tag do %>
|
7
|
-
window.addEventListener('DOMContentLoaded', function() {
|
8
|
-
new pbChart('.selector', <%= object.chart_options %>)
|
9
|
-
})
|
10
|
-
<% end %>
|
11
|
-
<% end %>
|
1
|
+
<%= react_component('Gauge', object.chart_options) %>
|
12
2
|
|
@@ -22,15 +22,10 @@ module Playbook
|
|
22
22
|
prop :max, type: Playbook::Props::Numeric, default: 100
|
23
23
|
prop :colors, type: Playbook::Props::Array, default: []
|
24
24
|
|
25
|
-
def chart_data_formatted
|
26
|
-
chart_data.map { |hash| hash[:y] = hash.delete :value }
|
27
|
-
chart_data
|
28
|
-
end
|
29
|
-
|
30
25
|
def chart_options
|
31
26
|
{
|
32
27
|
id: id,
|
33
|
-
chartData:
|
28
|
+
chartData: chart_data,
|
34
29
|
circumference: full_circle ? [0, 360] : [-100, 100],
|
35
30
|
dark: dark ? "dark" : "",
|
36
31
|
disableAnimation: disable_animation,
|
@@ -43,9 +38,9 @@ module Playbook
|
|
43
38
|
showLabels: show_labels,
|
44
39
|
style: style,
|
45
40
|
tooltipHtml: tooltip_html,
|
46
|
-
type:
|
41
|
+
type: style,
|
47
42
|
colors: colors,
|
48
|
-
}
|
43
|
+
}
|
49
44
|
end
|
50
45
|
|
51
46
|
def classname
|
@@ -0,0 +1,148 @@
|
|
1
|
+
import React, { useState, useEffect } from "react";
|
2
|
+
import classnames from "classnames";
|
3
|
+
import { globalProps } from "../utilities/globalProps";
|
4
|
+
import { buildAriaProps, buildDataProps } from "../utilities/props";
|
5
|
+
|
6
|
+
import HighchartsReact from "highcharts-react-official";
|
7
|
+
import Highcharts from "highcharts";
|
8
|
+
import { highchartsTheme } from "../pb_dashboard/pbChartsLightTheme";
|
9
|
+
import { highchartsDarkTheme } from "../pb_dashboard/pbChartsDarkTheme";
|
10
|
+
import mapColors from "../pb_dashboard/pbChartsColorsHelper";
|
11
|
+
|
12
|
+
type LineGraphProps = {
|
13
|
+
align?: "left" | "right" | "center";
|
14
|
+
axisTitle?: string;
|
15
|
+
dark?: Boolean;
|
16
|
+
xAxisCategories: [];
|
17
|
+
yAxisMin: number;
|
18
|
+
yAxisMax: number;
|
19
|
+
className?: string;
|
20
|
+
chartData: {
|
21
|
+
name: string;
|
22
|
+
data: number[];
|
23
|
+
}[];
|
24
|
+
gradient?: boolean;
|
25
|
+
id: string;
|
26
|
+
pointStart: number;
|
27
|
+
subTitle?: string;
|
28
|
+
title: string;
|
29
|
+
type?: string;
|
30
|
+
legend?: boolean;
|
31
|
+
toggleLegendClick?: boolean;
|
32
|
+
height?: string;
|
33
|
+
colors: string[];
|
34
|
+
layout?: "horizontal" | "vertical" | "proximate";
|
35
|
+
verticalAlign?: "top" | "middle" | "bottom";
|
36
|
+
x?: number;
|
37
|
+
y?: number;
|
38
|
+
aria?: { [key: string]: string };
|
39
|
+
data?: { [key: string]: string };
|
40
|
+
};
|
41
|
+
|
42
|
+
const LineGraph = ({
|
43
|
+
aria = {},
|
44
|
+
data = {},
|
45
|
+
align = "center",
|
46
|
+
className = "pb_bar_graph",
|
47
|
+
dark = false,
|
48
|
+
gradient = false,
|
49
|
+
type = "line",
|
50
|
+
id,
|
51
|
+
legend = false,
|
52
|
+
toggleLegendClick = true,
|
53
|
+
layout = "horizontal",
|
54
|
+
verticalAlign = "bottom",
|
55
|
+
x = 0,
|
56
|
+
y = 0,
|
57
|
+
axisTitle,
|
58
|
+
xAxisCategories,
|
59
|
+
yAxisMin,
|
60
|
+
yAxisMax,
|
61
|
+
chartData,
|
62
|
+
pointStart,
|
63
|
+
subTitle,
|
64
|
+
title,
|
65
|
+
height,
|
66
|
+
colors = [],
|
67
|
+
...props
|
68
|
+
}: LineGraphProps) => {
|
69
|
+
const ariaProps = buildAriaProps(aria);
|
70
|
+
const dataProps = buildDataProps(data);
|
71
|
+
const setupTheme = () => {
|
72
|
+
dark
|
73
|
+
? Highcharts.setOptions(highchartsDarkTheme)
|
74
|
+
: Highcharts.setOptions(highchartsTheme);
|
75
|
+
};
|
76
|
+
setupTheme();
|
77
|
+
|
78
|
+
const staticOptions = {
|
79
|
+
title: {
|
80
|
+
text: title,
|
81
|
+
},
|
82
|
+
chart: {
|
83
|
+
height: height,
|
84
|
+
type: type,
|
85
|
+
},
|
86
|
+
subtitle: {
|
87
|
+
text: subTitle,
|
88
|
+
},
|
89
|
+
yAxis: {
|
90
|
+
min: yAxisMin,
|
91
|
+
max: yAxisMax,
|
92
|
+
title: {
|
93
|
+
text: axisTitle,
|
94
|
+
},
|
95
|
+
},
|
96
|
+
xAxis: {
|
97
|
+
categories: xAxisCategories,
|
98
|
+
},
|
99
|
+
legend: {
|
100
|
+
enabled: legend,
|
101
|
+
align: align,
|
102
|
+
verticalAlign: verticalAlign,
|
103
|
+
layout: layout,
|
104
|
+
x: x,
|
105
|
+
y: y,
|
106
|
+
},
|
107
|
+
colors:
|
108
|
+
colors !== undefined && colors.length > 0
|
109
|
+
? mapColors(colors)
|
110
|
+
: highchartsTheme.colors,
|
111
|
+
plotOptions: {
|
112
|
+
series: {
|
113
|
+
pointStart: pointStart,
|
114
|
+
events: {},
|
115
|
+
dataLabels: {
|
116
|
+
enabled: false,
|
117
|
+
},
|
118
|
+
},
|
119
|
+
},
|
120
|
+
series: chartData,
|
121
|
+
credits: false,
|
122
|
+
};
|
123
|
+
|
124
|
+
if (!toggleLegendClick) {
|
125
|
+
staticOptions.plotOptions.series.events = { legendItemClick: () => false };
|
126
|
+
}
|
127
|
+
|
128
|
+
const [options, setOptions] = useState({});
|
129
|
+
|
130
|
+
useEffect(() => {
|
131
|
+
setOptions({ ...staticOptions });
|
132
|
+
}, [chartData]);
|
133
|
+
|
134
|
+
return (
|
135
|
+
<HighchartsReact
|
136
|
+
containerProps={{
|
137
|
+
className: classnames(globalProps(props), className),
|
138
|
+
id: id,
|
139
|
+
...ariaProps,
|
140
|
+
...dataProps,
|
141
|
+
}}
|
142
|
+
highcharts={Highcharts}
|
143
|
+
options={options}
|
144
|
+
/>
|
145
|
+
);
|
146
|
+
};
|
147
|
+
|
148
|
+
export default LineGraph;
|
@@ -0,0 +1,111 @@
|
|
1
|
+
import React, { useState, useEffect } from "react";
|
2
|
+
import classnames from "classnames";
|
3
|
+
|
4
|
+
import { globalProps } from "../utilities/globalProps";
|
5
|
+
import { buildAriaProps, buildDataProps } from "../utilities/props";
|
6
|
+
|
7
|
+
import HighchartsReact from "highcharts-react-official";
|
8
|
+
import Highcharts from "highcharts";
|
9
|
+
import { highchartsTheme } from "../pb_dashboard/pbChartsLightTheme";
|
10
|
+
import { highchartsDarkTheme } from "../pb_dashboard/pbChartsDarkTheme";
|
11
|
+
import mapColors from "../pb_dashboard/pbChartsColorsHelper";
|
12
|
+
import treemap from 'highcharts/modules/treemap'
|
13
|
+
|
14
|
+
type TreemapChartProps = {
|
15
|
+
chartData: {
|
16
|
+
name: string;
|
17
|
+
parent?: string | number;
|
18
|
+
value: number;
|
19
|
+
color?: string;
|
20
|
+
id?: string | number;
|
21
|
+
}[];
|
22
|
+
className?: string;
|
23
|
+
colors: string[];
|
24
|
+
dark?: boolean;
|
25
|
+
drillable: boolean;
|
26
|
+
grouped: boolean;
|
27
|
+
height?: string;
|
28
|
+
id: number | string;
|
29
|
+
title?: string;
|
30
|
+
tooltipHtml: string;
|
31
|
+
type?: string;
|
32
|
+
aria?: { [key: string]: string };
|
33
|
+
data?: { [key: string]: string };
|
34
|
+
};
|
35
|
+
|
36
|
+
const TreemapChart = ({
|
37
|
+
aria = {},
|
38
|
+
data = {},
|
39
|
+
chartData,
|
40
|
+
colors,
|
41
|
+
dark = false,
|
42
|
+
drillable = false,
|
43
|
+
grouped = false,
|
44
|
+
height,
|
45
|
+
id,
|
46
|
+
title = "",
|
47
|
+
tooltipHtml = '<span style="font-weight: bold; color:{point.color};">●</span>{point.name}: <b>{point.value}</b>',
|
48
|
+
type = "treemap",
|
49
|
+
...props
|
50
|
+
}: TreemapChartProps) => {
|
51
|
+
const ariaProps = buildAriaProps(aria);
|
52
|
+
const dataProps = buildDataProps(data);
|
53
|
+
const setupTheme = () => {
|
54
|
+
dark
|
55
|
+
? Highcharts.setOptions(highchartsDarkTheme)
|
56
|
+
: Highcharts.setOptions(highchartsTheme);
|
57
|
+
};
|
58
|
+
treemap(Highcharts)
|
59
|
+
setupTheme();
|
60
|
+
|
61
|
+
const staticOptions = {
|
62
|
+
title: {
|
63
|
+
text: title,
|
64
|
+
},
|
65
|
+
chart: {
|
66
|
+
height: height,
|
67
|
+
type: type,
|
68
|
+
},
|
69
|
+
credits: false,
|
70
|
+
series: [
|
71
|
+
{
|
72
|
+
data: chartData,
|
73
|
+
},
|
74
|
+
],
|
75
|
+
plotOptions: {
|
76
|
+
treemap: {
|
77
|
+
tooltip: {
|
78
|
+
pointFormat: tooltipHtml,
|
79
|
+
},
|
80
|
+
allowTraversingTree: drillable,
|
81
|
+
colorByPoint: !grouped,
|
82
|
+
colors:
|
83
|
+
colors !== undefined && colors.length > 0
|
84
|
+
? mapColors(colors)
|
85
|
+
: highchartsTheme.colors,
|
86
|
+
},
|
87
|
+
},
|
88
|
+
};
|
89
|
+
|
90
|
+
const [options, setOptions] = useState({});
|
91
|
+
|
92
|
+
useEffect(() => {
|
93
|
+
|
94
|
+
setOptions({ ...staticOptions });
|
95
|
+
}, [chartData]);
|
96
|
+
|
97
|
+
return (
|
98
|
+
<HighchartsReact
|
99
|
+
containerProps={{
|
100
|
+
className: classnames(globalProps(props), "pb_treemap_chart"),
|
101
|
+
id: id,
|
102
|
+
...ariaProps,
|
103
|
+
...dataProps,
|
104
|
+
}}
|
105
|
+
highcharts={Highcharts}
|
106
|
+
options={options}
|
107
|
+
/>
|
108
|
+
);
|
109
|
+
};
|
110
|
+
|
111
|
+
export default TreemapChart;
|
@@ -39,7 +39,7 @@ const TreemapChartTooltip = (props) => (
|
|
39
39
|
chartData={chartData}
|
40
40
|
id="treemap-tooltip"
|
41
41
|
title="Favored Pizza Toppings"
|
42
|
-
tooltipHtml=
|
42
|
+
tooltipHtml= '<p>Custom tooltip for {point.name} <br/>with value: {point.value}</p>'
|
43
43
|
{...props}
|
44
44
|
/>
|
45
45
|
</div>
|
@@ -4,11 +4,13 @@ import WebpackerReact from 'webpacker-react'
|
|
4
4
|
import ujs from 'webpacker-react/ujs'
|
5
5
|
|
6
6
|
import BarGraph from './pb_bar_graph/_bar_graph'
|
7
|
+
import CircleChart from './pb_circle_chart/_circle_chart'
|
7
8
|
import Dialog from './pb_dialog/_dialog'
|
8
9
|
import DialogBody from './pb_dialog/child_kits/_dialog_body'
|
9
10
|
import DialogFooter from './pb_dialog/child_kits/_dialog_footer'
|
10
11
|
import DialogHeader from './pb_dialog/child_kits/_dialog_header'
|
11
12
|
import DistributionBar from './pb_distribution_bar/_distribution_bar'
|
13
|
+
import Gauge from './pb_gauge/_gauge'
|
12
14
|
import Legend from './pb_legend/_legend'
|
13
15
|
import LineGraph from './pb_line_graph/_line_graph'
|
14
16
|
import Passphrase from './pb_passphrase/_passphrase'
|
@@ -18,6 +20,7 @@ import Typeahead from './pb_typeahead/_typeahead'
|
|
18
20
|
|
19
21
|
WebpackerReact.registerComponents({
|
20
22
|
BarGraph,
|
23
|
+
CircleChart,
|
21
24
|
Dialog,
|
22
25
|
DialogBody,
|
23
26
|
DialogFooter,
|
@@ -29,6 +32,7 @@ WebpackerReact.registerComponents({
|
|
29
32
|
RichTextEditor,
|
30
33
|
TreemapChart,
|
31
34
|
Typeahead,
|
35
|
+
Gauge,
|
32
36
|
})
|
33
37
|
|
34
38
|
ujs.setup(
|
data/lib/playbook/version.rb
CHANGED