Kumu
  • Getting started
    • Welcome
    • Kumu 101
    • First steps
    • Quick tips
    • Webinars
  • Overview
    • Kumu's architecture
    • Accounts and workspaces
    • Kumu.io and Kumu Enterprise
    • Billing
    • User interfaces
      • Dashboard
      • Settings
      • Map editor
      • View editors
      • Quick Actions
    • Collaborating and sharing
    • Actions and permissions
    • Security
    • Advanced Editor hub
      • @settings reference
      • @controls reference
      • Color reference
      • Property reference
      • Selector reference
  • DISCIPLINES
    • SNA / Network Mapping
    • Systems mapping
    • Systems Practice workbook
  • Guides
    • Activity feed
    • Add-ons
      • Disqus
    • Bridge
    • Cluster
    • Controls
      • Cluster control
      • Color-legend control
      • Filter control
      • Focus control
      • Image control
      • Label control
      • Showcase control
      • SNA-dashboard control
      • Tagged-timeline control
      • Text Control
      • Title Control
      • View toggle control
    • Decorations
      • Direct decorations
      • Data-driven decorations
      • Flags
      • Icons
      • Images
      • Label templates
      • Popovers
    • Default view settings
    • Export
    • Fields
      • Computed fields
    • Filter
    • Focus
    • Forking
    • Grids & Guides
    • Import
      • Structure your data for Kumu
      • Excel / CSV
      • Google Sheets
      • JSON / Blueprints
    • Imported views
    • Layouts
      • Fixed
      • Force-directed
      • Remove overlap
      • Scatter
      • Snap-to
    • Legends
    • Licensing
    • Lightbox
    • Loops
    • Metrics
    • Two-factor authentication
    • Pro workspaces
      • Archiving projects
      • Discussions
    • Partial views
    • Presentations
    • Profiles
      • Markdown
    • Project admin
    • Selectors
    • Shapes
    • Share and embed maps
    • Shortcuts
    • Showcase
    • Slugs
    • Table
    • Templates
      • Geo template
    • URLs
    • Views
    • Widgets
  • About Kumu
    • What is Kumu?
    • How does it work?
    • Where can I get help?
  • Enterprise
    • About enterprise
    • Getting started with VMWare
    • Upgrading
    • Configuration
    • Creating user accounts
    • SSH Access
    • Single sign-on
    • Backing up enterprise data
    • Restoring enterprise data
    • Command line utilities
    • Changelog
  • Frequently Asked Questions
    • Does Kumu have a public API?
    • Does Kumu make use of AI?
    • How do I add annotations?
    • How do I add anchors to my map description?
    • How do I add arrows to my connections?
    • How do I add documents to profiles?
    • How do I add more than one element with the same label?
    • How do I add text dropdowns to my map overview?
    • How do I adjust arrow size?
    • How do I avoid duplicating data?
    • How do I change connection curvature?
    • How do I change font color?
    • How do I change font size?
    • How do I change the default for currency fields?
    • How do I change the length or strength of connections?
    • How do I change the order of control options?
    • How do I change the position of my element labels?
    • How do I cite Kumu?
    • How do I collapse duplicate connections?
    • How do I copy a map to another project?
    • How do I control label size while scaling element size?
    • How do I control text wrapping?
    • How do I convert a project from private to public?
    • How do I convert a project from public to private?
    • How do I create dynamic on/off toggles for my map?
    • How do I customize link text in popovers?
    • How do I customize the order of my legend?
    • How do I delete a project, map, or view?
    • How do I delete data from my project?
    • How do I downgrade my subscription?
    • How do I edit virtual elements?
    • How do I get rid of duplicates?
    • How do I hide elements without connections?
    • How do I hide images from the map but keep them in the profile?
    • How do I hide labels on my map?
    • How do I hide the settings button?
    • How do I keep elements from moving?
    • How do I list an element's connections in its profile?
    • How do I make elements transparent?
    • How do I make sense of my receipt?
    • How do I open a sub-system when clicking on an element?
    • How do I remove the Opposite entry from my legend?
    • How do I remove unneeded controls?
    • How do I remove unwanted legend entries?
    • How do I rename my map/view?
    • How do I restructure my adjacency matrix?
    • How do I save my changes in Kumu?
    • How do I select options by default in my control?
    • How do I set a minimum or maximum zoom level for my map?
    • How do I show the Settings button?
    • How do I size elements based on number of connections?
    • How do I transfer a project?
    • How do I update my credit card information?
    • How much data can my Kumu project handle?
    • How do my readers switch between maps and views?
    • My data won't import. What can I do?
    • My Kumu embed is not working. What can I do?
    • My map disappeared. How do I bring it back?
    • My PDF won't export. What can I do?
    • What pricing plans does Kumu have?
    • Where can I find my invoices?
    • Where can I find example Kumu projects?
Powered by GitBook
On this page
  • Set up your scatter plot
  • Expressions
  • Put it all together
  • Add grids, bounds, and guides
  • Add X and Y-axis labels

Was this helpful?

Edit on GitHub
  1. Guides
  2. Layouts

Scatter

PreviousRemove overlapNextSnap-to

Last updated 3 months ago

Was this helpful?

With the scatter layout, elements are positioned in an XY plot using element fields. You can choose any quantitative field for each axis -- or even use mathematical expressions if you're up for it!

Want to see a finished scatter plot before you get started? Check out our .

Set up your scatter plot

@settings {
    layout: scatter;
}

Then, use layout-x and layout-y to tell Kumu which element fields contain the x and y coordinates.

@settings {
    layout-x: "field1";
    layout-y: "field2";
}

Replace field1 and field2 with the appropriate fields in your map, but don't forget to keep the quotation marks.

After you set up your fields, you will probably need to multiply them by a constant value in order to improve the map's zoom-in and zoom-out interaction.

@settings {
    layout-x-multiplier: 100;
    layout-y-multiplier: 100;
}

We've found that 100 is a sensible default multiplier, but depending on your data, you may want to raise or lower it to make the zoom feel right. In general we've had success with layouts that are roughly 1000 x 1000, but there are no hard limits, if you want to get creative.

Expressions

The values for layout-x and layout-y can be simple field expressions such as layout-x: "degree". But that's not all they can be. You can also use complex mathematical expressions to build your scatter plots.

@settings {
  layout: scatter;
  layout-x: "1000 * betweenness";
  layout-y: "500 * max(1, log(outdegree / indegree))";
}

Note: Since spaces aren't allowed in variable names, you need to use the camelcased version of the field name. For example, "levelOfInfluence * 100" instead of "level of influence * 100".

Notice there's no need to use the -multiplier settings if you're comfortable writing expressions instead. The rest of the scatter plot settings still apply.

Put it all together

In this guide, we broke down the code into pieces for clarity, but in an actual Kumu view, you'll put it all into one @settings block.

@settings {
  layout: scatter;
  layout-x: "field1";
  layout-y: "field2";
  layout-x-multiplier: 100;
  layout-y-multiplier: 100;
}

Add grids, bounds, and guides

You can have the scatter plot cover your entire Kumu map, or you can give it bounds, so that it knows where it begins and ends. Similarly, you can also add a guide to your scatter plot, in order for it to have a clearly defined Y and X axis.

This is the code that allows you to do that:

@settings {
  layout-bounds-xmin: -1000; 
  layout-bounds-ymin: 0; 
  layout-bounds-xmax: 1000; 
  layout-bounds-ymax: 1500; 
  layout-guides: x(-1000) x(0) x(1000) y(500);
  }

Have a play with the numbers to adjust what your scatter plot looks like!

Add X and Y-axis labels

You might encounter some maps with scatter plots that have labels on the X and Y axes for easier interpretation. Note that these are not a function of the scatter layout, but rather 'hacky' workarounds explained here:

Hacky workaround number 1

This method is simply creating transparent elements, so that only the label remains, and placing them where you'd like them to be on the map:

  1. Create two elements, one for each label

Hacky workaround 2

This method involves creating two controls that are stylized. Note that with this method the scatter labels always exist at the edges of your Kumu map, so this method is not optimal when your scatter has bounds.

Use this code to create the controls (just update the labels 'Betweenness' and 'Degree' with your own preferred labels):

@controls {
  top-left {
    search {}

    text {
      value: "<h1>↑</h1><h4>Betweenness</h4><h1>↓</h1>";
      margin-top: 110px;
    }
  }

  bottom {
    text {
      value: "#### Degree";
      margin-bottom: -42.5;
    }

    text {
      value: "<h1>←&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;→</h1>";
    }
  }
}

To apply the scatter layout to your map, the first step is to open the add layout: scatter to your @settings.

We're using the library under the hood so if you want to learn more we recommend checking out the following links:

Place the elements on the scatter plot (either through their X and Y coordinates, or by simply dragging & them in place)

mathjs
https://mathjs.org/docs/expressions/syntax.html
https://mathjs.org/docs/reference/functions.html
Make the elements transparent
pinning
scatter plots blog post
Advanced Editor
scatter plot with labels