peaks.js
peaks.js copied to clipboard
Overlaying the selected segment

Hello, I'm not sure how to highlight the selected segment as shown in the picture. How can I do that?
Thank you.
Currently, segments are shown with a different waveform colour. To make sure I understand correctly, are you suggesting that segments should instead be drawn with a highlight area, as your image shows? The current customization API doesn't enable you to do that, but I guess could be extended.
Yes, this is from another application. I wanted to recreate something like this using peaks.js. So, what do you mean it could be extended?
So we'd have to modify Peaks.js in some way to achieve that. There are two approaches: either add more configuration options, or extend the customization API. The customization API would be my preferred route, but it currently only allows you to customize the point and segment handles - the segment itself is always rendered as a wavform a of a different colour, as in the blue and purple regions here:

I would like to upvote this idea of having a waveform-independent way to display a segment.
I love the current solution very much, and it should definitely stay the standard solution! However, in scenarios, where the waveform must be hidden, an alternative solution would be most welcome.
ATM it even seems to be a very delightful idea to have the option at hand to draw both versions at the same time... but I know: that's pushing it. :-)
Please take a look at v3.0.0 beta, I think this allows you to do what you need.