Code Monkey home page Code Monkey logo

classstorediagram's Introduction

ClassStoreDiagram

language language-top code-size release license discord

Create class diagram for your class store.

Usage

Get the diagram passing your cs

Choose a format between mermaid and graphiz dot

$diagram:=csDiagram(cs).mermaid()
$diagram:=csDiagram(cs).dot()

Get the diagram raw source

$txtSource:=$diagram.source

Get an svg

using the remote service kroki.io

kroki.io is a free service to convert diagrams to images. (It can be self hosted)

$diagram.kroki().svg

using a web page

Copy paste the diagram source into this online service

You could also make your own converter like this example using js libraries.

Install softwares

Alternatively you can install cli tools to convert diagrams.

Result for the provide example base

WebGraph database contains some shape classes.

The result of code

cscsDiagram(cs).mermaid().source

is

classDiagram
	class Square {
	}
	class Rectangle {
	}
	class Spline {
	}
	class Ellipse {
	}
	class EntitySelection {
	}
	class Shape {
	}
	class Polygon {
	}
	class Circle {
	}
	class Entity {
	}
	class DataClass {
	}
	class _DataStore {
	}
Rectangle <|-- Square
Shape <|-- Rectangle
Shape <|-- Spline
Shape <|-- Ellipse
Object <|-- EntitySelection
Object <|-- Shape
Shape <|-- Polygon
Shape <|-- Circle
Object <|-- Entity
Object <|-- DataClass
Object <|-- _DataStore
Loading

Macro

You can find macro file here

macro_csDiagram will generate diagrams each time you create or save a class into Documentation/classDiagram.md and Documentation/classDiagram.mermaid.

Then each time you close a class or type in code run kroki, the svg will be saved into Documentation/classDiagram.svg. classDiagram.svg) example

Then you can display it in your documentation: svg

A .csDiagram.json file will be create into your root database folder. You can put "kroki": false if you do not want svg convertion.

Ignore classes

You could ignore some class by defining a list of ignored class name

$csDiagram:=csDiagram(cs)
$csDiagram.ignore:=New collection("Object";"MyPrivateClass")

macro

In configuration file .csDiagram.json you could also define the list of ignored class name. .csDiagram.json example

Installing

On macOS open a terminal in your database root folder.

Using latest release

Download the latest release and put it into the Components/ folder

You could do it using this command in terminal.

mkdir -p Components && curl -L https://github.com/mesopelagique/ClassStoreDiagram/releases/latest/download/ClassStoreDiagram.4DZ --output Components/ClassStoreDiagram.4dz

Using git submodule

to use source code

git submodule add https://github.com/mesopelagique/ClassStoreDiagram.git Components/ClassStoreDiagram.4dbase

to use binary

git submodule add https://github.com/mesopelagique/ClassStoreDiagram.git Components/ClassStoreDiagram

Open the project, for instance in macOS

open Components/ClassStoreDiagram/Project/ClassStoreDiagram.4DProject

Buil it to your database folder. A Components/ClassStoreDiagram.4dbase will be created with inside the ClassStoreDiagram.4dz


mesopelagique

classstorediagram's People

Contributors

mesopelagique avatar dependabot[bot] avatar e-marchand avatar dbeaubien avatar

Forkers

slanecon

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.