Increased mem for lint, fixed spell checking, run lint
This commit is contained in:
parent
40f7105ae4
commit
1782f69c8f
|
@ -102,6 +102,7 @@
|
|||
"rehype",
|
||||
"roledescription",
|
||||
"sandboxed",
|
||||
"sankey",
|
||||
"setupgraphviewbox",
|
||||
"shiki",
|
||||
"sidharth",
|
||||
|
|
|
@ -5,6 +5,10 @@ services:
|
|||
stdin_open: true
|
||||
tty: true
|
||||
working_dir: /mermaid
|
||||
# mem_reservation: "10M"
|
||||
mem_limit: '8G'
|
||||
environment:
|
||||
- NODE_OPTIONS=--max_old_space_size=8192
|
||||
volumes:
|
||||
- ./:/mermaid
|
||||
- root_cache:/root/.cache
|
||||
|
|
|
@ -81,6 +81,6 @@ export const addDiagrams = () => {
|
|||
state,
|
||||
journey,
|
||||
quadrantChart,
|
||||
sankey,
|
||||
sankey
|
||||
);
|
||||
};
|
||||
|
|
|
@ -29,6 +29,7 @@ Interviewed,Accepted Offer,1,orange
|
|||
```
|
||||
|
||||
GoJS uses similar approach:
|
||||
|
||||
```json
|
||||
{
|
||||
"nodeDataArray": [
|
||||
|
@ -47,30 +48,34 @@ GoJS uses similar approach:
|
|||
## What do we need
|
||||
|
||||
Mainly we need:
|
||||
* collection of nodes
|
||||
* collection of links
|
||||
|
||||
- collection of nodes
|
||||
- collection of links
|
||||
|
||||
We also need graph and node attributes like this:
|
||||
* link sort
|
||||
* node sort
|
||||
* coloring strategy for links (source, target, transition)
|
||||
* graph alignment (left, right, width)
|
||||
* node color
|
||||
* node title
|
||||
* node width
|
||||
* node padding
|
||||
* graph margin
|
||||
|
||||
- link sort
|
||||
- node sort
|
||||
- coloring strategy for links (source, target, transition)
|
||||
- graph alignment (left, right, width)
|
||||
- node color
|
||||
- node title
|
||||
- node width
|
||||
- node padding
|
||||
- graph margin
|
||||
|
||||
## Desired syntax
|
||||
|
||||
Graph is a list of flows (or links).
|
||||
Flow is a sequence `node -> value -> node -> value...`
|
||||
|
||||
```
|
||||
a -> 30 -> b
|
||||
a -> 40 -> b
|
||||
```
|
||||
|
||||
2 separate streams between 2 nodes they can be grouped as well:
|
||||
|
||||
```
|
||||
a -> {
|
||||
30
|
||||
|
@ -79,6 +84,7 @@ a -> {
|
|||
```
|
||||
|
||||
All outflows from the node can be grouped:
|
||||
|
||||
```
|
||||
a -> {
|
||||
30 -> b
|
||||
|
@ -87,6 +93,7 @@ a -> {
|
|||
```
|
||||
|
||||
All inflows to the node can be grouped too:
|
||||
|
||||
```
|
||||
{
|
||||
a -> 30
|
||||
|
@ -95,6 +102,7 @@ All inflows to the node can be grouped too:
|
|||
```
|
||||
|
||||
Chaining example:
|
||||
|
||||
```
|
||||
a -> {
|
||||
30
|
||||
|
@ -108,6 +116,7 @@ a -> {
|
|||
**Probably ambiguous!**
|
||||
|
||||
Does the sample below mean that total outflow from "a" is 60?
|
||||
|
||||
```
|
||||
a -> 30 -> {
|
||||
b
|
||||
|
@ -116,6 +125,7 @@ a -> 30 -> {
|
|||
```
|
||||
|
||||
Or does this one mean that total outflow must be 140 (70 to "b" and "c" respectively)?
|
||||
|
||||
```
|
||||
a -> {
|
||||
30
|
||||
|
@ -129,6 +139,7 @@ a -> {
|
|||
**Overcomplicated**
|
||||
|
||||
Nested:
|
||||
|
||||
```
|
||||
{
|
||||
{
|
||||
|
|
|
@ -24,17 +24,15 @@ let nodes: {[id: string]: Node} = {};
|
|||
|
||||
const clear = function () {
|
||||
links = [];
|
||||
nodes = {}
|
||||
nodes = {};
|
||||
commonClear();
|
||||
};
|
||||
|
||||
|
||||
type Nullable<T> = T | null;
|
||||
|
||||
|
||||
class Link {
|
||||
sourceNode: Nullable<Node>
|
||||
targetNode: Nullable<Node>
|
||||
sourceNode: Nullable<Node>;
|
||||
targetNode: Nullable<Node>;
|
||||
constructor() {
|
||||
this.sourceNode = null;
|
||||
this.targetNode = null;
|
||||
|
@ -57,14 +55,17 @@ interface IAddLink {
|
|||
const addLink = ({ sourceNodeID, targetNodeID }: IAddLink = {}): Link => {
|
||||
const link: Link = new Link();
|
||||
|
||||
if(typeof(sourceNodeID) !== 'undefined') link.sourceNode = addNode(sourceNodeID);
|
||||
if(typeof(targetNodeID) !== 'undefined') link.targetNode = addNode(targetNodeID);
|
||||
if (sourceNodeID !== undefined) {
|
||||
link.sourceNode = addNode(sourceNodeID);
|
||||
}
|
||||
if (targetNodeID !== undefined) {
|
||||
link.targetNode = addNode(targetNodeID);
|
||||
}
|
||||
|
||||
links.push(link);
|
||||
|
||||
return link;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
class Node {
|
||||
id: string;
|
||||
|
@ -82,13 +83,12 @@ class Node {
|
|||
*/
|
||||
const addNode = (id: string): Node => {
|
||||
id = common.sanitizeText(id, configApi.getConfig());
|
||||
let node: Node;
|
||||
if (nodes[id] === undefined) {
|
||||
nodes[id] = new Node(id);
|
||||
}
|
||||
node = nodes[id];
|
||||
const node = nodes[id];
|
||||
return node;
|
||||
}
|
||||
};
|
||||
|
||||
export default {
|
||||
// sankey interface
|
||||
|
@ -102,5 +102,5 @@ export default {
|
|||
// setAccDescription,
|
||||
getDiagramTitle,
|
||||
setDiagramTitle,
|
||||
clear
|
||||
clear,
|
||||
};
|
||||
|
|
|
@ -11,4 +11,3 @@ export const diagram: DiagramDefinition = {
|
|||
renderer,
|
||||
styles,
|
||||
};
|
||||
|
||||
|
|
|
@ -9,16 +9,15 @@ import { Diagram } from '../../Diagram.js';
|
|||
* @param diagObj - A standard diagram containing the db and the text and type etc of the diagram
|
||||
*/
|
||||
export const draw = function (text: string, id: string, _version: string, diagObj: Diagram) {
|
||||
|
||||
debugger;
|
||||
// debugger;
|
||||
// diagObj.db.clear();
|
||||
diagObj.parser.parse(text);
|
||||
|
||||
// const elem = doc.getElementById(id);
|
||||
|
||||
debugger;
|
||||
// debugger;
|
||||
return 'TEST';
|
||||
}
|
||||
};
|
||||
|
||||
export default {
|
||||
draw,
|
||||
|
|
Loading…
Reference in New Issue