Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
behaviors-ai-public
LaVizu
Commits
86fcd411
Commit
86fcd411
authored
Jul 02, 2019
by
Dorian Goepp
Browse files
comment typo and indentation fix
parent
1f62a986
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/HorizontalGauge/HozirontalGauge.js
View file @
86fcd411
...
...
@@ -7,7 +7,7 @@ class HorizontalGauge extends Component {
render
()
{
const
value
=
(
'
value
'
in
this
.
props
&&
this
.
props
.
value
)
?
this
.
props
.
value
:
0
;
// Define the dimensions of the gaug
// Define the dimensions of the gaug
e
const
margin
=
{
left
:
10
,
top
:
10
,
right
:
10
,
bottom
:
10
},
width
=
this
.
props
.
size
.
width
-
margin
.
left
-
margin
.
right
,
height
=
20
;
...
...
@@ -22,17 +22,17 @@ class HorizontalGauge extends Component {
.
clamp
(
true
);
const
svg
=
<
svg
viewBox
=
{
viewbox
}
width
=
{
width
+
margin
.
left
+
margin
.
right
}
height
=
{
height
+
margin
.
top
+
margin
.
bottom
}
>
{
/* translate to add some margin around the gauge */
}
<
g
className
=
"
gauge
"
transform
=
{
"
translate(
"
+
margin
.
left
+
"
,
"
+
margin
.
top
+
"
)
"
}
>
{
/* Background of the gauge */
}
<
rect
className
=
"
background
"
x
=
"
0
"
y
=
"
0
"
width
=
{
width
}
height
=
{
height
}
ry
=
"
5px
"
/>
{
/* Representation of the value */
}
<
rect
className
=
"
overlay
"
x
=
"
0
"
y
=
"
0
"
width
=
{
xScale
(
value
)}
height
=
{
height
}
ry
=
"
5px
"
/>
{
/* Text of the gauge */
}
<
text
className
=
"
label
"
x
=
{
width
/
2
}
y
=
{
height
/
2
}
textAnchor
=
"
middle
"
dominantBaseline
=
"
central
"
>
{
""
+
value
.
toFixed
(
2
)}
<
/text
>
<
/g
>
{
/* translate to add some margin around the gauge */
}
<
g
className
=
"
gauge
"
transform
=
{
"
translate(
"
+
margin
.
left
+
"
,
"
+
margin
.
top
+
"
)
"
}
>
{
/* Background of the gauge */
}
<
rect
className
=
"
background
"
x
=
"
0
"
y
=
"
0
"
width
=
{
width
}
height
=
{
height
}
ry
=
"
5px
"
/>
{
/* Representation of the value */
}
<
rect
className
=
"
overlay
"
x
=
"
0
"
y
=
"
0
"
width
=
{
xScale
(
value
)}
height
=
{
height
}
ry
=
"
5px
"
/>
{
/* Text of the gauge */
}
<
text
className
=
"
label
"
x
=
{
width
/
2
}
y
=
{
height
/
2
}
textAnchor
=
"
middle
"
dominantBaseline
=
"
central
"
>
{
""
+
value
.
toFixed
(
2
)}
<
/text
>
<
/g
>
<
/svg>
;
return
<
div
>
{
svg
}
<
/div>
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment