Hi @all.
I’d like to include a visual component from npm in our project (d3kit-timeline, can be found on github and UNPKG). The YouTube tutorial on the npm-Plugin only focuses on packages that have some in- and output, rather than displaying it as part of the GUI.
I’ve looked around a bit and found some similar requests already:
- the YouTube Video on “How to use npm packages in WeWeb (beta plugin)”
- some community questions:
Is it possible to use external libraries/packages/plugins while creating custom components
Add visual elements using NPM
Most proper solutions revolve around the solution of creating a custom component that utilizes this package and is then loading into the project. For simple prototyping I’d rather prefer to make use of the NPM-Plugin in WeWeb.
My current assumption is, that is has to do with the instantiation. The above example with wavesurfer.js can be used without the “new” keyword (indicating that there is an instance already somewhere), whereas with d3kit-timeline needs to be created with “new”. I’ve not been able to create an instance (e.g. on a button click) and bind it to a selected div, similar to the example in wavesurfer.js. Alternatively it maybe really is a question of the “instance keyword” for the npm-Plugin, but I’ve not been able to successfully identify it.
Looking forward to any ideas/suggestions, thanks,
Eric