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

ndex-store

v0.0.13

Published

A CyStore for NDEx Networks.

Downloads

5

Readme

NDExStore

The NDExStore provides storage and interactions with an NDEx server. The NDExStore contains a lucene store with actions for querying the NDEx repository for networks given a list of search terms. It also contains a server store that contains information about the server and login information. Actions on the server store can change the NDEx target and log in and log out a user.

CyStore Library Name: NDExStore

Note: A CyStore's library name appears in npm, and is the name used for importing the CyStore as a library.

CyStore Registered Name: ndex

Note: The CyStore's registered name appears when it's initialized with the CyFramework in the CyFramework's data model.

Sample Usage

#Create an instance of the CyFramework using the factory method config, pass in the CyStore dependancy list. var cyto = CyFramework.config([NDExStore]) #Dispatch an action to the CyFramework, in this case, we are starting a lucene search for 'brc1' cyto.dispatch(NDExStore.luceneActions.searchFor('brc1') #Get the state of store 'ndex'. This is the data model associated with the NDExStore CyStore. var state = cyto.store('ndex') #Get the list of networks returned from the lucene search, we use .get() because lucene is an immutablejs map. console.log(state.lucene.get('networks'))


lucene
---
> The lucene store is an immutablejs map. The lucene store has a flag indicating whether the client is still searching fo networks (for displaying a spinner, etc). It also containers an error that is filled if the search fails, and a list of networks that contain the results of the previous search.

__Data model__
> ```javascript
  lucene: Map({
    searching: false,
    networkSummaries: Set(),
    error: null
  })

Action Creators

Registed Name: luceneActions

The object under which the action creators are exported under.

searchBegin()

Sets the searching flag to true, use before beginning a search with searchFor/3

searchError(error)

Called from searchFor/3, not normally used elsewhere, sets the error field with the value of error.

Params

  • error: An error object that can be inspected to see the error reason of a failed lucene search.

seachFor(server, query, resultSize)

Begins a lucene search agains the server with a query string, this search will either update networkSummaries or error, depending on the outcome of the search. Either way, it will then flip the searching flag to false.

Params

  • server: A string, usually taken from the server store to reflect the store's choice of server.
  • query: A string, the lucene query to search against NDEx.
  • resultSize(OPTIONAL): Default of 50, setting this to a high value will incease the searchTime. This is the max number of results returned by the lucene search.

server

The server store is an immutable map. It containers information about the NDEx server to be used, the username and password, and the log in state of the user. If loggedIn is false, th userName and userPass fields are considered garbage. Actions allow setting the server name and address, and logging the user in and out.

Data model

lucene: Map({ serverName: "Public NDEx", serverAddress: "http://public.ndexbio.org", userName: "", userPass: "", loggedIn: false })


### Action Creators

__Registed Name:__ serverActions
> The object under which the action creators are exported under. 

#### setServer(name, address)
> Set the server name and address.
>
> __Params__
> - name: A string, a human readable identifier for the server.
> - address: The url of the NDEx server.

#### login(name, pass)
> Sets loggedIn to true, and adds the users credentials (unencrypted).
>
> __Params__
> - name: The user's NDEx username
> - pass: The user's NDEx password 

#### logout()
> Sets the loggedIn flag to false.