npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

panther-overrep-form

v0.0.1

Published

Stencil Component Starter

Downloads

293

Readme

OverrepForm Component

A customizable form component built with StencilJS for gene overrepresentation analysis. This component provides an interface for users to input gene IDs and select ontology options, with support for example data and customizable styling.

Features

  • Gene ID input textarea with configurable rows
  • Ontology selection dropdown
  • Example data population
  • Customizable labels and hints
  • Flexible submission handling (URL or event-based)
  • Comprehensive CSS theming support
  • Shadow DOM encapsulation

Installation

NPM

npm install overrep-form

CDN

<script type="module" src="https://unpkg.com/overrep-form@latest/dist/panther-overrep-form/panther-overrep-form.esm.js"></script>

Usage

Basic HTML


    <script type="module" src="https://unpkg.com/overrep-form@latest/dist/panther-overrep-form/panther-overrep-form.esm.js"></script>
    <style>
        /* Component styles */
        overrep-form {
            /* Layout */
            --overrep-width: 100%;
            --overrep-height: 450px;
            
            /* Colors */
            --overrep-primary-color: #4a90e2;
            --overrep-secondary-color: #f5f6f7;
            --overrep-text-color: #333333;
            --overrep-border-color: #e1e4e8;
            
            /* Typography */
            --overrep-font-size: 16px;
            
            /* Spacing */
            --overrep-form-spacing: 1.5rem;
            --overrep-border-radius: 8px;
            
            /* Add shadow */
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        }
    </style>
    <div class="form-container">
        <overrep-form
            ontology-options='[
                {"id": "biological_process_IBA", "label": "biological process PAN-GO"},
                {"id": "molecular_function_IBA", "label": "molecular function PAN-GO"},
                {"id": "cellular_component_IBA", "label": "cellular component PAN-GO"}
            ]'
            example-genes='["AKT1", "BDNF", "CCKAR", "CHI3L1"]'
            submit-url="/api/overrep"
            species="HUMAN"
            test-type="FISHER"
            ontology-label="Choose Ontology Type"
            gene-ids-label="Input Gene IDs"
            submit-label="Run Analysis"
            examples-label="Use Example Set"
            show-hint="true"
            hint="Accepts gene symbols and IDs"
        ></overrep-form>
    </div>
></overrep-form>

React

import { OverrepForm } from 'overrep-form';

const App = () => {
  const ontologyOptions = [
    { id: "biological_process_IBA", label: "biological process PAN-GO" },
    { id: "molecular_function_IBA", label: "molecular function PAN-GO" },
    { id: "cellular_component_IBA", label: "cellular component PAN-GO" }
  ];

  const exampleGenes = [
    "AKT1", "BDNF", "CCKAR", "CHI3L1", "CHRNA7",
    "CLDN5", "CNR1", "COMT"
  ];

  return (
    <OverrepForm
      ontologyOptions={ontologyOptions}
      exampleGenes={exampleGenes}
      submitUrl="/api/overrep"
    />
  );
};

Angular

// app.module.ts
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component';

@NgModule({
  declarations: [AppComponent],
  imports: [BrowserModule],
  schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class AppModule {}
// app.component.ts
import { Component } from '@angular/core';
import 'overrep-form';

@Component({
  selector: 'app-root',
  template: `
    <overrep-form
      [ontologyOptions]="ontologyOptions"
      [exampleGenes]="exampleGenes"
      submitUrl="/api/overrep"
    ></overrep-form>
  `
})
export class AppComponent {
  ontologyOptions = [
    { id: "biological_process_IBA", label: "biological process PAN-GO" },
    { id: "molecular_function_IBA", label: "molecular function PAN-GO" },
    { id: "cellular_component_IBA", label: "cellular component PAN-GO" }
  ];

  exampleGenes = [
    "AKT1", "BDNF", "CCKAR", "CHI3L1", "CHRNA7",
    "CLDN5", "CNR1", "COMT"
  ];
}

Props

| Prop | Type | Default | Description | | ----------------- | ------------------ | ---------------------------- | ------------------------------------- | | ontologyOptions | OntologyOption[] | [] | Array of available ontology options | | exampleGenes | string[] | [] | Example gene IDs to populate the form | | submitUrl | string | /api/overrep | URL for form submission | | species | string | 'HUMAN' | Species identifier | | testType | string | 'FISHER' | Statistical test type | | textareaRows | number | 3 | Number of rows in gene ID textarea | | submitLabel | string | 'Launch' | Submit button label | | examplesLabel | string | 'Examples' | Examples button label | | geneIdsLabel | string | 'Your Gene IDs' | Gene IDs input label | | ontologyLabel | string | 'Ontology' | Ontology selector label | | hint | string | 'can use UniProt ID/AC...' | Help text shown below form | | showHint | boolean | true | Toggle hint visibility |

Events

The component emits a single event overrepSubmit when the form is submitted:

interface FormSubmitEvent {
  geneIds: string;    // Newline-separated gene IDs
  ontology: string;   // Selected ontology ID
  species: string;    // Species identifier
  testType: string;   // Statistical test type
}

Development

  1. Clone the repository
git clone [will-change-repo]
  1. Install dependencies
npm install
  1. Start development server
npm start
  1. Running Tests
npm test
  1. Build for production
npm run build

Browser Support

  • Chrome 67+
  • Firefox 63+
  • Safari 10.1+
  • Edge 79+

License

MIT