Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add Point Markers Individually #67

Closed
chainlink opened this issue Jul 10, 2014 · 5 comments
Closed

Add Point Markers Individually #67

chainlink opened this issue Jul 10, 2014 · 5 comments

Comments

@chainlink
Copy link
Contributor

We'd like to be able to set point markers per point (rather than globally for the whole waveform)

Currently Implementing This feature

@thom4parisot
Copy link
Contributor

What do you mean? Have several markers at the same time?

Or you would like to be able to scope them per waveform offset?

@chainlink
Copy link
Contributor Author

We need to change the appearance of each marker (ie. different types of points)

@thom4parisot
Copy link
Contributor

We have some similar upcoming use case as well :-)

Adding new options is going to make the library more and more complex to use.

As a starter, adding an event segment.created, passing that segment object as an even argument would enable external code to act upon the segment + the view. The as the rendering is still performed by peaks there is no performance hit with that.

var p = Peaks.init({ … });

p.on('segment.created', function(segment){
  if (segments.data.type === 'speaker') {
    // … do things like adding a speaker avatar
  }
});

p.segments.add([{ startTime: 10, endTime: 12, data: { … } } ]);

This highly coupled to the internal API/Kinetic but I would like to address that issue with the view modularisation later on. So as there would be a way to process only the displayed markers rather than all of them.

Another alternative is to add an onRender property to the object, responsible of its rendering on the provided view (which means the onRender is called as many times as there are views:

var p = Peaks.init({
  segmentRenderer: defaultSegmentRender
});

function defaultSegmentRender(segment, view){
  if (segments.data.type === 'speaker' && view.id === 'overview') {
    // …
  }
}

function speakerSegmentRenderer(segment, view){
  if (view.id === 'zoomview') {
    // …
  }
}
p.segments.add([{ startTime: 10, endTime: 12, data: {}, onRender: speakerSegmentRenderer } ]);

Something like that. Is it somewhat you had in mind?

@thom4parisot
Copy link
Contributor

Should be addressed by #87.

@chrisn
Copy link
Member

chrisn commented Feb 2, 2020

The marker customisation is improved in v0.18.0. I'll close this, please raise a new issue if further changes are needed.

@chrisn chrisn closed this as completed Feb 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants