UNPKG

@arcgis/map-components

Version:
170 lines (169 loc) • 7.47 kB
/// <reference path="../../index.d.ts" /> import type LinkChartView from "@arcgis/core/views/LinkChartView.js"; import type { ArcgisReferenceElement, IconName } from "../types.js"; import type { LinkChartLayoutSwitcherViewModelEvents, LinkChartLayoutSwitcherViewModelState } from "@arcgis/core/widgets/LinkChartLayoutSwitcher/LinkChartLayoutSwitcherViewModel.js"; import type { PublicLitElement as LitElement } from "@arcgis/lumina"; import type { DiagramLayoutType } from "./types.js"; import type { T9nMeta } from "@arcgis/lumina/controllers"; import type { LayoutMode } from "@arcgis/core/layers/knowledgeGraph/types.js"; /** * A component for use in link charts that allows users to switch between different layouts. See [documentation on layouts](https://enterprise.arcgis.com/en/knowledge/latest/knowledge-studio/change-the-layout-applied-to-a-link-chart.htm) for more details. * * Note: Sign in to access the data in this demo, U/P: `viewer01`/`I68VGU^nMurF` * * @since 4.32 */ export abstract class ArcgisLinkChartLayoutSwitcher extends LitElement { /** * The appearance of the layout switcher. `dropdown` displays a button that is clicked to reveal a dropdown menu, while `menu-bar` displays a menu bar. * * @default "dropdown" * @since 4.33 */ accessor appearance: "dropdown" | "menu-bar"; /** * If true, the component will not be destroyed automatically when it is * disconnected from the document. This is useful when you want to move the * component to a different place on the page, or temporarily hide it. If this * is set, make sure to call the [destroy()](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-link-chart-layout-switcher/#destroy) method when you are done to * prevent memory leaks. * * @default false */ accessor autoDestroyDisabled: boolean; /** * When `true`, the layout menu will not close when a layout is selected. Only applicable when `appearance` is `dropdown`. * * @default false * @since 4.33 */ accessor closeOnSelectDisabled: boolean; /** * Icon displayed in the component's button, when `appearance` is `dropdown`. * * @default "nodes-link" * @see [Calcite Icon Search](https://developers.arcgis.com/calcite-design-system/icons/) */ accessor icon: IconName | undefined; /** The component's default label. */ accessor label: string | undefined; /** * The current selected link chart layout. * * @default "organic-standard" */ get layout(): LayoutMode; /** * Replace localized message strings with your own strings. * * _**Note**: Individual message keys may change between releases._ */ accessor messageOverrides: { layoutOptions?: string | undefined; forceDirected?: string | undefined; community?: string | undefined; simple?: string | undefined; hierarchical?: string | undefined; radialTree?: string | undefined; smartTree?: string | undefined; geographic?: string | undefined; chronologicalSingle?: string | undefined; chronologicalMultiple?: string | undefined; basicLayoutCategory?: string | undefined; organicLayoutCategory?: string | undefined; treeLayoutCategory?: string | undefined; hierarchicalLayoutCategory?: string | undefined; chronologicalLayoutCategory?: string | undefined; }; /** @internal */ protected messages: Partial<{ layoutOptions: string; forceDirected: string; community: string; simple: string; hierarchical: string; radialTree: string; smartTree: string; geographic: string; chronologicalSingle: string; chronologicalMultiple: string; basicLayoutCategory: string; organicLayoutCategory: string; treeLayoutCategory: string; hierarchicalLayoutCategory: string; chronologicalLayoutCategory: string; }> & T9nMeta<{ layoutOptions: string; forceDirected: string; community: string; simple: string; hierarchical: string; radialTree: string; smartTree: string; geographic: string; chronologicalSingle: string; chronologicalMultiple: string; basicLayoutCategory: string; organicLayoutCategory: string; treeLayoutCategory: string; hierarchicalLayoutCategory: string; chronologicalLayoutCategory: string; }>; /** * Prevents extent from updating on changes to the layout. * * @default false */ get preventExtentUpdate(): boolean; set preventExtentUpdate(value: boolean); /** * By assigning the `id` attribute of the Map or Scene component to this property, you can position a child component anywhere in the DOM while still maintaining a connection to the Map or Scene. * * See also: * - [Associate components with a Map or Scene component](https://developers.arcgis.com/javascript/latest/programming-patterns/#associate-components-with-a-map-or-scene-component) */ accessor referenceElement: ArcgisReferenceElement | string | undefined; /** * The current state of the component. * * @default "loading" */ get state(): LinkChartLayoutSwitcherViewModelState; /** * The view associated with the component. * > **Note:** The recommended approach is to fully migrate applications to use map and scene components and avoid using MapView and SceneView directly. However, if you are migrating a large application from widgets to components, you might prefer a more gradual transition. To support this use case, the SDK includes this `view` property which connects a component to a MapView or SceneView. Ultimately, once migration is complete, the arcgis-link-chart-layout-switcher component will be associated with a map or scene component rather than using the `view` property. */ accessor view: LinkChartView | null | undefined; /** Permanently destroy the component. */ destroy(): Promise<void>; /** * Switches the layout of the link chart to the value provided. * * @param newLayout */ switchLayout(newLayout: "basic-grid" | "chronological-mono-timeline" | "chronological-multi-timeline" | "geographic-organic-standard" | "hierarchical-bottom-to-top" | "organic-community" | "organic-standard" | "radial-root-centric" | "tree-left-to-right"): Promise<void>; "@setterTypes": { layout?: DiagramLayoutType; preventExtentUpdate?: boolean; }; /** Emitted when the value of a property is changed. Use this to listen to changes to properties. */ readonly arcgisPropertyChange: import("@arcgis/lumina").TargetedEvent<this, { name: "state"; }>; /** Emitted when the component associated with a map or scene view is ready to be interacted with. */ readonly arcgisReady: import("@arcgis/lumina").TargetedEvent<this, void>; /** * Fires when component has completed the layout switch * * @example * ```js * layoutswitcher.addEventListener("arcgisSwitchLayout", (event) => { * console.log("Layout Switched"); * }); * ``` */ readonly arcgisSwitchLayout: import("@arcgis/lumina").TargetedEvent<this, LinkChartLayoutSwitcherViewModelEvents["switchLayout"]>; readonly "@eventTypes": { arcgisPropertyChange: ArcgisLinkChartLayoutSwitcher["arcgisPropertyChange"]["detail"]; arcgisReady: ArcgisLinkChartLayoutSwitcher["arcgisReady"]["detail"]; arcgisSwitchLayout: ArcgisLinkChartLayoutSwitcher["arcgisSwitchLayout"]["detail"]; }; }