Skip to content
import LinkChartLayoutSwitcherViewModel from "@arcgis/core/widgets/LinkChartLayoutSwitcher/LinkChartLayoutSwitcherViewModel.js";
Inheritance:
LinkChartLayoutSwitcherViewModelAccessor
Since
ArcGIS Maps SDK for JavaScript 4.32
beta

Provides the logic for the Link Chart Layout Switcher component that switches the layout of a LinkChartView.

See also

Constructors

Constructor

Constructor
Parameters
ParameterTypeDescriptionRequired
properties
See the properties table for a list of all the properties that may be passed into the constructor.

Properties

Any properties can be set, retrieved or listened to. See the Watch for changes topic.

declaredClass

readonlyinherited Property
Type
string
Inherited from: Accessor

The name of the class. The declared class name is formatted as esri.folder.className.

layout

autocast Property
Type
LayoutMode

The current selected link chart layout.

Default value
"organic-standard"

preventExtentUpdate

autocast Property
Type
boolean

Prevents extent from updating on changes to the layout.

Default value
false

state

readonly Property
Type
LinkChartLayoutSwitcherViewModelState

The current state of the widget.

Default value
"loading"

view

Property
Type
LinkChartView | null | undefined

The view associated with the widget instance.

Methods

MethodSignatureClass
emit
inherited
emit<Type extends EventNames<this>>(type: Type, event?: this["@eventTypes"][Type]): boolean
hasEventListener
inherited
hasEventListener<Type extends EventNames<this>>(type: Type): boolean
on
inherited
on<Type extends EventNames<this>>(type: Type, listener: EventedCallback<this["@eventTypes"][Type]>): ResourceHandle
switchLayout(newLayout: LayoutMode): Promise<void>

emit

inherited Method
Signature
emit <Type extends EventNames<this>>(type: Type, event?: this["@eventTypes"][Type]): boolean
Type parameters
<Type extends EventNames<this>>
Inherited from: EventedMixin

Emits an event on the instance. This method should only be used when creating subclasses of this class.

Parameters
ParameterTypeDescriptionRequired
type
Type

The name of the event.

event
this["@eventTypes"][Type]

The event payload.

Returns
boolean

true if a listener was notified

hasEventListener

inherited Method
Signature
hasEventListener <Type extends EventNames<this>>(type: Type): boolean
Type parameters
<Type extends EventNames<this>>
Inherited from: EventedMixin

Indicates whether there is an event listener on the instance that matches the provided event name.

Parameters
ParameterTypeDescriptionRequired
type
Type

The name of the event.

Returns
boolean

Returns true if the class supports the input event.

on

inherited Method
Signature
on <Type extends EventNames<this>>(type: Type, listener: EventedCallback<this["@eventTypes"][Type]>): ResourceHandle
Type parameters
<Type extends EventNames<this>>
Inherited from: EventedMixin

Registers an event handler on the instance. Call this method to hook an event with a listener.

Parameters
ParameterTypeDescriptionRequired
type
Type

An event or an array of events to listen for.

listener
EventedCallback<this["@eventTypes"][Type]>

The function to call when the event fires.

Returns
ResourceHandle

Returns an event handler with a remove() method that should be called to stop listening for the event(s).

PropertyTypeDescription
removeFunctionWhen called, removes the listener from the event.
Example
view.on("click", function(event){
// event is the event handle returned after the event fires.
console.log(event.mapPoint);
});

switchLayout

Method
Signature
switchLayout (newLayout: LayoutMode): Promise<void>

Switches the layout of the link chart.

Parameters
ParameterTypeDescriptionRequired
newLayout

List of specific entities and relationships to update.

Returns
Promise<void>

Resolves when the data in the link chart has been updated.

Events

NameType
CustomEvent<{ layout: LayoutMode; }>

switchLayout

Event
switchLayout: CustomEvent<{ layout: LayoutMode; }>

Fires when the switchLayout() method is called.

See also
bubbles composed cancelable
Example
layoutSwitcher.viewModel.on("switchLayout", function(event){
console.log("Layout Switched");
});

Type definitions

LinkChartLayoutSwitcherViewModelState

Type definition
Type
"loading" | "disabled" | "ready"