mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-25 18:30:10 +02:00
enable eslint fix and eslint-plugin-jsdoc
This commit is contained in:

committed by
Matthieu Morel

parent
c29c8bd33c
commit
4d103c14f7
@@ -29,6 +29,7 @@ export const parseDirective = function (statement, context, type) {
|
||||
|
||||
/**
|
||||
* Function to lookup domId from id in the graph definition.
|
||||
*
|
||||
* @param id
|
||||
* @public
|
||||
*/
|
||||
@@ -44,11 +45,13 @@ export const lookUpDomId = function (id) {
|
||||
|
||||
/**
|
||||
* Function called by parser when a node definition has been found
|
||||
* @param id
|
||||
*
|
||||
* @param _id
|
||||
* @param text
|
||||
* @param type
|
||||
* @param style
|
||||
* @param classes
|
||||
* @param dir
|
||||
*/
|
||||
export const addVertex = function (_id, text, type, style, classes, dir) {
|
||||
let txt;
|
||||
@@ -110,8 +113,9 @@ export const addVertex = function (_id, text, type, style, classes, dir) {
|
||||
|
||||
/**
|
||||
* Function called by parser when a link/edge definition has been found
|
||||
* @param start
|
||||
* @param end
|
||||
*
|
||||
* @param _start
|
||||
* @param _end
|
||||
* @param type
|
||||
* @param linktext
|
||||
*/
|
||||
@@ -152,8 +156,9 @@ export const addLink = function (_start, _end, type, linktext) {
|
||||
|
||||
/**
|
||||
* Updates a link's line interpolation algorithm
|
||||
* @param pos
|
||||
* @param interpolate
|
||||
*
|
||||
* @param positions
|
||||
* @param interp
|
||||
*/
|
||||
export const updateLinkInterpolate = function (positions, interp) {
|
||||
positions.forEach(function (pos) {
|
||||
@@ -167,7 +172,8 @@ export const updateLinkInterpolate = function (positions, interp) {
|
||||
|
||||
/**
|
||||
* Updates a link with a style
|
||||
* @param pos
|
||||
*
|
||||
* @param positions
|
||||
* @param style
|
||||
*/
|
||||
export const updateLink = function (positions, style) {
|
||||
@@ -204,6 +210,7 @@ export const addClass = function (id, style) {
|
||||
|
||||
/**
|
||||
* Called by parser when a graph definition is found, stores the direction of the chart.
|
||||
*
|
||||
* @param dir
|
||||
*/
|
||||
export const setDirection = function (dir) {
|
||||
@@ -224,6 +231,7 @@ export const setDirection = function (dir) {
|
||||
|
||||
/**
|
||||
* Called by parser when a special node is found, e.g. a clickable element.
|
||||
*
|
||||
* @param ids Comma separated list of ids
|
||||
* @param className Class to add
|
||||
*/
|
||||
@@ -298,8 +306,10 @@ const setClickFun = function (id, functionName, functionArgs) {
|
||||
|
||||
/**
|
||||
* Called by parser when a link is found. Adds the URL to the vertex data.
|
||||
*
|
||||
* @param ids Comma separated list of ids
|
||||
* @param linkStr URL to create a link for
|
||||
* @param target
|
||||
*/
|
||||
export const setLink = function (ids, linkStr, target) {
|
||||
ids.split(',').forEach(function (id) {
|
||||
@@ -316,9 +326,10 @@ export const getTooltip = function (id) {
|
||||
|
||||
/**
|
||||
* Called by parser when a click definition is found. Registers an event handler.
|
||||
*
|
||||
* @param ids Comma separated list of ids
|
||||
* @param functionName Function to be called on click
|
||||
* @param tooltip Tooltip for the clickable element
|
||||
* @param functionArgs
|
||||
*/
|
||||
export const setClickEvent = function (ids, functionName, functionArgs) {
|
||||
ids.split(',').forEach(function (id) {
|
||||
@@ -337,6 +348,7 @@ export const getDirection = function () {
|
||||
};
|
||||
/**
|
||||
* Retrieval function for fetching the found nodes after parsing has completed.
|
||||
*
|
||||
* @returns {{}|*|vertices}
|
||||
*/
|
||||
export const getVertices = function () {
|
||||
@@ -345,6 +357,7 @@ export const getVertices = function () {
|
||||
|
||||
/**
|
||||
* Retrieval function for fetching the found links after parsing has completed.
|
||||
*
|
||||
* @returns {{}|*|edges}
|
||||
*/
|
||||
export const getEdges = function () {
|
||||
@@ -353,6 +366,7 @@ export const getEdges = function () {
|
||||
|
||||
/**
|
||||
* Retrieval function for fetching the found class definitions after parsing has completed.
|
||||
*
|
||||
* @returns {{}|*|classes}
|
||||
*/
|
||||
export const getClasses = function () {
|
||||
@@ -396,6 +410,8 @@ funs.push(setupToolTips);
|
||||
|
||||
/**
|
||||
* Clears the internal graph db so that a new graph can be parsed.
|
||||
*
|
||||
* @param ver
|
||||
*/
|
||||
export const clear = function (ver) {
|
||||
vertices = {};
|
||||
@@ -423,6 +439,10 @@ export const defaultStyle = function () {
|
||||
|
||||
/**
|
||||
* Clears the internal graph db so that a new graph can be parsed.
|
||||
*
|
||||
* @param _id
|
||||
* @param list
|
||||
* @param _title
|
||||
*/
|
||||
export const addSubGraph = function (_id, list, _title) {
|
||||
// console.log('addSubGraph', _id, list, _title);
|
||||
@@ -431,6 +451,9 @@ export const addSubGraph = function (_id, list, _title) {
|
||||
if (_id === _title && _title.match(/\s/)) {
|
||||
id = undefined;
|
||||
}
|
||||
/**
|
||||
* @param a
|
||||
*/
|
||||
function uniq(a) {
|
||||
const prims = { boolean: {}, number: {}, string: {} };
|
||||
const objs = [];
|
||||
@@ -701,6 +724,9 @@ const exists = (allSgs, _id) => {
|
||||
};
|
||||
/**
|
||||
* Deletes an id from all subgraphs
|
||||
*
|
||||
* @param sg
|
||||
* @param allSubgraphs
|
||||
*/
|
||||
const makeUniq = (sg, allSubgraphs) => {
|
||||
const res = [];
|
||||
|
Reference in New Issue
Block a user