
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
@nebula.js/sn-distributionplot
Advanced tools
The distribution plot is suitable for comparing range and distribution for groups of numerical data. Data is plotted as value points along an axis.
Requires @nebula.js/stardust version 1.4.0 or later.
If you use pnpm: pnpm install @nebula.js/sn-distributionplot. You can also load through the script tag directly from https://unpkg.com.
In a distribution plot you need to use one or two dimensions, and one measure. If you use a single dimension you will receive a single line visualization. If you use two dimensions, you will get one line for each value of the second, or outer, dimension.
import { embed } from '@nebula.js/stardust';
import distributionplot from '@nebula.js/sn-distributionplot';
// 'app' is an enigma app model
const embeddable = embed(app, {
  types: [
    {
      // register distribution plot chart
      name: 'distributionplot',
      load: () => Promise.resolve(distributionplot),
    },
  ],
});
embeddable.render({
  element,
  type: 'distributionplot',
  fields: ['Product Sub Group', 'Product Group', '=Avg(Sales)'],
});
Setting orientation property value to vertical. Default value is horizontal.
embeddable.render({
  element,
  type: 'distributionplot',
  fields: ['Product Sub Group', 'Product Group', '=Avg(Sales)'],
  // overrides default properties
  properties: {
    orientation: 'vertical',
  },
});
Displays value points only.
embeddable.render({
  element,
  type: 'distributionplot',
  fields: ['Product Sub Group', 'Product Group', '=Avg(Sales)'],
  // overrides default properties
  properties: {
    presentation: {
      visibleComponents: 'points',
    },
  },
});
Displays a bounding box showing the range of the values only.
embeddable.render({
  element,
  type: 'distributionplot',
  fields: ['Product Sub Group', 'Product Group', '=Avg(Sales)'],
  // overrides default properties
  properties: {
    presentation: {
      visibleComponents: 'box',
    },
  },
});
You can adjust the size of the bubbles that illustrate the value points by setting bubbleScales value.
You can set displacement to jitter to jitter several overlapping value points. This moves some of the points slightly to create a larger footprint that shows that there are more than one value behind the point.
embeddable.render({
  element,
  type: 'distributionplot',
  fields: ['Product Sub Group', 'Product Group', '=Avg(Sales)'],
  // overrides default properties
  properties: {
    dataPoint: {
      bubbleScales: 90,
      displacement: 'jitter',
    },
  },
});
FAQs
Distributionplot supernova
The npm package @nebula.js/sn-distributionplot receives a total of 458 weekly downloads. As such, @nebula.js/sn-distributionplot popularity was classified as not popular.
We found that @nebula.js/sn-distributionplot demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 7 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.