Skip to content

Commit

Permalink
remove rounded variable from report svg charts
Browse files Browse the repository at this point in the history
  • Loading branch information
bseber committed Oct 11, 2024
1 parent 6de96d6 commit b1bb848
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 24 deletions.
18 changes: 6 additions & 12 deletions src/main/resources/templates/reports/user-report-month.html
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,7 @@
topHours=${paddingTop + chartHeight - heightHours},
topShould=${paddingTop + chartHeight - heightShould},
bottom=${paddingTop + chartHeight},
left=${(weekIt.index * weekGap) + (weekIt.index * 7 * barWidth) + (weekIt.index * 6 * dayGap) + (dayIt.index * dayGap) + (dayIt.index * barWidth)},
radius=0
left=${(weekIt.index * weekGap) + (weekIt.index * 7 * barWidth) + (weekIt.index * 6 * dayGap) + (dayIt.index * dayGap) + (dayIt.index * barWidth)}
"
th:classappend="${day.differentMonth ? 'report-graph-group--different-month' : ''}"
>
Expand All @@ -210,8 +209,7 @@
<path
th:fragment="clip-path-dept"
th:if="${day.hoursWorkedShould != 0 && day.hoursWorkedShould > day.hoursWorked}"
th:with="radius=0"
th:d="|M${left},${bottom} v${-1 * (heightShould - radius)} q${0},${-1*radius} ${barWidth/2},${-1*radius} h0 q${barWidth/2},${0} ${barWidth/2},${radius} v${heightShould - radius} z|"
th:d="|M${left},${bottom} v${-1 * heightShould} h${barWidth} v${heightShould} z|"
class="report-graph-day-should-bar"
d=""
/>
Expand All @@ -232,19 +230,18 @@
>
<mask th:id="${maskId}">
<path
th:d="|M${left},${bottom} v${-1 * (heightOvertime - radius)} q${0},${-1*radius} ${barWidth/2},${-1*radius} h0 q${barWidth/2},${0} ${barWidth/2},${radius} v${heightOvertime - radius} z|"
th:d="|M${left},${bottom} v${-1 * heightOvertime} h${barWidth} v${heightOvertime} z|"
fill="white"
d=""
/>
</mask>
<path
th:d="|M${left},${bottom} v${-1 * (heightOvertime - radius)} q${0},${-1*radius} ${barWidth/2},${-1*radius} h0 q${barWidth/2},${0} ${barWidth/2},${radius} v${heightOvertime - radius} z|"
th:d="|M${left},${bottom} v${-1 * heightOvertime} h${barWidth} v${heightOvertime} z|"
class="report-graph-day-overtime-bar"
d=""
/>
<path
th:with="radius=0"
th:d="|M${left},${bottom} v${-1 * (heightShould - radius)} q${0},${-1*radius} ${barWidth/2},${-1*radius} h0 q${barWidth/2},${0} ${barWidth/2},${radius} v${heightShould - radius} z|"
th:d="|M${left},${bottom} v${-1 * heightShould} h${barWidth} v${heightShould} z|"
class="report-graph-day-bar"
th:mask="${'url(#'+maskId+')'}"
fill="url(#gradient)"
Expand All @@ -255,10 +252,7 @@
th:if="${day.hoursWorked != 0 && day.hoursWorked <= day.hoursWorkedShould}"
>
<path
th:with="
yMax=${bottom - heightHours},
radius=0
"
th:with="yMax=${bottom - heightHours}"
th:d="|M${left},${bottom} v${-1*heightHours} h${barWidth} v${heightHours} z|"
th:clip-path="${'url(#'+clipPathId+')'}"
fill="url(#gradient)"
Expand Down
18 changes: 6 additions & 12 deletions src/main/resources/templates/reports/user-report-week.html
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,7 @@
topHours=${paddingTop + chartHeight - heightHours},
topShould=${paddingTop + chartHeight - heightShould},
bottom=${paddingTop + chartHeight},
left=${paddingLeft + (dayIt.index * dayGap) + (dayIt.index * barWidth)},
radius=0
left=${paddingLeft + (dayIt.index * dayGap) + (dayIt.index * barWidth)}
"
>
<rect
Expand All @@ -228,8 +227,7 @@
>
<path
th:fragment="clip-path-dept"
th:with="radius=0"
th:d="|M${left},${bottom} v${-1 * (heightShould - radius)} q${0},${-1*radius} ${barWidth/2},${-1*radius} h0 q${barWidth/2},${0} ${barWidth/2},${radius} v${heightShould - radius} z|"
th:d="|M${left},${bottom} v${-1 * heightShould} h${barWidth} v${heightShould} z|"
class="report-graph-day-should-bar"
d=""
/>
Expand All @@ -253,22 +251,19 @@
th:id="${'mask-overtime-' + #strings.toLowerCase(day.dayOfWeekFull)}"
>
<path
th:d="|M${left},${bottom} v${-1 * (heightOvertime - radius)} q${0},${-1*radius} ${barWidth/2},${-1*radius} h0 q${barWidth/2},${0} ${barWidth/2},${radius} v${heightOvertime - radius} z|"
th:d="|M${left},${bottom} v${-1 * heightOvertime} h${barWidth} v${heightOvertime} z|"
fill="white"
d=""
/>
</mask>
<path
th:d="|M${left},${bottom} v${-1 * (heightOvertime - radius)} q${0},${-1*radius} ${barWidth/2},${-1*radius} h0 q${barWidth/2},${0} ${barWidth/2},${radius} v${heightOvertime - radius} z|"
th:d="|M${left},${bottom} v${-1 * heightOvertime} h${barWidth} v${heightOvertime} z|"
class="report-graph-day-overtime-bar"
d=""
/>
<path
th:with="
radius=0,
clipPathId=${'mask-overtime-' + #strings.toLowerCase(day.dayOfWeekFull)}
"
th:d="|M${left},${bottom} v${-1 * (heightShould - radius)} q${0},${-1*radius} ${barWidth/2},${-1*radius} h0 q${barWidth/2},${0} ${barWidth/2},${radius} v${heightShould - radius} z|"
th:with="clipPathId=${'mask-overtime-' + #strings.toLowerCase(day.dayOfWeekFull)}"
th:d="|M${left},${bottom} v${-1 * heightShould} h${barWidth} v${heightShould} z|"
class="report-graph-day-bar"
th:mask="${'url(#'+clipPathId+')'}"
fill="url(#gradient)"
Expand All @@ -281,7 +276,6 @@
<path
th:with="
yMax=${bottom - heightHours},
radius=0,
clipPathId=${'clip-path-dept-' + #strings.toLowerCase(day.dayOfWeekFull)}
"
th:d="|M${left},${bottom} v${-1*heightHours} h${barWidth} v${heightHours} z|"
Expand Down

0 comments on commit b1bb848

Please sign in to comment.