mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-11-08 14:54:08 +01:00
enable prettier-plugin-jsdoc
This commit is contained in:
@@ -97,9 +97,7 @@ export const bounds = {
|
||||
updateBounds: function (startx, starty, stopx, stopy) {
|
||||
const _self = this;
|
||||
let cnt = 0;
|
||||
/**
|
||||
* @param {any} type
|
||||
*/
|
||||
/** @param {any} type */
|
||||
function updateFn(type) {
|
||||
return function updateItemBounds(item) {
|
||||
cnt++;
|
||||
@@ -203,7 +201,9 @@ export const bounds = {
|
||||
* Draws an note in the diagram with the attached line
|
||||
*
|
||||
* @param {any} elem - The diagram to draw to.
|
||||
* @param {{x: number, y: number, message: string, width: number}} noteModel - startx: x axis start position, verticalPos: y axis position, messsage: the message to be shown, width: Set this with a custom width to override the default configured width.
|
||||
* @param {{ x: number; y: number; message: string; width: number }} noteModel - Startx: x axis
|
||||
* start position, verticalPos: y axis position, messsage: the message to be shown, width: Set
|
||||
* this with a custom width to override the default configured width.
|
||||
*/
|
||||
const drawNote = function (elem, noteModel) {
|
||||
bounds.bumpVerticalPos(conf.boxMargin);
|
||||
@@ -273,8 +273,8 @@ const actorFont = (cnf) => {
|
||||
/**
|
||||
* Draws a message
|
||||
*
|
||||
* @param {any} g - the parent of the message element
|
||||
* @param {any} msgModel - the model containing fields describing a message
|
||||
* @param {any} g - The parent of the message element
|
||||
* @param {any} msgModel - The model containing fields describing a message
|
||||
*/
|
||||
const drawMessage = function (g, msgModel) {
|
||||
bounds.bumpVerticalPos(10);
|
||||
@@ -786,11 +786,10 @@ export const draw = function (text, id) {
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieves the max message width of each actor, supports signals (messages, loops)
|
||||
* and notes.
|
||||
* Retrieves the max message width of each actor, supports signals (messages, loops) and notes.
|
||||
*
|
||||
* It will enumerate each given message, and will determine its text width, in relation
|
||||
* to the actor it originates from, and destined to.
|
||||
* It will enumerate each given message, and will determine its text width, in relation to the actor
|
||||
* it originates from, and destined to.
|
||||
*
|
||||
* @param {any} actors - The actors map
|
||||
* @param {Array} messages - A list of message objects to iterate
|
||||
@@ -906,11 +905,10 @@ const getRequiredPopupWidth = function (actor) {
|
||||
};
|
||||
|
||||
/**
|
||||
* This will calculate the optimal margin for each given actor, for a given
|
||||
* actor->messageWidth map.
|
||||
* This will calculate the optimal margin for each given actor, for a given actor->messageWidth map.
|
||||
*
|
||||
* An actor's margin is determined by the width of the actor, the width of the
|
||||
* largest message that originates from it, and the configured conf.actorMargin.
|
||||
* An actor's margin is determined by the width of the actor, the width of the largest message that
|
||||
* originates from it, and the configured conf.actorMargin.
|
||||
*
|
||||
* @param {any} actors - The actors map to calculate margins for
|
||||
* @param {any} actorToMessageWidth - A map of actor key -> max message width it holds
|
||||
|
||||
@@ -331,7 +331,7 @@ export const fixLifeLineHeights = (diagram, bounds) => {
|
||||
*
|
||||
* @param {any} elem - The diagram we'll draw to.
|
||||
* @param {any} actor - The actor to draw.
|
||||
* @param {any} conf - drawText implementation discriminator object
|
||||
* @param {any} conf - DrawText implementation discriminator object
|
||||
*/
|
||||
const drawActorTypeParticipant = function (elem, actor, conf) {
|
||||
const center = actor.x + actor.width / 2;
|
||||
@@ -504,11 +504,11 @@ export const anchorElement = function (elem) {
|
||||
/**
|
||||
* Draws an activation in the diagram
|
||||
*
|
||||
* @param {any} elem - element to append activation rect.
|
||||
* @param {any} bounds - activation box bounds.
|
||||
* @param {any} verticalPos - precise y cooridnate of bottom activation box edge.
|
||||
* @param {any} conf - sequence diagram config object.
|
||||
* @param {any} actorActivations - number of activations on the actor.
|
||||
* @param {any} elem - Element to append activation rect.
|
||||
* @param {any} bounds - Activation box bounds.
|
||||
* @param {any} verticalPos - Precise y cooridnate of bottom activation box edge.
|
||||
* @param {any} conf - Sequence diagram config object.
|
||||
* @param {any} actorActivations - Number of activations on the actor.
|
||||
*/
|
||||
export const drawActivation = function (elem, bounds, verticalPos, conf, actorActivations) {
|
||||
const rect = getNoteRect();
|
||||
@@ -524,10 +524,10 @@ export const drawActivation = function (elem, bounds, verticalPos, conf, actorAc
|
||||
/**
|
||||
* Draws a loop in the diagram
|
||||
*
|
||||
* @param {any} elem - elemenet to append the loop to.
|
||||
* @param {any} loopModel - loopModel of the given loop.
|
||||
* @param {any} elem - Elemenet to append the loop to.
|
||||
* @param {any} loopModel - LoopModel of the given loop.
|
||||
* @param {any} labelText - Text within the loop.
|
||||
* @param {any} conf - diagrom configuration
|
||||
* @param {any} conf - Diagrom configuration
|
||||
* @returns {any}
|
||||
*/
|
||||
export const drawLoop = function (elem, loopModel, labelText, conf) {
|
||||
@@ -626,8 +626,8 @@ export const drawLoop = function (elem, loopModel, labelText, conf) {
|
||||
/**
|
||||
* Draws a background rectangle
|
||||
*
|
||||
* @param {any} elem diagram (reference for bounds)
|
||||
* @param {any} bounds shape of the rectangle
|
||||
* @param {any} elem Diagram (reference for bounds)
|
||||
* @param {any} bounds Shape of the rectangle
|
||||
*/
|
||||
export const drawBackgroundRect = function (elem, bounds) {
|
||||
const rectElem = drawRect(elem, {
|
||||
|
||||
Reference in New Issue
Block a user