yitzchak / cytoscape-clj

Cytoscape widget for common-lisp-jupyter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cytoscape-clj

A common-lisp-jupyter widget for cytoscape.js.

Installation

The Jupyter Lab frontend code should be installed using the following command:

jupyter-labextension install cytoscape-clj

Once the extension has been installed then widget can be loaded in a notebook using Quicklisp.

(ql:quickload :cytoscape-clj)

Usage

For sample notebooks please see the examples directory. The main widgets are cytoscape-widget and element. For example to create and display a graph use the following.

(make-instance 'cytoscape:cytoscape-widget
               :graph-layouts (list (make-instance 'cytoscape:cose-layout))
               :graph-style "node { label: data(id); }"
               :elements (list (make-instance 'cytoscape:element
                                              :group "nodes"
                                              :data `(:object-alist
                                                      ("id" . "a")))
                               (make-instance 'cytoscape:element
                                              :group "nodes"
                                              :data `(:object-alist
                                                      ("id" . "b")))
                               (make-instance 'cytoscape:element
                                              :group "nodes"
                                              :data `(:object-alist
                                                      ("id" . "c")))
                               (make-instance 'cytoscape:element
                                              :group "edges"
                                              :data `(:object-alist
                                                      ("source" . "a")
                                                      ("target" . "b")))
                               (make-instance 'cytoscape:element
                                              :group "edges"
                                              :data `(:object-alist
                                                      ("source" . "a")
                                                      ("target" . "c")))
                               (make-instance 'cytoscape:element
                                              :group "edges"
                                              :data `(:object-alist
                                                      ("source" . "b")
                                                      ("target" . "c")))))

About

Cytoscape widget for common-lisp-jupyter

License:MIT License


Languages

Language:TypeScript 49.8%Language:Common Lisp 49.8%Language:CSS 0.2%Language:JavaScript 0.1%