Flow Lines.

PRO

Connect movement between locations on a map.

Live preview43 feature examples

LIVE EXAMPLE

Movement between hubs

Match the page theme
Interact with the chart to see selection and range-change results here.
OptionsChanges are reflected in the preview and code.
Appearance and style6
Legend and interaction14
Title and dimensions3

Connect location ids through from and to. All values are sample data.

View code
Current preview
<div id="chart-container" style="width: 100%; min-width: 0;"></div>

<script type="module">
  import { defineCustomElement as define0 } from '@syidax/advanced-pro/components/sy-flow-lines.js';
  define0();

  // Pro: complete registerLicense at app startup using your issued certificate.
  // The website preview certificate is not for use in customer apps.
  const specs = [
    {
      "id": "example-chart",
      "tag": "sy-flow-lines",
      "props": {
        "data": {
          "locations": [
            {
              "id": "seoul",
              "label": "Seoul",
              "longitude": 126.98,
              "latitude": 37.57
            },
            {
              "id": "tokyo",
              "label": "Tokyo",
              "longitude": 139.69,
              "latitude": 35.68
            },
            {
              "id": "taipei",
              "label": "Taipei",
              "longitude": 121.56,
              "latitude": 25.03
            },
            {
              "id": "singapore",
              "label": "Singapore",
              "longitude": 103.82,
              "latitude": 1.35
            }
          ],
          "flows": [
            {
              "id": "s-t",
              "from": "seoul",
              "to": "tokyo",
              "value": 80
            },
            {
              "id": "s-p",
              "from": "seoul",
              "to": "taipei",
              "value": 45
            },
            {
              "id": "p-s",
              "from": "taipei",
              "to": "singapore",
              "value": 30
            }
          ]
        },
        "mapRegion": "asia",
        "mapBackground": "natural-earth",
        "routePath": "great-circle",
        "locationLabels": "show",
        "width": 640,
        "height": 360,
        "brandPosition": "bottom-right",
        "brandLogo": ""
      }
    }
  ];
  const container = document.querySelector('#chart-container');
  const elements = specs.map(({ tag, id, props }) => {
    const element = document.createElement(tag);
    element.id = id;
    Object.assign(element, props);
    element.setAttribute('aria-label', 'flow-lines example chart');
    return element;
  });
  container.replaceChildren(...elements);
  const chart = elements.at(-1);
  const onEvent = event => {
    console.log('pointClick', event.detail);
  };
  chart.addEventListener('pointClick', onEvent);
  const observer = new ResizeObserver(([entry]) => {
    const width = Math.max(160, Math.floor(entry.contentRect.width));
    elements.forEach(element => { element.width = width; });
  });
  observer.observe(container);

  // In an SPA, call this function when the view is disposed.
  function disposeChart() {
    observer.disconnect();
    chart.removeEventListener('pointClick', onEvent);
    container.replaceChildren();
  }
</script>

Usage and data

#

Explore logistics, routes, and movement volumes between regions.

Great-circle routes differ from straight lines on a projected map. Distinguish connection volume from the actual travel path.

Data contract

PropertyInput format
dataflows references locations IDs through from and to.
routePathgreat-circle or straight.

Updating data

Assign a new array or object to the property instead of mutating values inside an array. Chart events provide selection results through event.detail. When disposing of the view, clean up ResizeObserver and event listeners registered by your app.

Feature examples

#

Try 43 interactive feature examples and inspect their code. Select “Edit in preview” to combine more options in the settings panel above.

Great-circle routesPRO

Connect hubs along the shortest paths on a sphere.

Interact with the chart to see results here.
View code

Equirectangular projectionPRO

Change the map projection to compare the same routes.

Interact with the chart to see results here.
View code

Inspect values with the pointerPRO

Point to data to view the value at that location.

Interact with the chart to see results here.
View code

Crosshair trackingPRO

Move the pointer to read horizontal and vertical coordinates alongside values.

Interact with the chart to see results here.
View code

Drag to zoom and panPRO

Drag to zoom and hold Shift to pan. Use Ctrl + wheel to zoom in or out.

Interact with the chart to see results here.
View code

Replay animationPRO

Redraw the same example to inspect its initial display animation.

Interact with the chart to see results here.
View code

AccessibilityPRO

Compare 2 examples of Accessibility. Buttons and options update both the live result and source code.

Interact with the chart to see results here.
View code

AnimationPRO

Compare 5 examples of Animation. Buttons and options update both the live result and source code.

Interact with the chart to see results here.
View code

ColorPRO

Compare 3 examples of Color. Buttons and options update both the live result and source code.

Interact with the chart to see results here.
View code

CrosshairPRO

Compare 3 examples of Crosshair. Buttons and options update both the live result and source code.

Interact with the chart to see results here.
View code

Data inputPRO

Compare 10 examples of Data input. Buttons and options update both the live result and source code.

Interact with the chart to see results here.
View code

LabelPRO

Compare 3 examples of Label. Buttons and options update both the live result and source code.

Interact with the chart to see results here.
View code

LegendPRO

Compare 2 examples of Legend. Buttons and options update both the live result and source code.

Interact with the chart to see results here.
View code

LocalePRO

Compare 1 examples of Locale. Buttons and options update both the live result and source code.

Interact with the chart to see results here.
View code

Large datasetsPRO

Compare 2 examples of Large datasets. Buttons and options update both the live result and source code.

Interact with the chart to see results here.
View code

Map projectionPRO

Compare 6 examples of Map projection. Buttons and options update both the live result and source code.

Interact with the chart to see results here.
View code

RoutesPRO

Compare 4 examples of Routes. Buttons and options update both the live result and source code.

Interact with the chart to see results here.
View code

SizePRO

Compare 2 examples of Size. Buttons and options update both the live result and source code.

Interact with the chart to see results here.
View code

TooltipPRO

Compare 13 examples of Tooltip. Buttons and options update both the live result and source code.

Interact with the chart to see results here.
View code

Zoom and panPRO

Compare 4 examples of Zoom and pan. Buttons and options update both the live result and source code.

Interact with the chart to see results here.
View code

AnimationPRO

Compare 1 examples of Animation. Buttons and options update both the live result and source code.

Interact with the chart to see results here.
View code

Context menuPRO

Compare 1 examples of Context menu. Buttons and options update both the live result and source code.

Interact with the chart to see results here.
View code

HoverPRO

Compare 1 examples of Hover. Buttons and options update both the live result and source code.

Interact with the chart to see results here.
View code

Map Layer ChangePRO

Compare 1 examples of Map Layer Change. Buttons and options update both the live result and source code.

Interact with the chart to see results here.
View code

Map View ChangePRO

Compare 1 examples of Map View Change. Buttons and options update both the live result and source code.

Interact with the chart to see results here.
View code

Point ClickPRO

Compare 1 examples of Point Click. Buttons and options update both the live result and source code.

Interact with the chart to see results here.
View code

Data context menuPRO

Compare 1 examples of Data context menu. Buttons and options update both the live result and source code.

Interact with the chart to see results here.
View code

RenderedPRO

Compare 3 examples of Rendered. Buttons and options update both the live result and source code.

Interact with the chart to see results here.
View code

Selection ChangedPRO

Compare 1 examples of Selection Changed. Buttons and options update both the live result and source code.

Interact with the chart to see results here.
View code

StreamPRO

Compare 1 examples of Stream. Buttons and options update both the live result and source code.

Interact with the chart to see results here.
View code

AnimationPRO

Compare 1 examples of Animation. Buttons and options update both the live result and source code.

Interact with the chart to see results here.
View code

CrosshairPRO

Compare 1 examples of Crosshair. Buttons and options update both the live result and source code.

Interact with the chart to see results here.
View code

Data inputPRO

Compare 3 examples of Data input. Buttons and options update both the live result and source code.

Interact with the chart to see results here.
View code

ExportPRO

Compare 1 examples of Export. Buttons and options update both the live result and source code.

Interact with the chart to see results here.
View code

Read coordinates and dataPRO

Compare 1 examples of Read coordinates and data. Buttons and options update both the live result and source code.

Interact with the chart to see results here.
View code

Map ViewPRO

Compare 1 examples of Map View. Buttons and options update both the live result and source code.

Interact with the chart to see results here.
View code

Runtime APIPRO

Compare 2 examples of Runtime API. Buttons and options update both the live result and source code.

Interact with the chart to see results here.
View code

OptionalPRO

Compare 1 examples of Optional. Buttons and options update both the live result and source code.

Interact with the chart to see results here.
View code

TooltipPRO

Compare 3 examples of Tooltip. Buttons and options update both the live result and source code.

Interact with the chart to see results here.
View code

Zoom and panPRO

Compare 1 examples of Zoom and pan. Buttons and options update both the live result and source code.

Interact with the chart to see results here.
View code

Flow LinesPRO

Compare 3 examples of Flow Lines. Buttons and options update both the live result and source code.

Interact with the chart to see results here.
View code

Streaming · Add and update live dataPRO

Compare 4 examples of Add and update live data. Buttons and options update both the live result and source code.

Interact with the chart to see results here.
View code

Streaming · Add and update live dataPRO

Compare 1 examples of Add and update live data. Buttons and options update both the live result and source code.

Interact with the chart to see results here.
View code

API reference

#

The full public API for sy-flow-lines. Pass objects and arrays as JavaScript properties. Select a name to view usage code and type definitions.

Key properties

Attribute / PropertyType / DefaultDescription
FlowLinesDataDefault: undefinedflows references locations IDs through from and to.
numberDefault: 900Chart width in pixels. Update with ResizeObserver when the container changes.
numberDefault: 460Chart height in pixels.
brandLogostringDefault: undefinedThe default is the Syidax logo. With the Pro chart.branding entitlement, use none or a PNG, JPEG, or WebP data URL.
brandPosition'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'Default: 'bottom-right'The corner where the logo is anchored. Applies equally to Community and Pro, on screen and in image exports.
GeoMapProjectionDefault: 'equirectangular'Allowed values: identity, mercator, equirectangular, albers, orthographic. Default: 'equirectangular'.
mapFixedbooleanDefault: falseSet as an HTML attribute or JavaScript property. type: boolean.
routePathGeoMapConnectionPathDefault: 'great-circle'great-circle or straight.
locationLabelsGeoMapLabelModeDefault: 'auto'Allowed values: auto, show, hide. Default: 'auto'.
flowLabelsGeoMapLabelModeDefault: 'hide'Allowed values: auto, show, hide. Default: 'hide'.
labelValuebooleanDefault: falseSet as an HTML attribute or JavaScript property. type: boolean.
booleanDefault: trueWhether to show a legend for series or items.
chartTitlestringDefault: undefinedThe title inside the chart. Explain the data's unit and meaning alongside it.
chartSubtitlestringDefault: undefinedThe subtitle inside the chart.
CartesianTooltipInputDefault: undefinedTooltip settings for pointer-driven values, position, and content.
tooltipEnabledbooleanDefault: trueSet as an HTML attribute or JavaScript property. type: boolean.
CartesianCrosshairInputDefault: undefinedPass as a JavaScript property. type: CartesianCrosshairInput.
CartesianZoomInputDefault: undefinedSettings for zooming and the visible range.
animatedbooleanDefault: falseWhether to animate initial display and data changes.
animationDurationnumberDefault: 600Animation duration in milliseconds.
animationEasingGeoMapEasingDefault: 'ease-out'Allowed values: linear, ease-out, ease-in, ease-in-out. Default: 'ease-out'.
animationTypeGeoMapAnimationTypeDefault: undefinedAllowed values: initial, update. Default: undefined.
Other properties 18
Attribute / PropertyType / DefaultDescription
numberDefault: 16Set as an HTML attribute or JavaScript property. type: number.
mapRegionGeoMapRegionDefault: 'world'Allowed values: world, africa, asia, europe, north-america, south-america, oceania, antarctica. Default: 'world'.
mapBackgroundGeoMapBackgroundDefault: 'natural-earth'Allowed values: none, natural-earth. Default: 'natural-earth'.
styleOptionsFlowLinesStyleDefault: undefinedPass as a JavaScript property. type: FlowLinesStyle.
mapLayersGeoMapLayersInputDefault: undefinedPass as a JavaScript property. type: GeoMapLayersInput.
activeColorstringDefault: '#f59e0b'Set as an HTML attribute or JavaScript property. type: string.
inactiveOtherPointsbooleanDefault: falseSet as an HTML attribute or JavaScript property. type: boolean.
inactivePointOpacitynumberDefault: .2Set as an HTML attribute or JavaScript property. type: number.
stringDefault: 'en-US'Set as an HTML attribute or JavaScript property. type: string.
enableMouseTrackingbooleanDefault: trueSet as an HTML attribute or JavaScript property. type: boolean.
tooltipFormat(detail:FlowLinesHitDetail)=>stringDefault: undefinedPass as a JavaScript property. type: (detail:FlowLinesHitDetail)=>string.
crosshairSnapDistancenumberDefault: 12Set as an HTML attribute or JavaScript property. type: number.
streamSourceFlowLinesStreamSourceDefault: undefinedA stream source for live data. Check the contract for the specific type.
streamMaxnumberDefault: undefinedThe maximum number of streaming data points to retain.
streamWindownumberDefault: undefinedThe streaming data range to keep visible.
GeoMapEngineModeDefault: 'auto'Renderer selection: auto, standard, or pro. Engine selection is separate from permission to use a Pro chart type.
GeoMapUnavailableBehaviourDefault: 'fallback'Allowed values: fallback, error. Default: 'fallback'.
showEmptybooleanDefault: trueSet as an HTML attribute or JavaScript property. type: boolean.
Events 18
EventsDetail typeDescription
FlowLinesHitDetailA point selection event. Read the selected data and index from CustomEvent.detail.
FlowLinesHitDetail|nullCustomEvent.detail type: FlowLinesHitDetail|null. Event names are case-sensitive.
FlowLinesSelectionChangeEventDetailCustomEvent.detail type: FlowLinesSelectionChangeEventDetail. Event names are case-sensitive.
ChartPointContextMenuEventDetail<FlowLinesHitDetail>CustomEvent.detail type: ChartPointContextMenuEventDetail<FlowLinesHitDetail>. Event names are case-sensitive.
FlowLinesRenderResult&{tier:GeoMapEngineTier}Emits rendering results in detail when chart drawing completes.
{count:number;replaced:number}CustomEvent.detail type: {count:number;replaced:number}. Event names are case-sensitive.
{dropped:number}CustomEvent.detail type: {dropped:number}. Event names are case-sensitive.
{message:string;source:'data'|'stream'}CustomEvent.detail type: {message:string;source:'data'|'stream'}. Event names are case-sensitive.
CartesianTooltipEventDetailWhether to display the built-in tooltip.
voidCustomEvent.detail type: void. Event names are case-sensitive.
CartesianTooltipActionEventDetailCustomEvent.detail type: CartesianTooltipActionEventDetail. Event names are case-sensitive.
CartesianCrosshairEventDetail|nullCustomEvent.detail type: CartesianCrosshairEventDetail|null. Event names are case-sensitive.
CartesianZoomChangeEventDetailCustomEvent.detail type: CartesianZoomChangeEventDetail. Event names are case-sensitive.
GeoMapViewChangeEventDetailCustomEvent.detail type: GeoMapViewChangeEventDetail. Event names are case-sensitive.
GeoMapLayerChangeEventDetailCustomEvent.detail type: GeoMapLayerChangeEventDetail. Event names are case-sensitive.
voidCustomEvent.detail type: void. Event names are case-sensitive.
voidCustomEvent.detail type: void. Event names are case-sensitive.
voidCustomEvent.detail type: void. Event names are case-sensitive.
Methods 42

Stencil methods return Promises. Use await within an async function to read the result.

Method / ArgumentsReturn typeDescription
data: FlowLinesDataPromise<void>An asynchronous method. Check the argument and return types below.
Promise<FlowLinesData>An asynchronous method. Check the argument and return types below.
Promise<FlowLinesDiagnostics>An asynchronous method. Check the argument and return types below.
Promise<FlowLinesLayout>An asynchronous method. Check the argument and return types below.
flow: FlowLinesRouteInputPromise<void>An asynchronous method. Check the argument and return types below.
flows: ReadonlyArray<FlowLinesRouteInput>Promise<void>An asynchronous method. Check the argument and return types below.
flows: ReadonlyArray<FlowLinesRouteInput>Promise<void>An asynchronous method. Check the argument and return types below.
count: numberPromise<void>An asynchronous method. Check the argument and return types below.
Promise<FlowLinesStreamSource|undefined>An asynchronous method. Check the argument and return types below.
Promise<void>An asynchronous method. Check the argument and return types below.
cssX: number, cssY: numberPromise<FlowLinesHitDetail|null>An asynchronous method. Check the argument and return types below.
index: numberPromise<FlowLinesHitDetail|null>An asynchronous method. Check the argument and return types below.
index: numberPromise<FlowLinesHitDetail|null>An asynchronous method. Check the argument and return types below.
id: FlowLinesId, kind?: 'flow'|'location'Promise<FlowLinesHitDetail|null>An asynchronous method. Check the argument and return types below.
Promise<FlowLinesSelection>An asynchronous method. Check the argument and return types below.
Promise<void>An asynchronous method. Check the argument and return types below.
index: numberPromise<CartesianTooltipEventDetail|null>An asynchronous method. Check the argument and return types below.
index: numberPromise<CartesianTooltipEventDetail|null>An asynchronous method. Check the argument and return types below.
Promise<void>An asynchronous method. Check the argument and return types below.
request: {dataX:number;dataY:number}Promise<boolean>An asynchronous method. Check the argument and return types below.
Promise<void>An asynchronous method. Check the argument and return types below.
request: CartesianZoomRequestPromise<CartesianZoomChangeEventDetail|null>An asynchronous method. Check the argument and return types below.
factor: number, anchorFraction?: numberPromise<CartesianZoomChangeEventDetail|null>An asynchronous method. Check the argument and return types below.
delta: {x?:number;y?:number}Promise<CartesianZoomChangeEventDetail|null>An asynchronous method. Check the argument and return types below.
Promise<CartesianZoomChangeEventDetail|null>An asynchronous method. Check the argument and return types below.
Promise<void>An asynchronous method. Check the argument and return types below.
Promise<CartesianZoomState|null>An asynchronous method. Check the argument and return types below.
request?: CartesianZoomExtentRequestPromise<CartesianZoomExtentDetail|null>An asynchronous method. Check the argument and return types below.
Promise<GeoMapViewDetail|null>An asynchronous method. Check the argument and return types below.
options?: GeoMapFitOptionsPromise<GeoMapFitDetail|null>An asynchronous method. Check the argument and return types below.
Promise<GeoMapLayerDetail[]>An asynchronous method. Check the argument and return types below.
layer: GeoMapLayer, visible: booleanPromise<GeoMapLayerDetail|null>An asynchronous method. Check the argument and return types below.
options: {enabled?:boolean;duration?:number;easing?:GeoMapEasing;type?:GeoMapAnimationType}Promise<void>An asynchronous method. Check the argument and return types below.
Promise<void>An asynchronous method. Check the argument and return types below.
Promise<void>An asynchronous method. Check the argument and return types below.
Promise<void>An asynchronous method. Check the argument and return types below.
Promise<void>Without this element's grant (or while it is frozen) nothing is recycled: the refusal is reported here and no GPU work starts.
Promise<FlowLinesRenderResult>Without this element's grant (or while it is frozen) no draw is asked of the map: the last frame's result is returned.
Promise<ChartEngineStatus>The inner map's status while the proxy runs; otherwise the proxy's own license outcome (`engine` is forwarded unchanged).
Promise<GeoMapEngineTier>An asynchronous method. Check the argument and return types below.
Promise<string|undefined>An asynchronous method. Check the argument and return types below.
Promise<ChartDataTable>An asynchronous method. Check the argument and return types below.