New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@geneontology/wc-gocam-viz

Package Overview
Dependencies
Maintainers
7
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@geneontology/wc-gocam-viz

Web component to visualize GO-CAM

  • 0.0.52
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
477
decreased by-28.7%
Maintainers
7
Weekly downloads
 
Created
Source

Built With Stencil

GO-CAM visualization Web Component

This web component allows to visualize GO-CAM from any website and create entity/activity views to highlight the flow of causal relationships.

Usage

Script tags

For a simple, static website using <script> tags is a quick way to get started. For example:

<html>
  <head>
    <script type="module" src="https://unpkg.com/@geneontology/wc-gocam-viz/dist/wc-gocam-viz/wc-gocam-viz.esm.js"></script>
    <script nomodule="" src="https://unpkg.com/@geneontology/wc-gocam-viz/dist/wc-gocam-viz/wc-gocam-viz.js"></script> 
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
  </head>
  <body>
    <wc-gocam-viz 
      id="gocam-1"
      gocam-id="568b0f9600000284"
      show-go-cam-selector=true
      show-has-input=false
      show-has-output=false
      show-gene-product=true
      show-activity=false
    ></wc-gocam-viz>
  </body>
</html>

This will render a GO-CAM model highlighting the flow of regulations between genes/activities.

NPM package

Installation

To use the web component as part of a larger front-end application that has its own bundling process, first install the dependency:

npm install @geneontology/wc-gocam-viz
Registering custom elements

Somewhere near the top level of your application you must define the custom components from this package:

import { defineCustomElements } from '@geneontology/wc-gocam-viz/loader'

defineCustomElements()

Now the <wc-gocam-viz> element can be used in your application's markup.

Configuration for image assets

The legend feature of the component requires image assets to be served by your application. These assets are distributed in the node_modules/@geneontology/wc-gocam-viz/dist/wc-gocam-viz/assets directory. If your applications uses a bundler you should configure it to automatically copy the files in that directory to an assets directory in the build ouput.

A webpack configuration that uses the CopyWebpackPlugin to do this might look like:

const path = require('path');
const CopyPlugin = require('copy-webpack-plugin');

module.exports = {
  entry: './src/index.js',
  output: {
    filename: 'main.js',
    path: path.resolve(__dirname, 'dist'),
  },
  plugins: [
    new CopyPlugin({
      patterns: [
        {
          from: path.resolve(__dirname, 'node_modules/@geneontology/wc-gocam-viz/dist/wc-gocam-viz/assets'),
          to: path.resolve(__dirname, 'dist/assets'),
        },
      ],
    }),
  ],
};

For other bundlers, consider a similar configuration using one of the following plugins:

FAQs

Package last updated on 28 Jul 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc