Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TIPM-UI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LOUDNI Samir
TIPM-UI
Commits
4a801f71
Verified
Commit
4a801f71
authored
3 years ago
by
BARBIER Marc
Browse files
Options
Downloads
Patches
Plain Diff
fix holes inside graph
parent
017e435f
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/ChartComponent/ChartComponent.ts
+8
-10
8 additions, 10 deletions
src/components/ChartComponent/ChartComponent.ts
with
8 additions
and
10 deletions
src/components/ChartComponent/ChartComponent.ts
+
8
−
10
View file @
4a801f71
...
...
@@ -22,14 +22,14 @@ type LineElement = {
color
:
string
}
type
SelfScal
l
edLineElement
=
{
type
SelfScaledLineElement
=
{
type
:
'
SelfScalledLine
'
,
label
:
string
,
data
:
number
[],
color
:
string
}
type
ChartElement
=
BlockElement
|
LineElement
|
BackgroundElement
|
SelfScal
l
edLineElement
type
ChartElement
=
BlockElement
|
LineElement
|
BackgroundElement
|
SelfScaledLineElement
export
type
{
ChartElement
,
BlockElement
,
LineElement
,
BackgroundElement
}
...
...
@@ -93,14 +93,13 @@ export default defineComponent({
break
}
case
'
Line
'
:
{
console
.
log
(
element
.
data
)
for
(
const
[
index
,
data
]
of
element
.
data
.
entries
())
{
const
placementRatio
=
(
data
-
minY
)
/
(
maxY
-
minY
)
const
placementHeight
=
height
-
scaleHeight
-
(
placementRatio
*
(
height
-
scaleHeight
)
)
const
nextPoint
=
element
.
data
[
index
+
1
]
if
(
!
nextPoint
)
{
continue
if
(
nextPoint
===
undefined
||
nextPoint
===
null
)
{
break
}
const
nextPlacementRatio
=
(
nextPoint
-
minY
)
/
(
maxY
-
minY
)
const
nextPlacementHeight
=
height
-
scaleHeight
-
(
nextPlacementRatio
*
(
height
-
scaleHeight
))
...
...
@@ -118,23 +117,22 @@ export default defineComponent({
case
'
SelfScalledLine
'
:
{
const
min
=
element
.
data
.
reduce
((
prev
,
cur
)
=>
cur
>
prev
?
cur
:
prev
)
const
max
=
element
.
data
.
reduce
((
prev
,
cur
)
=>
cur
<
prev
?
cur
:
prev
)
const
selfScal
l
edDataGap
=
(
width
-
scaleHeight
)
/
element
.
data
.
length
const
selfScaledDataGap
=
(
width
-
scaleHeight
)
/
element
.
data
.
length
for
(
const
[
index
,
data
]
of
element
.
data
.
entries
())
{
const
placementRatio
=
(
data
-
min
)
/
(
max
-
min
)
const
placementHeight
=
height
-
scaleHeight
-
(
placementRatio
*
(
height
-
scaleHeight
)
)
const
nextPoint
=
element
.
data
[
index
+
1
]
if
(
!
nextPoint
)
break
if
(
nextPoint
===
undefined
||
nextPoint
===
null
)
break
const
nextPlacementRatio
=
(
nextPoint
-
min
)
/
(
max
-
min
)
const
nextPlacementHeight
=
height
-
scaleHeight
-
nextPlacementRatio
*
(
height
-
scaleHeight
)
this
.
drawConnectedPoints
(
context
,
element
.
color
,
index
*
selfScal
l
edDataGap
+
scaleHeight
,
index
*
selfScaledDataGap
+
scaleHeight
,
placementHeight
,
(
index
+
1
)
*
selfScal
l
edDataGap
+
scaleHeight
,
(
index
+
1
)
*
selfScaledDataGap
+
scaleHeight
,
nextPlacementHeight
)
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment