Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Open
durai001 opened this issue Jul 7, 2020 · 3 comments
Labels
question Further information is requested

Comments

@durai001
Copy link

durai001 commented Jul 7, 2020

  • How Can I change the text format, What textFormat function will do
  • How can I get details where I have clicked on ruler:
  • Is there any option to change it for video duration :
    *If I changed the unit to 10 then ruler each line was getting smaller and numbers are overlays each other.
@durai001 durai001 changed the title 1.how can I use this for videos duration. what does textFormat function.2.Is there any way to detect where we clicked on ruler. How to change textFormat, How can I get the click event info where I clicked on the ruler. Jul 7, 2020
@daybrush
Copy link
Owner

daybrush commented Jul 8, 2020

@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 ~~~} />

@daybrush daybrush added the question Further information is requested label Jul 8, 2020
@durai001
Copy link
Author

durai001 commented Jul 8, 2020

@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
Copy link
Owner

@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

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants