Skip to content

How to detect click on feature in linear genome view #3939

Answered by svengato
svengato asked this question in Q&A
Discussion options

You must be logged in to vote

In my model, I have

const stateModel = types
  .model({
    id: ElementId,
    type: types.literal('MyView'),
  })
  .actions(() => ({
    // unused but required by your view
    setWidth() {},

    // attempt to add selectFeature() method
    selectFeature(feature: Feature) {
      console.log('selectFeature(): ' + feature)
    },
  }))

but clicking the feature does not override the default behavior of popping up a Feature Detail panel about the feature.

The methods that work, onChordClick() and mouseover(), are defined in src/index.ts like this:

    pluginManager.jexl.addFunction(
      'mouseover',
      (feature: any) => {
        console.log('mouseover: ' + JSON.stringify(feature.to…

Replies: 2 comments

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 cmdcolin
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