How to use external angular modules in own Grafana plugin - grafana

I’m developing my datasource plugin based on simple-json. I want to use the library angular-ivh-treeview, but I do not understand how to use it in the plugin. Can someone help me?

To use an external JavaScript lib in a plugin, you have to include it in the plugin code. JavaScript libraries in node_modules are only used at build time and are not included in the output.
To take an example, here is the Plotly panel plugin that includes the Plotly lib in a subdirectory named lib:
https://github.com/NatelEnergy/grafana-plotly-panel/tree/master/src/lib
and then uses it here:
https://github.com/NatelEnergy/grafana-plotly-panel/blob/master/src/module.js#L8
Another example - the GeoLoop plugin that includes the mapboxgl library:
https://github.com/CitiLogics/citilogics-geoloop-panel/blob/master/src/geoloop.js#L3

Related

How to extend angular-cli via a custom plugin

I want to extend angular-cli via a custom plugin. I want to write this plugin by myself. How can i do this? If i write an ember-cli plugin, can i use this one in angular-cli? I read that not all ember-cli plugins are working in angular-cli. I would like to have an example, or some information about the architecture of angular-cli.

How to add and use a jar library in IntelliJ IDEA?

I created a new Java app from scratch in IntelliJ IDEA. Now I want to use a jar library, e.g. OpenJPA. I added the library using Project Structure -> Libraries like this:
then I tried to use annotations from that library in my Java code, but I don't get the option to import these classes. It looks like IntelliJ IDEA is not known about my library yet:
What am I doing wrong when adding this library? Is there anything more that I have to do to get it working?
After adding this library, it looks like it is automatically added to "Modules":
You have created a library, but you haven't said IntelliJ that the module must use it. Click *Modulesµ in the project structure, then select the module you want to add this library to, go to the Dependencies tab, and add the library.
EDIT:
It's simply that the annotation is not part of the jar. You need to add the jpa api jar, not only openjpa.jar
You have to add library to Module dependencies, pls check here:
Configuring Module Dependencies and Libraries

Integrating jitsi in java-fx

I am developing an video calling application using javafx. And I need to integrate jitsi video GUI into javafx Swing node.
Is it possible or Do I have to use 'libjitsi' and implement GUI in javafx ?
Any suggestions would be appreciated.
If you're asking about how to embed Swing content into JavaFX, you can use a SwingNode.
It worked for me (I added a Swing PDF player in a JavaFX application)
Here is an example of how to perform this : http://docs.oracle.com/javafx/8/embed_swing/jfxpub-embed_swing.htm
This might be very late but still, I am posting the answer as seems to be a genuine question.
To use JavaFX with jitsi, developing with eclipse steps are as follows.
First, you require to install an addon of JavaFX in eclipse e. g. EFX
After adding above addon add JavaFX SDK to the project. The link: https://www.tutorialkart.com/javafx/install-javafx-in-eclipse-ide/
Then add the package entries to the manifest.mf files {in the package where you are executing} and felix.run.properties file.
And the project will run smoothly. Another thing if using a class with the superclass of Application then keep it in the different jar file add the entries of the jar to the build.xml(in copy jar section) and add the package entries to the manifest.mf files {in the package where you are executing} and felix.run.properties file.

How to bundle a js plugin without global namespace clashes

I'm in the process of building a javascript plugin that people will be able to install by simply pasting a script tag into their HTML. At times I may wish to include a third-party library in my plugin, but I want to make sure that my plugin will still work if used on a web site that relies on a different version of this same library. Is there a tool I can use to somehow modify the namespace of my required dependencies so that they don't interfere with any other existing scripts or libraries? I have been researching browserify but it's not immediately clear to me from the docs that it can be used to avoid this problem.

how do i include another project in github

I have created a plugin for a javascript library and want to upload this to github as a new project. Within my plugin directory, i include the current code for the javascript plugin.
So it's easy for users to get my plugin plus the javascript library, i thought i would include the javascript project inside my directory. My intention was not to make changes to the js library but to allow the user to download my project and get the latest version of the js library at the same time.
I could do this manually by forking the js library project into my directory and then syncing it each time a new version comes out but is there a way to do this automatically ?
Check out git submodule, it does exactly what you describe!