API Reference
Class
VisNetworkHtmlBuilder
Provides a fluent API for building complex HTML content for VisNetwork HTML nodes. This builder supports all HTML tags and styling when used with the visjs-html-nodes plugin.
Inheritance
- Object
- VisNetworkHtmlBuilder
Constructors
public VisNetworkHtmlBuilder() #Initializes a new instance of the VisNetworkHtmlBuilder class.
Methods
public VisNetworkHtmlBuilder Div(String content, String style = null, String className = null) #Returns:
VisNetworkHtmlBuilderAdds a div element with optional styling.
Parameters
- content System.String
- The content of the div
- style System.String = null
- Optional inline CSS style
- className System.String = null
- Optional CSS class name
Returns
The builder for method chaining
public VisNetworkHtmlBuilder Heading(Int32 level, String content, String style = null) #Returns:
VisNetworkHtmlBuilderAdds a heading element.
Parameters
- level System.Int32
- The heading level (1-6)
- content System.String
- The content of the heading
- style System.String = null
- Optional inline CSS style
Returns
The builder for method chaining
public VisNetworkHtmlBuilder Image(String src, String alt = null, String style = null) #Returns:
VisNetworkHtmlBuilderAdds an image.
Parameters
- src System.String
- The image source URL
- alt System.String = null
- The alt text
- style System.String = null
- Optional inline CSS style
Returns
The builder for method chaining
public VisNetworkHtmlBuilder LineBreak() #Returns:
VisNetworkHtmlBuilderAdds a line break.
Returns
The builder for method chaining
public VisNetworkHtmlBuilder Paragraph(String content, String style = null) #Returns:
VisNetworkHtmlBuilderAdds a paragraph element.
Parameters
- content System.String
- The content of the paragraph
- style System.String = null
- Optional inline CSS style
Returns
The builder for method chaining
public VisNetworkHtmlBuilder RawHtml(String html) #Returns:
VisNetworkHtmlBuilderAdds raw HTML content (use with caution).
Parameters
- html System.String
- The raw HTML to add
Returns
The builder for method chaining
public VisNetworkHtmlBuilder Span(String content, String style = null, String className = null) #Returns:
VisNetworkHtmlBuilderAdds a span element with optional styling.
Parameters
- content System.String
- The content of the span
- style System.String = null
- Optional inline CSS style
- className System.String = null
- Optional CSS class name
Returns
The builder for method chaining
public VisNetworkHtmlBuilder UnorderedList(String[] items, String style = null) #Returns:
VisNetworkHtmlBuilderAdds an unordered list.
Parameters
- items System.String[]
- The list items
- style System.String = null
- Optional inline CSS style for the list
Returns
The builder for method chaining