This is a npm data-structure application service and package: The former is work in progress; the latter exhibits a more mature form. It is a bootstrap from this project: https://github.com/trekhleb/javascript-algorithms.
"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
Here is an example of the library use case.
- Navigate to your project path (for example, NodeJS or React);
- Install the library by command run
npm install --save quivero-api
; - Import in your project, for example,
import Graph from 'quivero-api/data-structures/graph/Graph.js'
We host the app on a cloud service {AWS, Azure, GCloud}
or run locally. For it, we run either commands below:
- Dockerfile:
docker build -t quivero . &&& docker run --publish 8080:8080 quivero
- docker-compose:
docker-compose up
We follow the instructions below to host the service locally:
-
Clone the repository by command run on terminal:
git clone git@github.com:quivero/quivero-api.git
; -
Run the commands:
2.1.
npm install
: install local dependencies;2.2.
npm start
: run the server locally; -
Go to route
localhost:8080
on the URL field of predilect browser;
The library Mermaid offers a graphical manner to visualize, among others, graphs. It is a feature as a parser for development tool FlowBuild workflow JSON-artifacts, available here. There are some samples here.
For diagrams rendering, you need to:
- Copy the text file content available here;
- Open online Mermaid Editor here;
- Paste the copied content from item 1) on the respective text field;
- In the case of big enough textual diagram, the platform will complain and deactivate auto-rendering. You must reactivate it to see the rendered diagram.
Remark: 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. We follow instructions below:
- Open online tool FreeFormater;
- Copy-paste the text on the text field;
- Press
Unescape JSON
: the unescaped text appears on text field below.
There are similar libraries in different languages for the particular case of data-structure "graph" e.g. networkx: they provide multiple concepts for graph formalization and defition whose current author's knowledge lacks. Hence, it seems reasonable to offer similar features in these directions.
A glossary with implementation possibilities is available here. This package author is sofar able to obtain the following ideas from it:
-
data-structures/graph/Graph.js:
- isTraceable(): definition
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