quivero-api
v6.1.0
Published
Package to handle dot-quiver-based structures
Downloads
3
Maintainers
Readme
Some structures, many possibilities
Hi, this may be interpreted as an app service or a library: The former is work in progress; the latter exhibits a more mature form.
Its objective is to provide some data structures for application-suitable scenarios. It was bootstraped from this project: https://github.com/trekhleb/javascript-algorithms .
Table of contents
Preamble
"In computer science, a data structure is a data organization, management, and storage format that enables efficient access and modification. More precisely, a data structure is a collection of data values, the relationships among them, and the functions or operations that can be applied to the data i.e., it is an algebraic structure about data." From wikipedia
How to run
As a package
The package allows to be used as a library. Here is an example of the library use case.
- Go to your project path (for example, NodeJS or React);
- Install the library with the command
npm install --save quivero-api
; - Import in your project folder from project root folder, for example,
import Graph from 'quivero-api/data-structures/graph/Graph.js'
As a service
You may utilize some cloud service to host the app, like AWS, Azure or GCloud, but in this case you might run locally. You can use the docker file by building and running the application with commands below
>>> docker build -t quivero . &&& docker run --publish 8080:8080 quivero
To host it locally, you must follow the instructions below:
Clone the repository typing on terminal
git clone [email protected]:quivero/quivero-api.git
;Run the commands:
2.1.
npm install
: install local dependencies;2.2.
npm start
: run the server locally;Open a browser;
Type
localhost:8080
on the URL field;
Featured
The library Mermaid offers a graphical manner to visualize graphs. It is a feature as a parser for Flowbuild Workflow blueprints, available here. There are some samples here.
For diagrams rendering, you need to:
- Copy the content of some text file from this path;
- Enter on the Mermaid Editor here;
- Paste the copied content from item 1) on the respective text field;
- In case the diagram is too big, the platform will complain and deactivate auto-rendering. You must reactivate it to see the rendered diagram.
The resulting diagram text-code outputs as a string with escape characters \n
. The online tool FreeFormater allows the developer to indent the text without these non-compilable escape characters. Copy-paste the text on the text field and press Unescape JSON
: the unescaped text appears on text field below.
Backlog
As a solution
I ask the reader apologies for the author's envy regarding similar python library networkx. They provide multiple concepts for graph formalization and defition whose author's knowledge lacks. Hence, it seems reasonable to offer similar features in this directions.
As a Package
A glossary with implementation possibilities is available here. The author of this library is able sofar to obtain the following ideas from it:
data-structures/graph/Graph.js:
- [ ] isTraceable(): definition
Prelude
In case you run it as a service, nodemon may disappear from terminal. You may kill the process by run of command fuser -k 8080/tcp