Uncaught TypeError: P is not a constructor: Embedded JBrowse2 and "sophisticated" jexl callbacks using Plugin #48
Replies: 2 comments
-
Hi Linda,
Here is an example gene page at wormbase.org:
https://wormbase.org/species/c_elegans/gene/WBGene00006749#9--10. The code
for this page is a mixture of Perl's Template::Toolkit and javascript,
where the main driving function is here:
https://github.com/WormBase/website-public/blob/21e8526318eb43c12ec53aa6545768303d644fb0/root/templates/config/main#L598-L741
which has two relatively simple plugins included.
If this helps, great! But if it doesn't, it might help for you to show us
what you're doing if you can.
Scott
…On Thu, Jun 27, 2024 at 7:13 AM LindaMilne ***@***.***> wrote:
I want to color track features according to their type using the methods
of jexl callbacks from a plugin, but I cannot get this to work with my
embedded JBrowse2. I tried following the instructions on
https://jbrowse.org/jb2/docs/config_guides/jexl/, but when I use this
method I get this error:
Uncaught TypeError: P is not a constructor
pluginManager createModel.ts:35
createModel createModel.ts:35
createViewState createViewState.ts:68
jbrowse_config_test_2.html:46
I'm relatively new to javascript, so I know I'm doing something not quite
right but not sure how to overcome this. I saw there may be further
instructions for embedded JBrowse2 on the same page, but the link isn't
working properly. Can anyone give me a simple example of embedding + plugin?
Also is there a list of styling feature tracks anywhere? For example
color1, color2 and what they control etc... can I change the thickness of
the feature block somehow? etc
—
Reply to this email directly, view it on GitHub
<#48>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACDCP7VA5M4LUSD4LNPA63ZJQM2DAVCNFSM6AAAAABKAA34Q6VHI2DSMVQWIX3LMV43ERDJONRXK43TNFXW4OZWHA3DSOJRG4>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
--
------------------------------------------------------------------------
Scott Cain, Ph. D. scott
at scottcain dot net
GMOD Project Manager (http://gmod.org/)
216-392-3087
WormBase Developer (http://wormbase.org/)
Alliance of Genome Resources Group Leader (http://alliancegenome.org/)
VirusSeq Project Manager (https://virusseq-dataportal.ca/)
Human Cancer Models Initiative Project Manager (
https://hcmi-searchable-catalog.nci.nih.gov/)
|
Beta Was this translation helpful? Give feedback.
-
if you are using the embedded components, you do not have to use the plugin-template (and the plugin-template may "get in your way" rather than help) here is an example of defining a plugin in an embedded use case https://github.com/GMOD/jbrowse-components/blob/main/products/jbrowse-react-linear-genome-view/stories/examples/WithInlinePlugins.tsx (linked from https://jbrowse.org/storybook/lgv/main/?path=/docs/using-plugins--docs). this example doesn't use the plugin template at all. the plugin-template is useful for creating a NPM package or bundled plugin that can be used in e.g. jbrowse-web but a small plugin just for the jexl callbacks is probably easiest to "inline" like in that example you can see in this case you pass the plugin class that you can define in the same file directly to the createViewState function and just as a general note, the 'storybook' docs at https://jbrowse.org/storybook/lgv/main/ have a lot of little recipes for embedded usages :) |
Beta Was this translation helpful? Give feedback.
-
I want to color track features according to their type using the methods of jexl callbacks from a plugin, but I cannot get this to work with my embedded JBrowse2. I tried following the instructions on https://jbrowse.org/jb2/docs/config_guides/jexl/, but when I use this method I get this error:
Uncaught TypeError: P is not a constructor
pluginManager createModel.ts:35
createModel createModel.ts:35
createViewState createViewState.ts:68
jbrowse_config_test_2.html:46
I'm relatively new to javascript, so I know I'm doing something not quite right but not sure how to overcome this. I saw there may be further instructions for embedded JBrowse2 on the same page, but the link isn't working properly. Can anyone give me a simple example of embedding + plugin?
Also is there a list of styling feature tracks anywhere? For example color1, color2 and what they control etc... can I change the thickness of the feature block somehow? etc
Beta Was this translation helpful? Give feedback.
All reactions