Skip to main content

ElementClickEventArgs

Namespace: Wisej.Web.Ext.Mermaid

Assembly: Wisej.Web.Ext.Mermaid (4.1.0.0)

Provides data for the ElementClick event of the Mermaid control.

public class ElementClickEventArgs : MouseEventArgs

Properties​

Instance member Data​

Object: Returns additional data about the clicked element.

This dynamic object may contain properties like:

  • tagName - The HTML tag name of the clicked element
  • text - Text content of the element
  • id - Element ID
  • dataId - Mermaid's data-id attribute
  • className - CSS class names
  • elementType - Type of Mermaid element (node, edge, cluster, etc.)
  • parentId - Parent element's ID
  • parentDataId - Parent element's data-id
  • ariaLabel - Aria label (useful for edges)

The object also contains the raw button, x and y values sent by the browser. Fields that are not available are null or missing.

Example:

Navigating to the details of the clicked node:

private void mermaid1_ElementClick(object sender, ElementClickEventArgs e)
{
string type = e.Data?.elementType;
if (type != null && type.StartsWith("node"))
ShowDetails(e.Element, (string)e.Data.parentId);
}

Instance member Element​

String: Returns the text of the element in the Mermaid diagram that was clicked by the user.

This is the trimmed text content of the clicked element or, when it has no text, of its parent Mermaid node, edge or cluster. The event is not fired for elements without any text.

Used By​

NameDescription
ElementClickEventHandlerRepresents the method that will handle the ElementClick event in a Mermaid control.