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

biojs-vis-pinpad

v0.1.8

Published

A component to pin tootlip-like information

Downloads

2

Readme

biojs-vis-pinpad

A biojs component to pin information. The motivation behind it is being able to pin tooltips from the https://github.com/ebi-uniprot/biojs-vis-proteinFeaturesViewer. Ideally it should be flexible enough to accomodate any similar information. Note: This is an ongoing project on a pretty early stage, please be aware that this is under development, not ready to be use yet!

##Data structure This component is inteded to be flexible enough so other components can use it. In order to get such flexibility, a data structure has been defined to cover as many cases as possible. In theory, the component should be able to handle sub-sections within sub-section but it has only be tested up to one sub-section level.

###Component initialization

{
  ordering: [] //array of strings
  , options: {
    el: object //this component will be append to it    
    , height: number //in pixels of percentage, 500px by default
    , width: number //in pixels or percentage, 250px by default
    , highlightColor: color //used to highlight the most recently pinned element with a shade effect, green by default
  }
  , toPin: object //element to pin, see description below
}

###Instantiation example

var app = require("biojs-vis-pinpad");
var instance = new app({
    ordering: ['type', 'start', 'end'],
    options: {
        el: appDiv
        , width: '220px'
        , height: '320px'
        , highlightColor: 'green'
    }
});

###Elements to pin

Pinned elementes will be organized in a table. Pinned data will have "keys" and "values", "keys" will be capitalized and displayed on the left column while "values" will be displayed on the right column. Multiple sections are allowed, section titles will be displayed in two columns with a darker background. Somo styling can be specified too.

Any field with an _# can be replaced by any valid JSON key name, any other key should appear as it is shown.

{
  category: String //mandatory, used to grouped pinned elements
  , id: String //unique id, no duplicated ids are allowed
  , ordering: {
    //one field for each stringspecified in the ordering element on instantiation
  }
  , sections: {
    title: String //will be displayed with a darker background
    , information: {
      key_1: value //String or number will be directly displayed
      , key_2: {
        value: String //will be wrapped as an HTML link
        , link: URL 
      }
      , key_3: [] //elements in arrays will be separated by commas, elements can be any combination of Strings, numbers or pairs (value, link)
      , styled_key_1: {
        key: String //will be displayed on the left column
        , key_right: boolean //if true, then the key will be moved to the value column
        , key_style: style string //optional
        , value: String/Number/Pair of (value, link))/Array
        , value_style: style string//optional
      } 
    }
  }
}

###Element to pin example

{
    "category": "Variants",
    "id": "ft_206",
    ordering: {
        type: 'missense',
        start: 301,
        end: 301
    },
    "sections": [{
        "title": "missense 301-301",
        "information": {
            "source": "Large scale studies",
            "description": "primary tissue(s): large intestine",
            "mutation": "R > G",
            "polyphen": "probably damaging, score 0.9309999942779541",
            "sift": "deleterious, score 0",
            "styled_evidence_1": {
                "key": "Evidence",
                "key_style": "background-color: #E8E8E8",
                "value": "Imported",
                "value_style": "background-color: #E8E8E8"
            },
            "styled_evidenceArray_cosmic_1": {
                "key": "cosmic",
                "key_right": true,
                "key_style": "text-align: right; background-color: #F0F0F0",
                "value": [{
                    "value": "COSM1413501",
                    "link": "http://cancer.sanger.ac.uk/cosmic/mutation/overview?id=1413501"
                }],
                "value_style": "background-color: #F0F0F0"
            },
            "styled_evidenceArray_cosmic_study_1": {
                "key": "cosmic_study",
                "key_style": "text-align: right; background-color: #F0F0F0",
                "value": [{
                    "value": "COSU:376",
                    "link": "http://cancer.sanger.ac.uk/cosmic/study/overview?study_id=376"
                }],
                "value_style": "background-color: #F0F0F0"
            }
        }
    }]
}

###More examples Please see the data provided for the snippets at https://github.com/ebi-uniprot/biojs-vis-pinpad/tree/master/snippets/data