Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Ecolyo
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
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
web-et-numerique
Factory
LLLE_Project
Ecolyo
Commits
80a299cb
Commit
80a299cb
authored
4 years ago
by
Yoan VALLET
Browse files
Options
Downloads
Patches
Plain Diff
feat: display only mondays for duel > 2 weeks
parent
b0abf6ac
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!309
feat: display only mondays for duel > 2 weeks
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/Charts/AxisBottom.tsx
+6
-5
6 additions, 5 deletions
src/components/Charts/AxisBottom.tsx
with
6 additions
and
5 deletions
src/components/Charts/AxisBottom.tsx
+
6
−
5
View file @
80a299cb
...
@@ -15,7 +15,7 @@ interface TextTypeProps {
...
@@ -15,7 +15,7 @@ interface TextTypeProps {
timeStep
:
TimeStep
timeStep
:
TimeStep
width
:
number
width
:
number
selectedDate
:
DateTime
selectedDate
:
DateTime
is
Duel
?:
boolean
d
is
playAllDays
?:
boolean
}
}
function
TextAxis
({
function
TextAxis
({
...
@@ -24,7 +24,7 @@ function TextAxis({
...
@@ -24,7 +24,7 @@ function TextAxis({
timeStep
,
timeStep
,
width
,
width
,
selectedDate
,
selectedDate
,
is
Duel
,
d
is
playAllDays
,
}:
TextTypeProps
)
{
}:
TextTypeProps
)
{
const
dateChartService
=
new
DateChartService
()
const
dateChartService
=
new
DateChartService
()
const
isSelectedDate
=
dateChartService
.
compareStepDate
(
const
isSelectedDate
=
dateChartService
.
compareStepDate
(
...
@@ -56,7 +56,7 @@ function TextAxis({
...
@@ -56,7 +56,7 @@ function TextAxis({
case
TimeStep
.
DAY
:
case
TimeStep
.
DAY
:
return
(
return
(
<
text
y
=
"10"
dy
=
"0.71em"
transform
=
{
`translate(
${
width
}
)`
}
>
<
text
y
=
"10"
dy
=
"0.71em"
transform
=
{
`translate(
${
width
}
)`
}
>
{
is
Duel
?
(
{
d
is
playAllDays
?
(
<>
<>
<
tspan
className
=
{
style
}
x
=
"0"
textAnchor
=
"middle"
>
<
tspan
className
=
{
style
}
x
=
"0"
textAnchor
=
"middle"
>
{
dataload
.
date
.
toLocaleString
({
weekday
:
'
narrow
'
})
}
{
dataload
.
date
.
toLocaleString
({
weekday
:
'
narrow
'
})
}
...
@@ -128,11 +128,12 @@ const AxisBottom: React.FC<AxisBottomProps> = ({
...
@@ -128,11 +128,12 @@ const AxisBottom: React.FC<AxisBottomProps> = ({
height
,
height
,
marginLeft
,
marginLeft
,
marginBottom
,
marginBottom
,
isDuel
,
isDuel
=
false
,
}:
AxisBottomProps
)
=>
{
}:
AxisBottomProps
)
=>
{
const
{
selectedDate
}
=
useSelector
((
state
:
AppStore
)
=>
state
.
ecolyo
.
chart
)
const
{
selectedDate
}
=
useSelector
((
state
:
AppStore
)
=>
state
.
ecolyo
.
chart
)
const
dashArray
=
`
${
height
/
30
}
${
height
/
30
}
`
const
dashArray
=
`
${
height
/
30
}
${
height
/
30
}
`
const
dateChartService
=
new
DateChartService
()
const
dateChartService
=
new
DateChartService
()
const
displayAllDays
:
boolean
=
isDuel
&&
data
.
length
<=
15
return
(
return
(
<
g
<
g
className
=
"axis x"
className
=
"axis x"
...
@@ -153,7 +154,7 @@ const AxisBottom: React.FC<AxisBottomProps> = ({
...
@@ -153,7 +154,7 @@ const AxisBottom: React.FC<AxisBottomProps> = ({
timeStep
=
{
timeStep
}
timeStep
=
{
timeStep
}
width
=
{
xScale
.
bandwidth
()
/
2
}
width
=
{
xScale
.
bandwidth
()
/
2
}
selectedDate
=
{
selectedDate
}
selectedDate
=
{
selectedDate
}
is
Duel
=
{
is
Duel
}
d
is
playAllDays
=
{
d
is
playAllDays
}
/>
/>
{
dateChartService
.
compareStepDate
(
{
dateChartService
.
compareStepDate
(
timeStep
,
timeStep
,
...
...
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