HtmlForgeX

API Reference

Class

VisNetworkRemoteDataOptions

Namespace HtmlForgeX
Assembly HtmlForgeX
Modifiers sealed

Remote data loading options for VisNetwork (nodes/edges fetched via HTTP).

Inheritance

  • Object
  • VisNetworkRemoteDataOptions

Constructors

public VisNetworkRemoteDataOptions(String url) #

Creates a new remote data configuration.

Parameters

url System.String requiredposition: 0
Remote endpoint that returns JSON.

Methods

public VisNetworkRemoteDataOptions WithHeader(String name, String value) #
Returns: VisNetworkRemoteDataOptions

Adds or replaces a request header.

Parameters

name System.String requiredposition: 0
Header name.
value System.String requiredposition: 1
Header value.

Returns

The current options instance.

public VisNetworkRemoteDataOptions WithIncludeCredentials(Boolean include = true) #
Returns: VisNetworkRemoteDataOptions

When enabled, fetch credentials are set to "include" (cookies/authorization headers).

Parameters

include System.Boolean = true optionalposition: 0
True to include credentials.

Returns

The current options instance.

public VisNetworkRemoteDataOptions WithJsonBody(Object body) #
Returns: VisNetworkRemoteDataOptions

Sets an optional JSON request body object. This is serialized with JSON.stringify.

Parameters

body System.Object requiredposition: 0
Body object to serialize.

Returns

The current options instance.

public VisNetworkRemoteDataOptions WithMethod(String method) #
Returns: VisNetworkRemoteDataOptions

Sets the HTTP method used for the request.

Parameters

method System.String requiredposition: 0
HTTP method (e.g. GET, POST).

Returns

The current options instance.

public VisNetworkRemoteDataOptions WithoutLiveUpdates() #
Returns: VisNetworkRemoteDataOptions

Disables live updates (remote data will be fetched once).

public VisNetworkRemoteDataOptions WithPolling(Int32 intervalMs, String updatesUrl = null) #
Returns: VisNetworkRemoteDataOptions

Enables periodic polling updates using fetch(). The same request options (Method, Headers, body, credentials, timeout) are used for each poll.

Parameters

intervalMs System.Int32 requiredposition: 0
Polling interval in milliseconds. Set 0 to disable live updates.
updatesUrl System.String = null optionalposition: 1
Optional separate URL for updates. When null/empty, Url is used.
public VisNetworkRemoteDataOptions WithServerSentEvents(String updatesUrl = null, Boolean withCredentials = false) #
Returns: VisNetworkRemoteDataOptions

Enables live updates via Server-Sent Events (EventSource). The server should emit JSON payloads shaped like: { "nodes": [...], "edges": [...] }.

Parameters

updatesUrl System.String = null optionalposition: 0
Optional separate URL for updates. When null/empty, Url is used.
withCredentials System.Boolean = false optionalposition: 1
When true, passes EventSource withCredentials.
public VisNetworkRemoteDataOptions WithTimeoutMs(Int32 milliseconds) #
Returns: VisNetworkRemoteDataOptions

Sets the request timeout in milliseconds. Use 0 to disable.

Parameters

milliseconds System.Int32 requiredposition: 0
Timeout in milliseconds.

Returns

The current options instance.

public VisNetworkRemoteDataOptions WithWebSocket(String updatesUrl = null) #
Returns: VisNetworkRemoteDataOptions

Enables live updates via WebSocket. The server should send JSON payloads shaped like: { "nodes": [...], "edges": [...] }.

Parameters

updatesUrl System.String = null optionalposition: 0
Optional separate URL for updates. When null/empty, Url is used.

Properties

public String Url { get; } #

Remote endpoint that returns JSON.

public String Method { get; set; } #

HTTP method used for the request (default: GET).

public Int32 TimeoutMs { get; set; } #

Abort request after this timeout (milliseconds). Default: 30000. Set 0 to disable.

public Boolean IncludeCredentials { get; set; } #

When true, sets fetch credentials to "include" (cookies/authorization headers). For same-origin calls, fetch defaults to "same-origin" which already includes cookies.

public Dictionary<String, String> Headers { get; } #

Optional request headers.

public Object JsonBodyObject { get; set; } #

Optional JSON body object. If provided and method is not GET/HEAD, it is JSON.stringified.

public VisNetworkRemoteUpdateTransport UpdateTransport { get; set; } #

Live update transport for remote mode (default: None).

public String UpdatesUrl { get; set; } #

Optional separate URL used for live updates (polling/SSE/WS). When null, Url is used.

public Int32 PollingIntervalMs { get; set; } #

Polling interval (milliseconds) when UpdateTransport is Polling.

public Boolean ServerSentEventsWithCredentials { get; set; } #

When using Server-Sent Events, enables EventSource withCredentials. Note: headers cannot be set for EventSource in browsers.