quivero-api

6.1.0 • Public • Published

Some structures, many possibilities

StandWithUkraine npm version Documentation Status Code coverage report

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

  1. Preamble
  2. How to run
  3. Featured
  4. Backlog
  5. Prelude

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.

  1. Go to your project path (for example, NodeJS or React);
  2. Install the library with the command npm install --save quivero-api;
  3. 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:

  1. Clone the repository typing on terminal git clone git@github.com:quivero/quivero-api.git;

  2. Run the commands:

    2.1. npm install: install local dependencies;

    2.2. npm start: run the server locally;

  3. Open a browser;

  4. 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:

  1. Copy the content of some text file from this path;
  2. Enter on the Mermaid Editor here;
  3. Paste the copied content from item 1) on the respective text field;
  4. 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:

  1. data-structures/graph/Graph.js:

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

Package Sidebar

Install

npm i quivero-api

Weekly Downloads

0

Version

6.1.0

License

MIT

Unpacked Size

17.1 MB

Total Files

515

Last publish

Collaborators

  • brunolnetto