playbook_ui_docs 13.22.0.pre.alpha.playbookgemspecrailsversion2608 → 13.23.0.pre.alpha.PLAY1284investigation2657

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 45231373914385c1a87911aabeb3cc65256c4c874356894e30cc148c3edd18a9
4
- data.tar.gz: 44843deb7040754391dec172d5397b5f7cd19626059da0e5912debd8ee8a5882
3
+ metadata.gz: 06bdd9ccfee263666899576e57d9ef54ccb2e7906006bcf984b7cf156aa9a8f3
4
+ data.tar.gz: 66c6fabfcc30a18004c79541dc5c354387a624261c3460b7c8442ef5872ec712
5
5
  SHA512:
6
- metadata.gz: 0bc0f7bb219bd88b7d7aa34204fef9e82c4314cb53180801ca183662eb21cee32816748ddbaa544ed115a2eb1c728cd2b33bcb8ec278ad61554c2ab97830e4b6
7
- data.tar.gz: 8480214ba05eace0268aafd2a1629787923baa167eb619d023c3a3b239edae9aae2cad3a91e7fe8766f97a50e422f4be3acbd7859505a8ec0492360737a853a0
6
+ metadata.gz: 617bf467c44ac9574c0a09f6818234df1d5f8db9f9303a620052ccc748d9112a03ac5c54ed57a0301dd3b091d9b5933ba752d29bbac7368cb9c89a398d69dcb0
7
+ data.tar.gz: 408a9dd519c47b3fde7761c3eccbb4975f12ac4f4d846a0e587b7c7d0ed78c50399196f92599440909a7c473ee5ddf6aa8aaff2a760d0309559d6a5cbca52f28
@@ -0,0 +1,26 @@
1
+ <% data = [{
2
+ name: 'Number of Installations',
3
+ data: [1475,200,3000,654,656]
4
+ }, {
5
+ type: 'spline',
6
+ name: 'Percentage',
7
+ data: [48, 70, 25, 55, 72],
8
+ color: '#F9BB00',
9
+ yAxis: 1
10
+ }] %>
11
+
12
+ <% axis_titles = [{name: "Number of Installations"}, {name: "Percentage"}] %>
13
+
14
+ <% axis_formats = [{format: ""}, {format: "{value}%"}] %>
15
+
16
+ <%= pb_rails("bar_graph", props: {
17
+ axis_format: axis_formats,
18
+ axis_title: axis_titles,
19
+ chart_data: data,
20
+ id: "bar-spline",
21
+ y_axis_min: 0,
22
+ x_axis_categories:['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],
23
+ subtitle: 'Source: thesolarfoundation.com',
24
+ title: 'Bar Graph with Secondary Y-axis',
25
+ legend: true,
26
+ }) %>
@@ -0,0 +1,36 @@
1
+ import React from 'react'
2
+
3
+ import BarGraph from '../_bar_graph'
4
+
5
+ const chartData = [{
6
+ name: 'Number of Installations',
7
+ data: [1475, 200, 3000, 654, 656],
8
+ }, {
9
+ type: 'spline',
10
+ name: 'Percentage',
11
+ data: [48, 70, 25, 55, 72],
12
+ color: '#F9BB00',
13
+ yAxis: 1
14
+ }]
15
+
16
+ const axisTitles = [ {name: "Number of Installations"}, {name: "Percentage"}]
17
+
18
+ const axisFormats = [{format: ""}, {format: "{value}%"}]
19
+
20
+ const BarGraphSecondaryYAxis= (props) => (
21
+ <div>
22
+ <BarGraph
23
+ axisFormat={axisFormats}
24
+ axisTitle={axisTitles}
25
+ chartData={chartData}
26
+ id="bar-spline"
27
+ legend
28
+ title="Bar Graph with Secondary Y-axis"
29
+ xAxisCategories={['Jan', 'Feb', 'Mar', 'Apr', 'May']}
30
+ yAxisMin={0}
31
+ {...props}
32
+ />
33
+ </div>
34
+ )
35
+
36
+ export default BarGraphSecondaryYAxis
@@ -0,0 +1,3 @@
1
+ Optionally add a second yAxis to support secondary datasets (e.x., a spline) by passing` yAxis: 1` to the second node of your `chartData` array.
2
+
3
+ To customize the format and/or title of your secondary yAxis, pass your desired values as arrays through the `axisFormat` and `axisTitle` props, respectively.
@@ -9,6 +9,7 @@ examples:
9
9
  - bar_graph_spline: Spline
10
10
  - bar_graph_colors: Color Overrides
11
11
  - bar_graph_custom: Custom Overrides
12
+ - bar_graph_secondary_y_axis: Secondary Y-Axis
12
13
 
13
14
 
14
15
  react:
@@ -20,3 +21,4 @@ examples:
20
21
  - bar_graph_spline: Spline
21
22
  - bar_graph_colors: Color Overrides
22
23
  - bar_graph_custom: Custom Overrides
24
+ - bar_graph_secondary_y_axis: Secondary Y-Axis
@@ -6,3 +6,4 @@ export { default as BarGraphHeight } from './_bar_graph_height.jsx'
6
6
  export { default as BarGraphSpline } from './_bar_graph_spline.jsx'
7
7
  export { default as BarGraphColors } from './_bar_graph_colors.jsx'
8
8
  export { default as BarGraphCustom } from './_bar_graph_custom.jsx'
9
+ export { default as BarGraphSecondaryYAxis } from './_bar_graph_secondary_y_axis.jsx'
@@ -0,0 +1,51 @@
1
+ import React, { useState } from 'react'
2
+
3
+ import {
4
+ Button,
5
+ } from '../..'
6
+
7
+ import Typeahead from '../_typeahead'
8
+
9
+ const options = [
10
+ { label: 'Orange', value: '#FFA500' },
11
+ { label: 'Red', value: '#FF0000' },
12
+ { label: 'Green', value: '#00FF00' },
13
+ { label: 'Blue', value: '#0000FF' },
14
+ { label: 'Amaranth', value: '#9F2B68' },
15
+ { label: 'Key Lime', value: '#DAF7A6' },
16
+ { label: 'Turquois', value: '#00FFD0' },
17
+ ]
18
+
19
+ const TypeaheadCustomMenuList = (props) => {
20
+ const defaultColorOptions = options.slice(0, 3)
21
+ const [colorOptions, setColorOptions] = useState(defaultColorOptions)
22
+
23
+ const moreToLoad = colorOptions.length == defaultColorOptions.length
24
+ const loadColors = moreToLoad ? () => setColorOptions(options) : () => setColorOptions(defaultColorOptions)
25
+
26
+ const menuListProps = {
27
+ footer: (<Button
28
+ margin="sm"
29
+ onClick={loadColors}
30
+ text={`Load ${moreToLoad ? "More" : "Less"}`}
31
+ />)
32
+ }
33
+
34
+ const MenuList = (props) => (
35
+ <Typeahead.MenuList
36
+ {...menuListProps}
37
+ {...props}
38
+ />
39
+ )
40
+
41
+ return (
42
+ <Typeahead
43
+ components={{ MenuList }}
44
+ label="Colors"
45
+ options={colorOptions}
46
+ {...props}
47
+ />
48
+ )
49
+ }
50
+
51
+ export default TypeaheadCustomMenuList
@@ -46,7 +46,7 @@ const TypeaheadWithHighlight = (props) => {
46
46
  if (!inputValue.length) return text
47
47
  return text.replace(
48
48
  new RegExp(inputValue, 'gi'),
49
- highlighted => `<mark>${highlighted}</mark>`
49
+ (highlighted) => `<mark>${highlighted}</mark>`
50
50
  )
51
51
  }
52
52
  return (
@@ -22,3 +22,4 @@ examples:
22
22
  - typeahead_createable: Createable
23
23
  - typeahead_async_createable: Createable (+ Async Data)
24
24
  - typeahead_error_state: Error State
25
+ - typeahead_custom_menu_list: Custom MenuList
@@ -9,3 +9,4 @@ export { default as TypeaheadMultiKit } from './_typeahead_multi_kit.jsx'
9
9
  export { default as TypeaheadCreateable } from './_typeahead_createable.jsx'
10
10
  export { default as TypeaheadAsyncCreateable } from './_typeahead_async_createable.jsx'
11
11
  export { default as TypeaheadErrorState } from './_typeahead_error_state.jsx'
12
+ export { default as TypeaheadCustomMenuList } from './_typeahead_custom_menu_list.jsx'