Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
LaVizu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
behaviors-ai-public
LaVizu
Commits
86fcd411
Commit
86fcd411
authored
Jul 02, 2019
by
Dorian Goepp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comment typo and indentation fix
parent
1f62a986
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
src/HorizontalGauge/HozirontalGauge.js
src/HorizontalGauge/HozirontalGauge.js
+12
-12
No files found.
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