File tree Expand file tree Collapse file tree 5 files changed +28
-4
lines changed
widgets/land-cover/tree-cover-density Expand file tree Collapse file tree 5 files changed +28
-4
lines changed Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
import PropTypes from 'prop-types' ;
3
+ import cx from 'classnames' ;
3
4
4
- const AxisLabel = ( { label, direction } ) => (
5
+ const AxisLabel = ( { label, direction, isSimple = false } ) => (
5
6
< >
6
7
< foreignObject
7
8
width = "100%"
8
9
height = "100%"
9
10
className = { `${ direction } -label-container` }
10
11
>
11
12
< div className = { `${ direction } -label` } >
12
- < span > { label } </ span >
13
+ < span
14
+ className = { cx ( {
15
+ 'simple-mode-label' : isSimple ,
16
+ } ) }
17
+ >
18
+ { label }
19
+ </ span >
13
20
</ div >
14
21
</ foreignObject >
15
22
</ >
@@ -18,6 +25,7 @@ const AxisLabel = ({ label, direction }) => (
18
25
AxisLabel . propTypes = {
19
26
label : PropTypes . string ,
20
27
direction : PropTypes . string ,
28
+ isSimple : PropTypes . bool ,
21
29
} ;
22
30
23
31
export default AxisLabel ;
Original file line number Diff line number Diff line change @@ -177,6 +177,7 @@ class CustomComposedChart extends PureComponent {
177
177
< div
178
178
className = { cx ( 'c-composed-chart' , className , {
179
179
'overflow-x-visible' : hasLabels ,
180
+ 'no-padding' : simple ,
180
181
} ) }
181
182
style = { {
182
183
height : simple ? 110 : height || 250 ,
@@ -237,7 +238,13 @@ class CustomComposedChart extends PureComponent {
237
238
interval = "preserveStartEnd"
238
239
{ ...xAxis }
239
240
{ ...( config ?. xAxis ?. label && {
240
- label : < AxisLabel label = { config ?. xAxis ?. label } direction = "x" /> ,
241
+ label : (
242
+ < AxisLabel
243
+ label = { config ?. xAxis ?. label }
244
+ direction = "x"
245
+ isSimple = { simple }
246
+ />
247
+ ) ,
241
248
} ) }
242
249
/>
243
250
{ ( ! simple || simpleNeedsAxis ) && (
Original file line number Diff line number Diff line change @@ -49,6 +49,10 @@ $layout-breakpoint-3xl: 1536px;
49
49
overflow-x : visible !important ;
50
50
}
51
51
52
+ .no-padding {
53
+ padding : 0 !important ;
54
+ }
55
+
52
56
.x-label-container ,
53
57
.y-label-container {
54
58
position : relative ;
@@ -58,6 +62,10 @@ $layout-breakpoint-3xl: 1536px;
58
62
59
63
span {
60
64
font-size : 0.8125rem ;
65
+
66
+ & .simple-mode-label {
67
+ font-size : 0.625rem !important ;
68
+ }
61
69
}
62
70
}
63
71
Original file line number Diff line number Diff line change 23
23
}
24
24
25
25
& .simple {
26
+ margin-top : 1.25rem ;
26
27
font-size : rem (10px );
27
28
28
29
p {
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ export default {
19
19
types : [ 'country' , 'wdpa' , 'aoi' ] ,
20
20
admins : [ 'adm0' , 'adm1' , 'adm2' ] ,
21
21
large : true ,
22
- visible : [ 'dashboard' ] ,
22
+ visible : [ 'dashboard' , 'analysis' ] ,
23
23
chartType : 'composedChart' ,
24
24
colors : 'density' ,
25
25
settingsConfig : [
You can’t perform that action at this time.
0 commit comments