API Reference
VisNetworkHtmlNode
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
- 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") #VisNetworkHtmlNodeCreates a badge/tag style node.
Parameters
- text System.String
- The badge text
- backgroundColor System.String = "#007bff"
- The background color
- textColor System.String = "white"
- The text color
Returns
The current instance for method chaining
public VisNetworkHtmlNode WithCard(String header, String body, String headerColor = null) #VisNetworkHtmlNodeCreates a card-style node with header and body sections.
Parameters
- header System.String
- The header content
- body System.String
- The body content
- headerColor System.String = null
- Optional header background color
Returns
The current instance for method chaining
public VisNetworkHtmlNode WithHtmlBuilder(Action<VisNetworkHtmlBuilder> builderAction) #VisNetworkHtmlNodeBuilds a custom HTML content using a fluent builder.
Parameters
- builderAction System.Action{HtmlForgeX.VisNetworkHtmlBuilder}
- The action to configure the HTML builder
Returns
The current instance for method chaining
public VisNetworkHtmlNode WithHtmlContent(String html) #VisNetworkHtmlNodeSets the raw HTML content for the node. This allows complete control over the node's HTML structure.
Parameters
- html System.String
- 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) #VisNetworkHtmlNodeCreates an image node with optional caption.
Parameters
- imageUrl System.String
- The URL of the image
- caption System.String = null
- Optional caption text
- width System.Nullable{System.Int32} = null
- Optional width in pixels
- height System.Nullable{System.Int32} = null
- Optional height in pixels
Returns
The current instance for method chaining
public VisNetworkHtmlNode WithList(String title, String[] items, Boolean ordered = false) #VisNetworkHtmlNodeCreates a list-style node with items.
Parameters
- title System.String
- The title of the list
- items System.String[]
- The list items
- ordered System.Boolean = false
- 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") #VisNetworkHtmlNodeCreates a progress bar node.
Parameters
- label System.String
- The label for the progress
- percentage System.Int32
- The percentage complete (0-100)
- color System.String = "#4CAF50"
- The color of the progress bar
Returns
The current instance for method chaining
public VisNetworkHtmlNode WithStatus(String status, String iconColor, String description = null) #VisNetworkHtmlNodeCreates a status indicator node with icon and text.
Parameters
- status System.String
- The status text
- iconColor System.String
- The color of the status indicator
- description System.String = null
- Optional description text
Returns
The current instance for method chaining
public VisNetworkHtmlNode WithTable(String[] headers, String[][] rows) #VisNetworkHtmlNodeCreates a table-style node.
Parameters
- headers System.String[]
- The table headers
- rows System.String[][]
- The table rows (2D array)
Returns
The current instance for method chaining