LinkChartLayoutSwitcherViewModel

AMD: require(["esri/widgets/LinkChartLayoutSwitcher/LinkChartLayoutSwitcherViewModel"], (LinkChartLayoutSwitcherVM) => { /* code goes here */ });
ESM: import LinkChartLayoutSwitcherVM from "@arcgis/core/widgets/LinkChartLayoutSwitcher/LinkChartLayoutSwitcherViewModel.js";
Class: esri/widgets/LinkChartLayoutSwitcher/LinkChartLayoutSwitcherViewModel
Inheritance: LinkChartLayoutSwitcherViewModel→Accessor
Since: ArcGIS Maps SDK for JavaScript 4.32
beta

Provides the logic for the esri/widgets/LinkChartLayoutSwitcher widget that switches the layout of a LinkChartView

See also

Constructors

LinkChartLayoutSwitcherViewModel

Constructor
new LinkChartLayoutSwitcherViewModel(properties)
Parameter
properties Object
optional

See the properties for a list of all the properties that may be passed into the constructor.

Property Overview

Any properties can be set, retrieved or listened to. See the Watch for changes topic.
Show inherited properties Hide inherited properties
Name Type Summary Class

The name of the class.

Accessor

The current selected link chart layout.

LinkChartLayoutSwitcherViewModel

Prevents extent from updating on changes to the layout.

LinkChartLayoutSwitcherViewModel

The current state of the widget.

LinkChartLayoutSwitcherViewModel

The view associated with the widget instance.

LinkChartLayoutSwitcherViewModel

Property Details

declaredClass

Inherited
Property
declaredClass Stringreadonly
Inherited from Accessor

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

layout

Property
layout String

The current selected link chart layout.

Possible Values:"organic-standard" |"organic-community" |"basic-grid" |"hierarchical-bottom-to-top" |"radial-root-centric" |"tree-left-to-right" |"geographic-organic-standard" |"chronological-mono-timeline" |"chronological-multi-timeline"

Default Value:"organic-standard"

preventExtentUpdate

Property
preventExtentUpdate Boolean

Prevents extent from updating on changes to the layout.

Default Value:false

state

Property
state Stringreadonly

The current state of the widget.

Possible Values:"loading" |"ready" |"disabled"

Default Value:"loading"

view

Property
view LinkChartView |null |undefined

The view associated with the widget instance.

Method Overview

Show inherited methods Hide inherited methods
Name Return Type Summary Class

Adds one or more handles which are to be tied to the lifecycle of the object.

Accessor

Emits an event on the instance.

LinkChartLayoutSwitcherViewModel

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

LinkChartLayoutSwitcherViewModel

Returns true if a named group of handles exist.

Accessor

Registers an event handler on the instance.

LinkChartLayoutSwitcherViewModel

Removes a group of handles owned by the object.

Accessor
Promise<void>

Switches the layout of the link chart.

LinkChartLayoutSwitcherViewModel

Method Details

addHandles

Inherited
Method
addHandles(handleOrHandles, groupKey)
Inherited from Accessor

Adds one or more handles which are to be tied to the lifecycle of the object. The handles will be removed when the object is destroyed.

// Manually manage handles
const handle = reactiveUtils.when(
  () => !view.updating,
  () => {
    wkidSelect.disabled = false;
  },
  { once: true }
);

this.addHandles(handle);

// Destroy the object
this.destroy();
Parameters
handleOrHandles WatchHandle|WatchHandle[]

Handles marked for removal once the object is destroyed.

groupKey *
optional

Key identifying the group to which the handles should be added. All the handles in the group can later be removed with Accessor.removeHandles(). If no key is provided the handles are added to a default group.

emit

Method
emit(type, event){Boolean}

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

Parameters
type String

The name of the event.

event Object
optional

The event payload.

Returns
Type Description
Boolean true if a listener was notified

hasEventListener

Method
hasEventListener(type){Boolean}

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

Parameter
type String

The name of the event.

Returns
Type Description
Boolean Returns true if the class supports the input event.

hasHandles

Inherited
Method
hasHandles(groupKey){Boolean}
Inherited from Accessor

Returns true if a named group of handles exist.

Parameter
groupKey *
optional

A group key.

Returns
Type Description
Boolean Returns true if a named group of handles exist.
Example
// Remove a named group of handles if they exist.
if (obj.hasHandles("watch-view-updates")) {
  obj.removeHandles("watch-view-updates");
}

on

Method
on(type, listener){Object}

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

Parameters

An event or an array of events to listen for.

listener Function

The function to call when the event fires.

Returns
Type Description
Object Returns an event handler with a remove() method that should be called to stop listening for the event(s).
Property Type Description
remove Function When 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);
});

removeHandles

Inherited
Method
removeHandles(groupKey)
Inherited from Accessor

Removes a group of handles owned by the object.

Parameter
groupKey *
optional

A group key or an array or collection of group keys to remove.

Example
obj.removeHandles(); // removes handles from default group

obj.removeHandles("handle-group");
obj.removeHandles("other-handle-group");

switchLayout

Method
switchLayout(newLayout){Promise<void>}

Switches the layout of the link chart.

Parameter
newLayout String

List of specific entities and relationships to update.

Possible Values:"organic-standard"|"organic-community"|"basic-grid"|"hierarchical-bottom-to-top"|"radial-root-centric"|"tree-left-to-right"|"geographic-organic-standard"|"chronological-mono-timeline"|"chronological-multi-timeline"

Returns
Type Description
Promise<void>
  • Resolves when the data in the link chart has been updated.

Event Overview

Name Type Summary Class

Fires when the switchLayout() method is called.

LinkChartLayoutSwitcherViewModel

Event Details

switchLayout

Event
switchLayout

Fires when the switchLayout() method is called.

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

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.