Skip to Main Content
Mastering Angular Components - Second Edition
book

Mastering Angular Components - Second Edition

by Gion Kunz
July 2018
Intermediate to advanced content levelIntermediate to advanced
402 pages
9h 35m
English
Packt Publishing
Content preview from Mastering Angular Components - Second Edition

Projection of time

Our slider component needs to be able to project timestamps into the coordinate system of SVG. Also, when a user clicks on the timeline to select a range, we'll need to be able to project coordinates back into timestamps. For this purpose, we need to create two projection functions within our component, which will use a few helper functions and states to calculate the values, from coordinates to time, and vice-versa:

Visualization of important variables and functions for our calculations

While we will use percentages to position our SVG elements on the slider component, the padding on the sides will need to be specified ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning Angular, 2nd Edition

Learning Angular, 2nd Edition

Brad Dayley, Brendan Dayley, Caleb Dayley
Essential Angular

Essential Angular

Victor Savkin, Jeff Cross
Pro Angular 6

Pro Angular 6

Adam Freeman

Publisher Resources

ISBN: 9781788293532Supplemental Content