playbook_ui_docs 14.21.2.pre.alpha.PLAY2233removetreemapchart8408 → 14.21.2.pre.alpha.PLAY2256stickydataidreact8446
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.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_columns.jsx +8 -8
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_columns_react.md +1 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns.jsx +12 -12
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns_react.md +3 -3
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_right_columns.jsx +12 -12
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_right_columns_react.md +3 -3
- data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_click_open.jsx +25 -0
- data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_click_open.md +1 -0
- data/app/pb_kits/playbook/pb_tooltip/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_tooltip/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_description.md +5 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_colors.html.erb +37 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_colors.jsx +48 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_colors.md +2 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_default.html.erb +37 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_default.jsx +47 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_default.md +3 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_drillable.html.erb +79 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_drillable.jsx +90 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_drillable.md +1 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_grouped_data.html.erb +54 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_grouped_data.jsx +65 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_grouped_data.md +3 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_tooltip.html.erb +37 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_tooltip.jsx +48 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_tooltip.md +3 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/example.yml +15 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/index.js +5 -0
- data/dist/playbook-doc.js +2 -2
- metadata +22 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ccb497fe105e5836b650d2cec01d095ca4ce7809007ebe26fc8422bed9854d36
|
4
|
+
data.tar.gz: b49d43a76251a0cf7659b1db47a538185ae630cc1fe0c8b95e15ec79848def15
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 641ce602e18b38fabfe899515a20aa2e76691f1f43abad6c7b214701f35abbe030ceb67f62c68feea7ece24e49a74957ca10e6767423288df4adde184e203220
|
7
|
+
data.tar.gz: 33468e09794e1c5c61c1672c11d3694187682b4d6f7a378d0f8eaf93ba5c59b063ca4835ad3ddf6bece1ca643ef5d8a9cbf1e4891c15e96cd9fe175dbd9e0f75
|
@@ -11,7 +11,7 @@ const TableStickyColumns = () => {
|
|
11
11
|
>
|
12
12
|
<thead>
|
13
13
|
<tr>
|
14
|
-
<th id="a">{'Column 1'}</th>
|
14
|
+
<th data-sticky-id="a">{'Column 1'}</th>
|
15
15
|
<th>{'Column 2'}</th>
|
16
16
|
<th>{'Column 3'}</th>
|
17
17
|
<th>{'Column 4'}</th>
|
@@ -25,12 +25,12 @@ const TableStickyColumns = () => {
|
|
25
25
|
<th>{'Column 12'}</th>
|
26
26
|
<th>{'Column 13'}</th>
|
27
27
|
<th>{'Column 14'}</th>
|
28
|
-
<th id="b">{'Column 15'}</th>
|
28
|
+
<th data-sticky-id="b">{'Column 15'}</th>
|
29
29
|
</tr>
|
30
30
|
</thead>
|
31
31
|
<tbody>
|
32
32
|
<tr>
|
33
|
-
<td id="a">{'Value 1'}</td>
|
33
|
+
<td data-sticky-id="a">{'Value 1'}</td>
|
34
34
|
<td>{'Value 2'}</td>
|
35
35
|
<td>{'Value 3'}</td>
|
36
36
|
<td>{'Value 4'}</td>
|
@@ -44,10 +44,10 @@ const TableStickyColumns = () => {
|
|
44
44
|
<td>{'Value 12'}</td>
|
45
45
|
<td>{'Value 13'}</td>
|
46
46
|
<td>{'Value 14'}</td>
|
47
|
-
<td id="b">{'Value 15'}</td>
|
47
|
+
<td data-sticky-id="b">{'Value 15'}</td>
|
48
48
|
</tr>
|
49
49
|
<tr>
|
50
|
-
<td id="a">{'Value 1'}</td>
|
50
|
+
<td data-sticky-id="a">{'Value 1'}</td>
|
51
51
|
<td>{'Value 2'}</td>
|
52
52
|
<td>{'Value 3'}</td>
|
53
53
|
<td>{'Value 4'}</td>
|
@@ -61,10 +61,10 @@ const TableStickyColumns = () => {
|
|
61
61
|
<td>{'Value 12'}</td>
|
62
62
|
<td>{'Value 13'}</td>
|
63
63
|
<td>{'Value 14'}</td>
|
64
|
-
<td id="b">{'Value 15'}</td>
|
64
|
+
<td data-sticky-id="b">{'Value 15'}</td>
|
65
65
|
</tr>
|
66
66
|
<tr>
|
67
|
-
<td id="a">{'Value 1'}</td>
|
67
|
+
<td data-sticky-id="a">{'Value 1'}</td>
|
68
68
|
<td>{'Value 2'}</td>
|
69
69
|
<td>{'Value 3'}</td>
|
70
70
|
<td>{'Value 4'}</td>
|
@@ -78,7 +78,7 @@ const TableStickyColumns = () => {
|
|
78
78
|
<td>{'Value 12'}</td>
|
79
79
|
<td>{'Value 13'}</td>
|
80
80
|
<td>{'Value 14'}</td>
|
81
|
-
<td id="b">{'Value 15'}</td>
|
81
|
+
<td data-sticky-id="b">{'Value 15'}</td>
|
82
82
|
</tr>
|
83
83
|
</tbody>
|
84
84
|
</Table>
|
@@ -1,3 +1,3 @@
|
|
1
1
|
The `stickyLeftColumn` and `stickyRightColumn` props can be used together on the same table as needed.
|
2
2
|
|
3
|
-
Please ensure that unique
|
3
|
+
Please ensure that unique `data-sticky-id`s are used for all columns across multiple tables. Using the same columns `data-sticky-id`s on multiple tables can lead to issues when using props.
|
@@ -10,9 +10,9 @@ const TableStickyLeftColumns = () => {
|
|
10
10
|
>
|
11
11
|
<thead>
|
12
12
|
<tr>
|
13
|
-
<th id="1">{'Column 1'}</th>
|
14
|
-
<th id="2">{'Column 2'}</th>
|
15
|
-
<th id="3">{'Column 3'}</th>
|
13
|
+
<th data-sticky-id="1">{'Column 1'}</th>
|
14
|
+
<th data-sticky-id="2">{'Column 2'}</th>
|
15
|
+
<th data-sticky-id="3">{'Column 3'}</th>
|
16
16
|
<th>{'Column 4'}</th>
|
17
17
|
<th>{'Column 5'}</th>
|
18
18
|
<th>{'Column 6'}</th>
|
@@ -29,9 +29,9 @@ const TableStickyLeftColumns = () => {
|
|
29
29
|
</thead>
|
30
30
|
<tbody>
|
31
31
|
<tr>
|
32
|
-
<td id="1">{'Value 1'}</td>
|
33
|
-
<td id="2">{'Value 2'}</td>
|
34
|
-
<td id="3">{'Value 3'}</td>
|
32
|
+
<td data-sticky-id="1">{'Value 1'}</td>
|
33
|
+
<td data-sticky-id="2">{'Value 2'}</td>
|
34
|
+
<td data-sticky-id="3">{'Value 3'}</td>
|
35
35
|
<td>{'Value 4'}</td>
|
36
36
|
<td>{'Value 5'}</td>
|
37
37
|
<td>{'Value 6'}</td>
|
@@ -46,9 +46,9 @@ const TableStickyLeftColumns = () => {
|
|
46
46
|
<td>{'Value 15'}</td>
|
47
47
|
</tr>
|
48
48
|
<tr>
|
49
|
-
<td id="1">{'Value 1'}</td>
|
50
|
-
<td id="2">{'Value 2'}</td>
|
51
|
-
<td id="3">{'Value 3'}</td>
|
49
|
+
<td data-sticky-id="1">{'Value 1'}</td>
|
50
|
+
<td data-sticky-id="2">{'Value 2'}</td>
|
51
|
+
<td data-sticky-id="3">{'Value 3'}</td>
|
52
52
|
<td>{'Value 4'}</td>
|
53
53
|
<td>{'Value 5'}</td>
|
54
54
|
<td>{'Value 6'}</td>
|
@@ -63,9 +63,9 @@ const TableStickyLeftColumns = () => {
|
|
63
63
|
<td>{'Value 15'}</td>
|
64
64
|
</tr>
|
65
65
|
<tr>
|
66
|
-
<td id="1">{'Value 1'}</td>
|
67
|
-
<td id="2">{'Value 2'}</td>
|
68
|
-
<td id="3">{'Value 3'}</td>
|
66
|
+
<td data-sticky-id="1">{'Value 1'}</td>
|
67
|
+
<td data-sticky-id="2">{'Value 2'}</td>
|
68
|
+
<td data-sticky-id="3">{'Value 3'}</td>
|
69
69
|
<td>{'Value 4'}</td>
|
70
70
|
<td>{'Value 5'}</td>
|
71
71
|
<td>{'Value 6'}</td>
|
@@ -1,5 +1,5 @@
|
|
1
|
-
The `stickyLeftColumn` prop expects an array of the column ids you want to be sticky. Make sure to add the corresponding id to the `<th>` and `<td>`.
|
1
|
+
The `stickyLeftColumn` prop expects an array of the column ids you want to be sticky. Make sure to add the corresponding `data-sticky-id` to the `<th>` and `<td>`.
|
2
2
|
|
3
|
-
If you are using the sub-component variant, then you will pass the id to `<Table.Header>` and `<Table.Cell>`
|
3
|
+
If you are using the sub-component variant, then you will pass the `data-sticky-id` to `<Table.Header>` and `<Table.Cell>`
|
4
4
|
|
5
|
-
Please ensure that unique
|
5
|
+
Please ensure that unique `data-sticky-id`s are used for all columns across multiple tables. Using the same columns `data-sticky-id`s on multiple tables can lead to issues when using `stickyLeftColumn` prop.
|
@@ -22,9 +22,9 @@ const TableStickyRightColumns = () => {
|
|
22
22
|
<th>{'Column 10'}</th>
|
23
23
|
<th>{'Column 11'}</th>
|
24
24
|
<th>{'Column 12'}</th>
|
25
|
-
<th id="13">{'Column 13'}</th>
|
26
|
-
<th id="14">{'Column 14'}</th>
|
27
|
-
<th id="15">{'Column 15'}</th>
|
25
|
+
<th data-sticky-id="13">{'Column 13'}</th>
|
26
|
+
<th data-sticky-id="14">{'Column 14'}</th>
|
27
|
+
<th data-sticky-id="15">{'Column 15'}</th>
|
28
28
|
</tr>
|
29
29
|
</thead>
|
30
30
|
<tbody>
|
@@ -41,9 +41,9 @@ const TableStickyRightColumns = () => {
|
|
41
41
|
<td>{'Value 10'}</td>
|
42
42
|
<td>{'Value 11'}</td>
|
43
43
|
<td>{'Value 12'}</td>
|
44
|
-
<td id="13">{'Value 13'}</td>
|
45
|
-
<td id="14">{'Value 14'}</td>
|
46
|
-
<td id="15">{'Value 15'}</td>
|
44
|
+
<td data-sticky-id="13">{'Value 13'}</td>
|
45
|
+
<td data-sticky-id="14">{'Value 14'}</td>
|
46
|
+
<td data-sticky-id="15">{'Value 15'}</td>
|
47
47
|
</tr>
|
48
48
|
<tr>
|
49
49
|
<td>{'Value 1'}</td>
|
@@ -58,9 +58,9 @@ const TableStickyRightColumns = () => {
|
|
58
58
|
<td>{'Value 10'}</td>
|
59
59
|
<td>{'Value 11'}</td>
|
60
60
|
<td>{'Value 12'}</td>
|
61
|
-
<td id="13">{'Value 13'}</td>
|
62
|
-
<td id="14">{'Value 14'}</td>
|
63
|
-
<td id="15">{'Value 15'}</td>
|
61
|
+
<td data-sticky-id="13">{'Value 13'}</td>
|
62
|
+
<td data-sticky-id="14">{'Value 14'}</td>
|
63
|
+
<td data-sticky-id="15">{'Value 15'}</td>
|
64
64
|
</tr>
|
65
65
|
<tr>
|
66
66
|
<td>{'Value 1'}</td>
|
@@ -75,9 +75,9 @@ const TableStickyRightColumns = () => {
|
|
75
75
|
<td>{'Value 10'}</td>
|
76
76
|
<td>{'Value 11'}</td>
|
77
77
|
<td>{'Value 12'}</td>
|
78
|
-
<td id="13">{'Value 13'}</td>
|
79
|
-
<td id="14">{'Value 14'}</td>
|
80
|
-
<td id="15">{'Value 15'}</td>
|
78
|
+
<td data-sticky-id="13">{'Value 13'}</td>
|
79
|
+
<td data-sticky-id="14">{'Value 14'}</td>
|
80
|
+
<td data-sticky-id="15">{'Value 15'}</td>
|
81
81
|
</tr>
|
82
82
|
</tbody>
|
83
83
|
</Table>
|
@@ -1,5 +1,5 @@
|
|
1
|
-
The `stickyRightColumn` prop works in the same way as the above `stickyLeftColumn` prop. It expects an array of the column
|
1
|
+
The `stickyRightColumn` prop works in the same way as the above `stickyLeftColumn` prop. It expects an array of the column `data-sticky-id`s you want to be sticky. Make sure to add the corresponding `data-sticky-id` to the `<th>` and `<td>`.
|
2
2
|
|
3
|
-
If you are using the sub-component variant, then you will pass the id to `<Table.Header>` and `<Table.Cell>`
|
3
|
+
If you are using the sub-component variant, then you will pass the `data-sticky-id` to `<Table.Header>` and `<Table.Cell>`
|
4
4
|
|
5
|
-
Please ensure that unique
|
5
|
+
Please ensure that unique `data-sticky-id`s are used for all columns across multiple tables. Using the same columns `data-sticky-id`s on multiple tables can lead to issues when using the `stickyRightColumn` prop.
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import Button from '../../pb_button/_button'
|
3
|
+
import Tooltip from '../_tooltip'
|
4
|
+
import Flex from '../../pb_flex/_flex'
|
5
|
+
|
6
|
+
const TooltipClickOpen = (props) => {
|
7
|
+
return (
|
8
|
+
<Flex flexDirection='row'
|
9
|
+
gap='md'
|
10
|
+
wrap
|
11
|
+
>
|
12
|
+
<Tooltip
|
13
|
+
placement='top'
|
14
|
+
text='Tooltip Opened'
|
15
|
+
useClickToOpen
|
16
|
+
zIndex={10}
|
17
|
+
{...props}
|
18
|
+
>
|
19
|
+
<Button text='Click to Open' />
|
20
|
+
</Tooltip>
|
21
|
+
</Flex>
|
22
|
+
)
|
23
|
+
}
|
24
|
+
|
25
|
+
export default TooltipClickOpen
|
@@ -0,0 +1 @@
|
|
1
|
+
Set the prop `useClickToOpen` so that the tooltip will only appear when an item is clicked rather than hovered over.
|
@@ -5,3 +5,4 @@ export { default as TooltipSizing } from './_tooltip_sizing'
|
|
5
5
|
export { default as TooltipIcon } from './_tooltip_icon'
|
6
6
|
export { default as TooltipDelay } from './_tooltip_delay'
|
7
7
|
export { default as TooltipShowTooltipReact } from './_tooltip_show_tooltip_react'
|
8
|
+
export { default as TooltipClickOpen } from './_tooltip_click_open'
|
@@ -0,0 +1,5 @@
|
|
1
|
+
Treemap charts are used to compare the relative size of groups of data. They can also use a nested data structure, allowing a user to drill down into a group to see its constituent data points.
|
2
|
+
|
3
|
+
The default height of treemap is 400px and can be changed. The default height is in pixel units, but can also use percentage string (percentage would be that of the width. For example, `height:"50%"` would mean that the height is 50% of the width). This allows for preserving the aspect ratio across responsive sizes.
|
4
|
+
|
5
|
+
For more information, see: <a href="https://api.highcharts.com/highcharts/chart.height" target="_blank"> highcharts/chart.height</a>.
|
@@ -0,0 +1,37 @@
|
|
1
|
+
<% data = [
|
2
|
+
{
|
3
|
+
name: "Pepperoni",
|
4
|
+
parent: "Toppings",
|
5
|
+
value: 600,
|
6
|
+
}, {
|
7
|
+
name: "Cheese",
|
8
|
+
parent: "Toppings",
|
9
|
+
value: 510,
|
10
|
+
}, {
|
11
|
+
name: "Mushroom",
|
12
|
+
parent: "Toppings",
|
13
|
+
value: 330,
|
14
|
+
},{
|
15
|
+
name: "Onions",
|
16
|
+
parent: "Toppings",
|
17
|
+
value: 250,
|
18
|
+
}, {
|
19
|
+
name: "Olives",
|
20
|
+
parent: "Toppings",
|
21
|
+
value: 204,
|
22
|
+
}, {
|
23
|
+
name: "Pineapple",
|
24
|
+
parent: "Toppings",
|
25
|
+
value: 90,
|
26
|
+
}, {
|
27
|
+
name: "Pizza Toppings",
|
28
|
+
id: "Toppings",
|
29
|
+
},
|
30
|
+
] %>
|
31
|
+
|
32
|
+
<%= pb_rails("treemap_chart", props: {
|
33
|
+
chart_data: data,
|
34
|
+
colors: ["data-4", "data-7", "#8E6E53", "#124732"],
|
35
|
+
id: "treemap-colors",
|
36
|
+
title: "Favored Pizza Toppings",
|
37
|
+
}) %>
|
@@ -0,0 +1,48 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
|
3
|
+
import TreemapChart from '../_treemap_chart'
|
4
|
+
|
5
|
+
const chartData = [
|
6
|
+
{
|
7
|
+
name: "Pepperoni",
|
8
|
+
parent: "Toppings",
|
9
|
+
value: 600,
|
10
|
+
}, {
|
11
|
+
name: "Cheese",
|
12
|
+
parent: "Toppings",
|
13
|
+
value: 510,
|
14
|
+
}, {
|
15
|
+
name: "Mushroom",
|
16
|
+
parent: "Toppings",
|
17
|
+
value: 330,
|
18
|
+
},{
|
19
|
+
name: "Onions",
|
20
|
+
parent: "Toppings",
|
21
|
+
value: 250,
|
22
|
+
}, {
|
23
|
+
name: "Olives",
|
24
|
+
parent: "Toppings",
|
25
|
+
value: 204,
|
26
|
+
}, {
|
27
|
+
name: "Pineapple",
|
28
|
+
parent: "Toppings",
|
29
|
+
value: 90,
|
30
|
+
}, {
|
31
|
+
name: "Pizza Toppings",
|
32
|
+
id: "Toppings",
|
33
|
+
},
|
34
|
+
]
|
35
|
+
|
36
|
+
const TreemapChartColors = (props) => (
|
37
|
+
<div>
|
38
|
+
<TreemapChart
|
39
|
+
chartData={chartData}
|
40
|
+
colors={["data-4", "data-7", "#8E6E53", "#124732"]}
|
41
|
+
id="treemap-colors"
|
42
|
+
title="Favored Pizza Toppings"
|
43
|
+
{...props}
|
44
|
+
/>
|
45
|
+
</div>
|
46
|
+
)
|
47
|
+
|
48
|
+
export default TreemapChartColors
|
@@ -0,0 +1,37 @@
|
|
1
|
+
<% data = [
|
2
|
+
{
|
3
|
+
name: "Pepperoni",
|
4
|
+
parent: "Toppings",
|
5
|
+
value: 600,
|
6
|
+
}, {
|
7
|
+
name: "Cheese",
|
8
|
+
parent: "Toppings",
|
9
|
+
value: 510,
|
10
|
+
}, {
|
11
|
+
name: "Mushroom",
|
12
|
+
parent: "Toppings",
|
13
|
+
value: 330,
|
14
|
+
},{
|
15
|
+
name: "Onions",
|
16
|
+
parent: "Toppings",
|
17
|
+
value: 250,
|
18
|
+
}, {
|
19
|
+
name: "Olives",
|
20
|
+
parent: "Toppings",
|
21
|
+
value: 204,
|
22
|
+
}, {
|
23
|
+
name: "Pineapple",
|
24
|
+
parent: "Toppings",
|
25
|
+
value: 90,
|
26
|
+
}, {
|
27
|
+
name: "Pizza Toppings",
|
28
|
+
id: "Toppings",
|
29
|
+
},
|
30
|
+
] %>
|
31
|
+
|
32
|
+
|
33
|
+
<%= pb_rails("treemap_chart", props: {
|
34
|
+
chart_data: data,
|
35
|
+
id: "treemap-default",
|
36
|
+
title: "Favored Pizza Toppings",
|
37
|
+
}) %>
|
@@ -0,0 +1,47 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
|
3
|
+
import TreemapChart from '../_treemap_chart'
|
4
|
+
|
5
|
+
const chartData = [
|
6
|
+
{
|
7
|
+
name: "Pepperoni",
|
8
|
+
parent: "Toppings",
|
9
|
+
value: 600,
|
10
|
+
}, {
|
11
|
+
name: "Cheese",
|
12
|
+
parent: "Toppings",
|
13
|
+
value: 510,
|
14
|
+
}, {
|
15
|
+
name: "Mushroom",
|
16
|
+
parent: "Toppings",
|
17
|
+
value: 330,
|
18
|
+
},{
|
19
|
+
name: "Onions",
|
20
|
+
parent: "Toppings",
|
21
|
+
value: 250,
|
22
|
+
}, {
|
23
|
+
name: "Olives",
|
24
|
+
parent: "Toppings",
|
25
|
+
value: 204,
|
26
|
+
}, {
|
27
|
+
name: "Pineapple",
|
28
|
+
parent: "Toppings",
|
29
|
+
value: 90,
|
30
|
+
}, {
|
31
|
+
name: "Pizza Toppings",
|
32
|
+
id: "Toppings",
|
33
|
+
},
|
34
|
+
]
|
35
|
+
|
36
|
+
const TreemapChartDefault = (props) => (
|
37
|
+
<div>
|
38
|
+
<TreemapChart
|
39
|
+
chartData={chartData}
|
40
|
+
id="treemap-default"
|
41
|
+
title="Favored Pizza Toppings"
|
42
|
+
{...props}
|
43
|
+
/>
|
44
|
+
</div>
|
45
|
+
)
|
46
|
+
|
47
|
+
export default TreemapChartDefault
|
@@ -0,0 +1,79 @@
|
|
1
|
+
<% data = [
|
2
|
+
{
|
3
|
+
name: "Evergreen",
|
4
|
+
id: "Evergreen",
|
5
|
+
color: "#0056CF",
|
6
|
+
}, {
|
7
|
+
name: "Pine",
|
8
|
+
id: "Pine",
|
9
|
+
parent: "Evergreen",
|
10
|
+
value: 300,
|
11
|
+
color: "#477BC4",
|
12
|
+
}, {
|
13
|
+
name: "Ponderosa Pine",
|
14
|
+
parent: "Pine",
|
15
|
+
value: 50,
|
16
|
+
}, {
|
17
|
+
name: "Scots Pine",
|
18
|
+
parent: "Pine",
|
19
|
+
value: 150,
|
20
|
+
}, {
|
21
|
+
name: "White Pine",
|
22
|
+
parent: "Pine",
|
23
|
+
value: 100,
|
24
|
+
}, {
|
25
|
+
name: "Douglas Fir",
|
26
|
+
parent: "Evergreen",
|
27
|
+
value: 150,
|
28
|
+
}, {
|
29
|
+
name: "Juniper",
|
30
|
+
parent: "Evergreen",
|
31
|
+
value: 80,
|
32
|
+
}, {
|
33
|
+
name: "Hemlock",
|
34
|
+
parent: "Evergreen",
|
35
|
+
value: 30,
|
36
|
+
}, {
|
37
|
+
name: "Deciduous",
|
38
|
+
id: "Deciduous",
|
39
|
+
color: "#F9BB00",
|
40
|
+
}, {
|
41
|
+
name: "Oak",
|
42
|
+
parent: "Deciduous",
|
43
|
+
value: 80,
|
44
|
+
}, {
|
45
|
+
name: "Maple",
|
46
|
+
id: "Maple",
|
47
|
+
parent: "Deciduous",
|
48
|
+
value: 180,
|
49
|
+
color: "#F7CE52",
|
50
|
+
}, {
|
51
|
+
name: "Red Maple",
|
52
|
+
parent: "Maple",
|
53
|
+
value: 80,
|
54
|
+
}, {
|
55
|
+
name: "Sugar Maple",
|
56
|
+
parent: "Maple",
|
57
|
+
value: 100,
|
58
|
+
}, {
|
59
|
+
name: "Beech",
|
60
|
+
parent: "Deciduous",
|
61
|
+
value: 50,
|
62
|
+
}, {
|
63
|
+
name: "Willow",
|
64
|
+
parent: "Deciduous",
|
65
|
+
value: 100,
|
66
|
+
}, {
|
67
|
+
name: "Juniper",
|
68
|
+
parent: "Deciduous",
|
69
|
+
value: 90,
|
70
|
+
},
|
71
|
+
] %>
|
72
|
+
|
73
|
+
<%= pb_rails("treemap_chart", props: {
|
74
|
+
chart_data: data,
|
75
|
+
drillable: true,
|
76
|
+
grouped: true,
|
77
|
+
id: "treemap-drillable",
|
78
|
+
title: "Drillable Grouped Tree Species",
|
79
|
+
}) %>
|
@@ -0,0 +1,90 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
|
3
|
+
import TreemapChart from '../_treemap_chart'
|
4
|
+
|
5
|
+
const chartData = [
|
6
|
+
{
|
7
|
+
name: "Evergreen",
|
8
|
+
id: "Evergreen",
|
9
|
+
color: "#0056CF",
|
10
|
+
}, {
|
11
|
+
name: "Pine",
|
12
|
+
id: "Pine",
|
13
|
+
parent: "Evergreen",
|
14
|
+
value: 300,
|
15
|
+
color: "#477BC4",
|
16
|
+
}, {
|
17
|
+
name: "Ponderosa Pine",
|
18
|
+
parent: "Pine",
|
19
|
+
value: 50,
|
20
|
+
}, {
|
21
|
+
name: "Scots Pine",
|
22
|
+
parent: "Pine",
|
23
|
+
value: 150,
|
24
|
+
}, {
|
25
|
+
name: "White Pine",
|
26
|
+
parent: "Pine",
|
27
|
+
value: 100,
|
28
|
+
}, {
|
29
|
+
name: "Douglas Fir",
|
30
|
+
parent: "Evergreen",
|
31
|
+
value: 150,
|
32
|
+
}, {
|
33
|
+
name: "Juniper",
|
34
|
+
parent: "Evergreen",
|
35
|
+
value: 80,
|
36
|
+
}, {
|
37
|
+
name: "Hemlock",
|
38
|
+
parent: "Evergreen",
|
39
|
+
value: 30,
|
40
|
+
}, {
|
41
|
+
name: "Deciduous",
|
42
|
+
id: "Deciduous",
|
43
|
+
color: "#F9BB00",
|
44
|
+
}, {
|
45
|
+
name: "Oak",
|
46
|
+
parent: "Deciduous",
|
47
|
+
value: 80,
|
48
|
+
}, {
|
49
|
+
name: "Maple",
|
50
|
+
id: "Maple",
|
51
|
+
parent: "Deciduous",
|
52
|
+
value: 180,
|
53
|
+
color: "#F7CE52",
|
54
|
+
}, {
|
55
|
+
name: "Red Maple",
|
56
|
+
parent: "Maple",
|
57
|
+
value: 80,
|
58
|
+
}, {
|
59
|
+
name: "Sugar Maple",
|
60
|
+
parent: "Maple",
|
61
|
+
value: 100,
|
62
|
+
}, {
|
63
|
+
name: "Beech",
|
64
|
+
parent: "Deciduous",
|
65
|
+
value: 50,
|
66
|
+
}, {
|
67
|
+
name: "Willow",
|
68
|
+
parent: "Deciduous",
|
69
|
+
value: 100,
|
70
|
+
}, {
|
71
|
+
name: "Juniper",
|
72
|
+
parent: "Deciduous",
|
73
|
+
value: 90,
|
74
|
+
},
|
75
|
+
]
|
76
|
+
|
77
|
+
const TreemapChartDrillable = (props) => (
|
78
|
+
<div>
|
79
|
+
<TreemapChart
|
80
|
+
chartData={chartData}
|
81
|
+
drillable
|
82
|
+
grouped
|
83
|
+
id="treemap-drillable"
|
84
|
+
title="Drillable Grouped Tree Species"
|
85
|
+
{...props}
|
86
|
+
/>
|
87
|
+
</div>
|
88
|
+
)
|
89
|
+
|
90
|
+
export default TreemapChartDrillable
|
@@ -0,0 +1 @@
|
|
1
|
+
Adding the `drillable` prop allows the tree to be traversed up and down by clicking into each box. Relationships are established through the `chartData`, detailed in the <a href="#treemap-grouped-data">Grouped Data section above</a>.
|
@@ -0,0 +1,54 @@
|
|
1
|
+
<% data = [
|
2
|
+
{
|
3
|
+
name: 'Meat',
|
4
|
+
id: 'Meat',
|
5
|
+
color: "#0056CF",
|
6
|
+
}, {
|
7
|
+
name: 'Pepperoni',
|
8
|
+
parent: 'Meat',
|
9
|
+
value: 250,
|
10
|
+
}, {
|
11
|
+
name: 'Meatball',
|
12
|
+
parent: 'Meat',
|
13
|
+
value: 400,
|
14
|
+
}, {
|
15
|
+
name: "Anchovy",
|
16
|
+
parent: 'Meat',
|
17
|
+
value: 40,
|
18
|
+
}, {
|
19
|
+
name: 'Vegetarian',
|
20
|
+
id: 'Vegetarian',
|
21
|
+
color: "#F9BB00",
|
22
|
+
}, {
|
23
|
+
name: 'Onions',
|
24
|
+
parent: 'Vegetarian',
|
25
|
+
value: 300,
|
26
|
+
}, {
|
27
|
+
name: 'Pineapple',
|
28
|
+
parent: 'Vegetarian',
|
29
|
+
value: 90,
|
30
|
+
}, {
|
31
|
+
name: "Peppers",
|
32
|
+
parent: 'Vegetarian',
|
33
|
+
value: 80,
|
34
|
+
}, {
|
35
|
+
name: "Specialty",
|
36
|
+
id: "Specialty",
|
37
|
+
color: "#9E64E9",
|
38
|
+
},{
|
39
|
+
name: "Buffalo Chicken",
|
40
|
+
parent: "Specialty",
|
41
|
+
value: 400,
|
42
|
+
}, {
|
43
|
+
name: "Supreme",
|
44
|
+
parent: "Specialty",
|
45
|
+
value: 150,
|
46
|
+
}
|
47
|
+
] %>
|
48
|
+
|
49
|
+
<%= pb_rails("treemap_chart", props: {
|
50
|
+
chart_data: data,
|
51
|
+
grouped: true,
|
52
|
+
id: "treemap-grouped",
|
53
|
+
title: "Grouped Toppings",
|
54
|
+
}) %>
|