File tree 2 files changed +40
-0
lines changed
2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -11,8 +11,18 @@ import React, {
11
11
import { memoize } from 'lodash' ;
12
12
13
13
import { FacetedData , FacetedPlotRef , PlotRef } from '../types/plots' ;
14
+ import FacetedBarplot from './facetedPlots/FacetedBarplot' ;
15
+ import Barplot from './Barplot' ;
14
16
import { PlotProps } from './PlotlyPlot' ;
15
17
18
+ const mapStringToPlotComponent = ( str : string ) =>
19
+ ( {
20
+ Barplot : {
21
+ faceted : FacetedBarplot ,
22
+ unfaceted : Barplot ,
23
+ } ,
24
+ } [ str ] ) ;
25
+
16
26
type ComponentWithPlotRef < P > = ComponentType <
17
27
PropsWithoutRef < P > & RefAttributes < PlotRef >
18
28
> ;
Original file line number Diff line number Diff line change
1
+ import Barplot , { BarplotProps } from '../Barplot' ;
2
+
3
+ const facetedPlotContainerStyles = {
4
+ height : 300 ,
5
+ width : 375 ,
6
+ marginLeft : '0.75rem' ,
7
+ border : '1px solid #dedede' ,
8
+ boxShadow : '1px 1px 4px #00000066' ,
9
+ } ;
10
+
11
+ const facetedPlotSpacingOptions = {
12
+ marginRight : 10 ,
13
+ marginLeft : 10 ,
14
+ marginBotton : 10 ,
15
+ marginTop : 50 ,
16
+ } ;
17
+
18
+ const FacetedBarplot = ( {
19
+ containerStyles = facetedPlotContainerStyles ,
20
+ spacingOptions = facetedPlotSpacingOptions ,
21
+ ...restProps
22
+ } : BarplotProps ) => (
23
+ < Barplot
24
+ containerStyles = { containerStyles }
25
+ spacingOptions = { spacingOptions }
26
+ { ...restProps }
27
+ />
28
+ ) ;
29
+
30
+ export default FacetedBarplot ;
You can’t perform that action at this time.
0 commit comments