https://github.com/connectome-neuprint/vimo-sketches
A react component of the vimo sketching interface.
Science Score: 23.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
○codemeta.json file
-
○.zenodo.json file
-
✓DOI references
Found 4 DOI reference(s) in README -
✓Academic publication links
Links to: biorxiv.org -
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (9.5%) to scientific vocabulary
Last synced: 7 months ago
·
JSON representation
Repository
A react component of the vimo sketching interface.
Basic Info
Statistics
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 0
Fork of VCG/vimo-sketches
Created about 3 years ago
· Last pushed 11 months ago
https://github.com/connectome-neuprint/vimo-sketches/blob/main/
[](https://www.npmjs.com/package/@vimo-public/vimo-sketches) [](https://neuprint.janelia.org/?dataset=manc%3Av1.0&qt=motifquery&q=1) [](https://doi.org/10.1101/2022.12.09.519772) # Vimo Sketches React component for interactively sketching & searching for network motifs.### Examples * Motif analysis in Neuprint. Access [here](https://neuprint.janelia.org/?dataset=manc%3Av1.0&qt=motifquery&q=1) * Motif Analysis in Vimo. Access [here](https://github.com/jakobtroidl/neuronal-motifs) ### Requirements * [npm](https://www.npmjs.com/) (8.1.0 or later) * ```"@testing-library/react": "^12.1.3``` * ```"react": "^17.0.2"``` * ```"react-dom": "^17.0.2"``` ### Install Package ``` bash npm install @vimo-public/vimo-sketches ``` ### Getting Started #### Basic Example ```javascript import {Sketch} from "@vimo-public/vimo-sketches"; import {useState} from "react"; function App() { const [attributes, setAttributes] = useState({ displayMotifCount: false, }); const processRequest = async (motifJson, lim) => { console.log("This function is called upon clicking the search button."); }; return (
); } export default App; ``` #### Node & Edge Attributes If you want to add attributes to nodes or edges, please refer react-awesome-query-builder [config fields](https://github.com/ukrbublik/react-awesome-query-builder/blob/master/CONFIG.adoc#configfields). Also here's an example ````javascript import {Sketch} from "@vimo-public/vimo-sketches"; function App() { const attributes = { NodeFields: { node_attr_1: { label: "attr1_name", type: "text", }, node_attr_2: { label: "attr2_name", type: "select", fieldSettings: { showSearch: true, listValues: [ "alpha", "betha", "theta", ], }, valueSources: ["value"], operators: ["select_equals", "select_not_equals"], }, }, EdgeFields: { edge_attr_1: { label: "attr1_name", type: "number", fieldSettings: { min: 0, }, valueSources: ["value"], preferWidgets: ["number"], }, edge_attr_2: { label: "attr2_name", type: "number", operators: ["greater", "less", "equal"], valueSources: ["value"], }, }, } const processRequest = async (motifJson, lim) => { // this function is called when the user clicks the "Search" button console.log(motifJson); console.log(lim); }; return ( ); } export default App; ```` #### Searching Motifs in NeuPrint We provide a direct interface to sketch & search for networks motifs in large [connectome](https://en.wikipedia.org/wiki/Connectomics) data sets hosted on [Neuprint](https://neuprint.janelia.org). Here's an example of how to use it. ```javascript import React, { useEffect, useState } from "react"; import {Sketch, NeuprintExecutor} from '@vimo-public/vimo-sketches'; function App() { const token = "ADD YOUR TOKEN HERE"; // copy token from here https://neuprint.janelia.org/account const data_server = "https://neuprint.janelia.org/"; const data_version = "hemibrain:v1.2.1"; const vimo_server = "http://127.0.0.1:4242"; // setup instructions https://github.com/VCG/vimo-server const ne = new NeuprintExecutor( data_server, data_version, token, vimo_server ); const processRequest = async (motifJson, lim) => { const query = await ne.json2cypher(motifJson, lim); console.log(query); return query; }; const [isQuerying, setIsQuerying] = useState(false); const [attributes, setAttributes] = useState({ displayMotifCount: false, getMotifCount: ne.getMotifCount, getRelativeMotifCount: ne.getRelativeMotifCount, isQuerying: isQuerying, }); useEffect(async () => { setAttributes({ ...attributes, NodeFields: await ne.getNodeFields(), EdgeFields: await ne.getEdgeFields(), }); }, []); return ( ); } export default App; ``` ### Sketch Component Props
| Name | Sub-field | Description | Type |
|---|---|---|---|
| processRequest(query) | N/A | callback function for search button | Function |
| attributes | isQuerying | enable/disable search button | Boolean |
| NodeFields | constraint fields for node | Object | |
| EdgeFields | constraint fields for edge | Object | |
| getMotifCount | get count of motif in network | Function | |
| getRelativeMotifCount | get relative count of motif in network | Function | |
| buttonText | text on button, default is "Search" | String | |
| nodeColors | color set for nodes in sketch, default is ["#9400D3", "#DAA520", "#97d0b5", "#76acf3", "#FF6347", "#4C56B3", "#D9C226", "#263DD9",] | Array |
Owner
- Name: NeuPrint
- Login: connectome-neuprint
- Kind: organization
- Email: neuprint@janelia.hhmi.org
- Repositories: 19
- Profile: https://github.com/connectome-neuprint
GitHub Events
Total
- Push event: 3
- Create event: 3
Last Year
- Push event: 3
- Create event: 3