API Reference
VisNetworkRemoteDataOptions
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
- Remote endpoint that returns JSON.
Methods
public VisNetworkRemoteDataOptions WithHeader(String name, String value) #VisNetworkRemoteDataOptionsAdds or replaces a request header.
Parameters
- name System.String
- Header name.
- value System.String
- Header value.
Returns
The current options instance.
public VisNetworkRemoteDataOptions WithIncludeCredentials(Boolean include = true) #VisNetworkRemoteDataOptionsWhen enabled, fetch credentials are set to "include" (cookies/authorization headers).
Parameters
- include System.Boolean = true
- True to include credentials.
Returns
The current options instance.
public VisNetworkRemoteDataOptions WithJsonBody(Object body) #VisNetworkRemoteDataOptionsSets an optional JSON request body object. This is serialized with JSON.stringify.
Parameters
- body System.Object
- Body object to serialize.
Returns
The current options instance.
public VisNetworkRemoteDataOptions WithMethod(String method) #VisNetworkRemoteDataOptionsSets the HTTP method used for the request.
Parameters
- method System.String
- HTTP method (e.g. GET, POST).
Returns
The current options instance.
public VisNetworkRemoteDataOptions WithoutLiveUpdates() #VisNetworkRemoteDataOptionsDisables live updates (remote data will be fetched once).
public VisNetworkRemoteDataOptions WithPolling(Int32 intervalMs, String updatesUrl = null) #VisNetworkRemoteDataOptionsEnables periodic polling updates using fetch(). The same request options (Method, Headers, body, credentials, timeout) are used for each poll.
Parameters
- intervalMs System.Int32
- Polling interval in milliseconds. Set 0 to disable live updates.
- updatesUrl System.String = null
- Optional separate URL for updates. When null/empty, Url is used.
public VisNetworkRemoteDataOptions WithServerSentEvents(String updatesUrl = null, Boolean withCredentials = false) #VisNetworkRemoteDataOptionsEnables live updates via Server-Sent Events (EventSource). The server should emit JSON payloads shaped like: { "nodes": [...], "edges": [...] }.
Parameters
- updatesUrl System.String = null
- Optional separate URL for updates. When null/empty, Url is used.
- withCredentials System.Boolean = false
- When true, passes EventSource withCredentials.
public VisNetworkRemoteDataOptions WithTimeoutMs(Int32 milliseconds) #VisNetworkRemoteDataOptionsSets the request timeout in milliseconds. Use 0 to disable.
Parameters
- milliseconds System.Int32
- Timeout in milliseconds.
Returns
The current options instance.
public VisNetworkRemoteDataOptions WithWebSocket(String updatesUrl = null) #VisNetworkRemoteDataOptionsEnables live updates via WebSocket. The server should send JSON payloads shaped like: { "nodes": [...], "edges": [...] }.
Parameters
- updatesUrl System.String = null
- Optional separate URL for updates. When null/empty, Url is used.
Inherited Methods
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.