Search

Link Styling

Styling

There are various reasons why your charts may need a custom link design:

  • To visualize direction, movement or volume of data
  • To carry additional pieces of information
  • To highlight different aspects of data
  • To follow the specific design language of your application

Below are some examples of the ReGraph API for node styling:

  • arrow and glyphs: Can be set separately for each link end
  • color: Can be set to same or different values for each end, creating a gradient
  • flow: Sets a dashed animation on the link
  • labels: Sets a label in the middle of the link
  • lineStyle and width: Sets a style and width of the link
  • linkShape: Sets the shape of link path

You can style the whole link, or style its individual ends using the end1 and end2 properties.

Explore various styles in the Link Gallery story.

Link Shapes

Link shape refers to the shape of a link path, and helps highlight particular aspects of your data structure for different chart layouts and combo arrangements. Direct links are used by default, but you can change that at chart level using the layout linkShape option. You can then fine-tune the appearance of your chart by specifying a different link shape at combo level using the arrangement linkShape option. See Using a mixture of link shapes for information about how to use multiple link shapes.

Link shape summary:

directThe default. Direct links are straight lines that run directly between nodes. Well-suited to charts that concentrate on overall connectivity using organic, lens or radial layouts.graph showing direct links in an organic layout

angled

Angled links provide an orthogonally branching shape between nodes in a hierarchical structure, aligned with layout orientation. Especially suited to sequential layouts. In beta from v5.1.

Use priority links to highlight different paths, as shown in the Angled Links example.

graph showing angled links with a down orientation in a sequential layout
curvedCurved links follow a smooth path between nodes in different levels of a hierarchical structure, aligned with layout orientation. Useful for hierarchical data, especially sequential layouts.graph showing curved links with a down orientation in a sequential layout

Leaflet Integration always uses direct links.

Using a mixture of link shapes

In addition to using an overall link shape for your chart layout, with perhaps another for combo arrangements, you can also specify the link shape for an individual link, which takes precedence.

Setting an individual link's linkShape property, specifies its shape, and the direction in which it connects to its end nodes. This can be useful to represent different types of relationship in your chart.

For example, you might have a chart with a sequential component using angled links, and want to show the relationship between that, and another set of nodes, using curved links, as shown.

graph using angled links by default, with some curved links

Learn more in the Mixed Link Shapes example.

Multiple links between two nodes

By default ReGraph automatically spaces out multiple direct or curved links (as described in Link Shapes) running between two nodes by separating their midpoints. Direct links are separated to follow arcs, as shown, while curved links follow double curves.

Angled links can't helpfully be separated this way, so to focus on a critical path through a chart using angled links, use priority links.

graph showing direct links in an organic layout

Priority Links

To help focus on a particular path through a dense and overlapping network of nodes and links, you can assign priority to particular links to show them clearly, and in front of other links. This can be useful when using angled links, as illustrated, which can overlap each other.

Explore the use of link priority, used to highlight the attack path in the Cloud Security showcase.

graph showing direct links in an organic layout

Terms of use

These terms do not alter or supersede any existing agreements between you (or your employer) and us.

By accessing or using any Content you agree to be bound by these Terms of Use. Please review these terms carefully before using the website.

The contents of this website, including but not limited to any text, code samples, API references, schemas, interactive tools, and other materials (collectively, the 'Content'), are made available for informational and internal evaluation purposes only. All intellectual property rights in the Content are reserved. No licence is granted to use the Content for any commercial purpose, or to copy, distribute, modify, reverse-engineer, or incorporate any part of the Content into any product or service, without our prior written consent.

This Content is provided “as is” and “as available,” without any representations, warranties, or guarantees of any kind, whether express or implied, including but not limited to implied warranties of merchantability, fitness for a particular purpose, non-infringement, or accuracy. To the fullest extent permitted by applicable law, we expressly exclude and disclaim all implied warranties, conditions, and other terms that might otherwise be implied.

We disclaim all liability for any loss or damage, whether direct, indirect, incidental, consequential, or otherwise, arising from any reliance placed on the Content or from your use of it, to the fullest extent permitted by applicable law. By continuing to access or use the Content, you acknowledge and agree to these terms.