HtmlForgeX

API Reference

Class

VisNetworkHtmlNode

Namespace HtmlForgeX
Assembly HtmlForgeX

Represents a VisNetwork node with full HTML support using the visjs-html-nodes plugin. This allows for rich HTML content in nodes including divs, spans, lists, tables, images, and more. Note: This requires the visjs-html-nodes plugin to be loaded. When using this node type, the VisNetworkHtmlNodes library will be automatically registered.

Inheritance

  • Object
  • VisNetworkHtmlNode

Constructors

public VisNetworkHtmlNode(String id) #

Initializes a new instance of the VisNetworkHtmlNode class.

Parameters

id System.String requiredposition: 0
The unique identifier for the node

Methods

GetHtmlContent() #

Gets the HTML content for this node.

public VisNetworkHtmlNode WithBadge(String text, String backgroundColor = "#007bff", String textColor = "white") #
Returns: VisNetworkHtmlNode

Creates a badge/tag style node.

Parameters

text System.String requiredposition: 0
The badge text
backgroundColor System.String = "#007bff" optionalposition: 1
The background color
textColor System.String = "white" optionalposition: 2
The text color

Returns

The current instance for method chaining

public VisNetworkHtmlNode WithCard(String header, String body, String headerColor = null) #
Returns: VisNetworkHtmlNode

Creates a card-style node with header and body sections.

Parameters

header System.String requiredposition: 0
The header content
body System.String requiredposition: 1
The body content
headerColor System.String = null optionalposition: 2
Optional header background color

Returns

The current instance for method chaining

public VisNetworkHtmlNode WithHtmlBuilder(Action<VisNetworkHtmlBuilder> builderAction) #
Returns: VisNetworkHtmlNode

Builds a custom HTML content using a fluent builder.

Parameters

builderAction System.Action{HtmlForgeX.VisNetworkHtmlBuilder} requiredposition: 0
The action to configure the HTML builder

Returns

The current instance for method chaining

public VisNetworkHtmlNode WithHtmlContent(String html) #
Returns: VisNetworkHtmlNode

Sets the raw HTML content for the node. This allows complete control over the node's HTML structure.

Parameters

html System.String requiredposition: 0
The HTML content

Returns

The current instance for method chaining

public VisNetworkHtmlNode WithImage(String imageUrl, String caption = null, Nullable<Int32> width = null, Nullable<Int32> height = null) #
Returns: VisNetworkHtmlNode

Creates an image node with optional caption.

Parameters

imageUrl System.String requiredposition: 0
The URL of the image
caption System.String = null optionalposition: 1
Optional caption text
width System.Nullable{System.Int32} = null optionalposition: 2
Optional width in pixels
height System.Nullable{System.Int32} = null optionalposition: 3
Optional height in pixels

Returns

The current instance for method chaining

public VisNetworkHtmlNode WithList(String title, String[] items, Boolean ordered = false) #
Returns: VisNetworkHtmlNode

Creates a list-style node with items.

Parameters

title System.String requiredposition: 0
The title of the list
items System.String[] requiredposition: 1
The list items
ordered System.Boolean = false optionalposition: 2
Whether to use ordered list (numbers) or unordered (bullets)

Returns

The current instance for method chaining

public VisNetworkHtmlNode WithProgressBar(String label, Int32 percentage, String color = "#4CAF50") #
Returns: VisNetworkHtmlNode

Creates a progress bar node.

Parameters

label System.String requiredposition: 0
The label for the progress
percentage System.Int32 requiredposition: 1
The percentage complete (0-100)
color System.String = "#4CAF50" optionalposition: 2
The color of the progress bar

Returns

The current instance for method chaining

public VisNetworkHtmlNode WithStatus(String status, String iconColor, String description = null) #
Returns: VisNetworkHtmlNode

Creates a status indicator node with icon and text.

Parameters

status System.String requiredposition: 0
The status text
iconColor System.String requiredposition: 1
The color of the status indicator
description System.String = null optionalposition: 2
Optional description text

Returns

The current instance for method chaining

public VisNetworkHtmlNode WithTable(String[] headers, String[][] rows) #
Returns: VisNetworkHtmlNode

Creates a table-style node.

Parameters

headers System.String[] requiredposition: 0
The table headers
rows System.String[][] requiredposition: 1
The table rows (2D array)

Returns

The current instance for method chaining

Properties

public String Id { get; } #

Gets the unique identifier of the node.

IsHtmlNode #

Indicates whether this is an HTML node (always true for this class).