Skip to content

Add docs for TIME_AXIS_MARKERS and markerSideDeltas #24

Answered by samuelarbibe
colehart asked this question in Q&A
Discussion options

You must be logged in to vote
 const markers = useMemo(() => {
    // sort the markers from large to small.
    const sortedMarkers = [...props.markers];
    sortedMarkers.sort((a, b) => b.value - a.value);

    // the smallest marker size, in ms
    const delta = sortedMarkers[sortedMarkers.length - 1].value;

    // the total timeframe size/
    const timeframeSize = timeframe.end.getTime() - timeframe.start.getTime();

    const startTime = Math.floor(timeframe.start.getTime() / delta) * delta;

    const endTime = timeframe.end.getTime();
    const timezoneOffset = minutesToMilliseconds(
      new Date().getTimezoneOffset(),
    );

    const markerSideDeltas: Marker[] = [];

    // Here, we "walk" from the start …

Replies: 8 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by samuelarbibe
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #21 on June 16, 2024 17:20.