GithubHelp home page GithubHelp logo

ts4nfdi / js-widgets-demo-project Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 4.05 MB

Example project illustrating the use of the SemLookP widgets in a plain JavaScript environment (non-React)

CSS 0.01% HTML 0.05% JavaScript 99.95%

js-widgets-demo-project's Introduction

JS-Widgets Demo Project

NFDI_SemLookP_Logo.svg

This is an example project illustrating the use of SemLookP's widgets in a plain JavaScript environment. All widgets are created directly inside of index.html. To access the widgets of SemLookP, a bundled javascript output file generated by esbuild in the semlookp-widgets repository is included in this project's js/ folder and embedded in index.html via script tag.

demo_picture.png

Create SemLookP-widgets in a plain JavaScript environment

To create a widget, an empty container with an id has to be created first. This container can then be addressed in a script tag, where the SemLookP widget can now be rendered into with the respective function added to window['SemLookPWidgets']. Here's an example code snippet:

<head>
    <link rel="stylesheet" href="https://unpkg.com/@elastic/[email protected]/dist/eui_theme_light.css">
    <link rel="stylesheet" href="./css/semlookp_widgets.css/">
    <script type="text/javascript" src="./js/semlookp_widgets.js"></script>
</head>
<body>
    <div id="datacontent_widget"></div>
    <script>
        let widgetContainer = document.getElementById('datacontent_widget');
        window['SemLookPWidgets'].createDataContent(
            {
                api: "https://www.ebi.ac.uk/ols4/api/",
            },
            widgetContainer
        );
    </script>
</body>

Run the project

To run the project, just run the index.html.

js-widgets-demo-project's People

Contributors

vincentkneip avatar jusa3 avatar

Watchers

Naouel Karam avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.