Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
SPP 2143 Learning Through Connecting
ltc_website
Commits
bebc61ca
Commit
bebc61ca
authored
Aug 17, 2021
by
amarcic
Browse files
timeline, zoom: added semantic zoom to y position of labels
parent
1a55ae2e
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/components/Timeline/TimelineChart.jsx
View file @
bebc61ca
...
...
@@ -82,14 +82,14 @@ export const TimelineChart = (props) => {
.
attr
(
"
transform
"
,
transform
);
const
xScaleNew
=
transform
.
rescaleX
(
xScale
);
//
const yScaleNew =
transform.rescaleY(yScale
);
const
yScaleNew
=
yScale
.
range
([
height
,
0
].
map
(
d
=>
transform
.
applyY
(
d
)
)
);
xAxis
.
scale
(
xScaleNew
);
xAxisDraw
.
call
(
xAxis
);
svg
.
selectAll
(
"
.label
"
)
.
attr
(
"
x
"
,
value
=>
xScaleNew
(
value
.
periodSpan
?.[
0
]))
//
.attr("y", value => yScaleNew(value.periodId));
.
attr
(
"
y
"
,
value
=>
yScaleNew
(
value
.
periodId
));
};
const
zimzoom
=
zoom
()
.
scaleExtent
([
1
,
5
])
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment