daybrush / ruler

A Ruler component that can draw grids and scroll infinitely.
https://daybrush.com/ruler/
MIT License
334 stars 39 forks source link

How to change textFormat, How can I get the click event info where I clicked on the ruler. #10

Open durai001 opened 4 years ago

durai001 commented 4 years ago
daybrush commented 4 years ago

@durai001

  1. The argument of the function is either px or a number. <Ruler textFormat={v => ${v}s>
  2. The ruler has no events. Wrap the ruler and add your own event.
  3. This is because if the unit is 10, it is 10px. Use zoom too. <Ruler unit={10} zoom={2, 10, 20 ~~~} />
durai001 commented 4 years ago

@daybrush Thanks for the reply

<Ruler textFormat={v => ${v}s> this is does nothing. ( I need to display this like a video duration "HH:MM:SS" I can see your code you already added the option but I don't know the way How to use that. https://github.com/daybrush/ruler/blob/master/packages/react-ruler/src/demo/App.tsx formatText method )

and I' willing to add a click event and on the ruler but I'm not able to run this project in the browser and not able to debug this

daybrush commented 4 years ago

@durai001

0.5.0 is released. Recheck it.

If you use textFormat, it is normal to appear as follows.

스크린샷 2020-07-12 오전 12 32 53