OrbCharts Docs
Docs
Home
Github
  • English
  • 繁體中文
Docs
Home
Github
  • English
  • 繁體中文
  • Guide
  • Basic Concepts

    • 6 Data Formats
    • Core Technologies
  • Get Started !

    • Installation
    • Examples
  • Basic Usage

    • Creating Charts
    • Using Presets
    • Drawing Charts
    • Data Labels
  • Chart API

    • plugins$
    • data$
    • chartParams$
    • dataFormatter$
    • event$
    • destroy()
  • Plugins

    • Create Plugin
    • Series

      • Bubbles
      • Pie
      • PieEventTexts
      • PieLabels
      • Rose
      • RoseLabels
      • SeriesLegend
      • SeriesTooltip
    • Grid

      • Bars
      • BarsPN
      • BarsTriangle
      • Dots
      • GridLegend
      • GridTooltip
      • GroupAux
      • GroupAxis
      • GroupZoom
      • Lines
      • LineAreas
      • StackedBars
      • StackedValueAxis
      • ValueAxis
    • MultiGrid

      • MultiBars
      • MultiBarsTriangle
      • MultiDots
      • MultiGridLegend
      • MultiGridTooltip
      • MultiGroupAxis
      • MultiStackedBars
      • MultiStackedValueAxis
      • MultiValueAxis
      • OverlappingValueAxes
      • OverlappingStackedValueAxes
    • MultiValue

      • MultiValueLegend
      • MultiValueTooltip
      • OrdinalAux
      • OrdinalAxis
      • OrdinalBubbles
      • OrdinalZoom
      • RacingBars
      • RacingCounterTexts
      • RacingValueAxis
      • Scatter
      • ScatterBubbles
      • XYAux
      • XYAxes
      • XYZoom
    • Relationship

      • ForceDirected
      • ForceDirectedBubbles
      • RelationshipLegend
      • RelationshipTooltip
    • Tree

      • TreeLegend
      • TreeMap
      • TreeTooltip

ForceDirectedBubbles

  • Name: Force Directed Bubbles

  • Description: Force-directed relationship graph drawn with d3-force. The value of the Node is mapped to the size of the bubble, and the value of the Edge is mapped to the thickness of the arrow.

  • Playground Example

params$

  • Type: DeepPartial<ForceDirectedBubblesParams>

  • Fields:

    NameDescriptionType
    bubbleBubble settingsObject
    bubbleLabelBubble label settingsObject
    arrowArrow settingsObject
    arrowLabelArrow label settingsObject
    forced3-force settingsObject
    zoomableZoom In/Out/Drag (mouse operation)boolean
    transformTransform settingsObject
    scaleExtentZoom In/Out min/max valuesObject
  • params.bubble

    NameDescriptionType
    radiusMinRadius for the minimum valuenumber
    radiusMaxRadius for the maximum valuenumber
    arcScaleTypeMapping method for bubble area using value. area maps data to bubble area, radius maps data to bubble radius (the latter will cause more significant area differences, but the visual accuracy may be controversial)'area' | 'radius'
    fillColorTypeBackground color typeColorType
    strokeColorTypeBorder color typeColorType
    strokeWidthBorder widthnumber
    styleFnNode style function(node: ComputedNode) => string
  • params.bubbleLabel

    NameDescriptionType
    fillRateRatio of label text filling the bubble (if 1, it fills completely without gaps)number
    lineHeightLine height of label text (if 1, it equals the text height)number
    maxLineLengthMaximum number of characters per line for label text (forces line break if exceeded)number
    wordBreakAllWhether to force line breaks even without space characters (if the label content uses non-English characters - such as Chinese, it may not be able to break lines if set to false due to the lack of space characters)boolean
    colorTypeRadiusColorType
    styleFnNode label style function(node: ComputedNode) => string
  • params.arrow

    NameDescriptionType
    colorTypeColor typeColorType
    strokeWidthMinBorder width for the minimum valuenumber
    strokeWidthMaxBorder width for the maximum valuenumber
    pointerWidthArrow widthnumber
    pointerHeightArrow heightnumber
    styleFnArrow style function(node: ComputedEdge) => string
  • params.arrowLabel

    NameDescriptionType
    colorTypeRadiusColorType
    sizeFixedWhether the size is fixed (not affected by Zoom In/Out)boolean
    styleFnEdge label style function(node: ComputedEdge) => string
  • params.force

    NameDescriptionType
    nodeStrengthBubble attractionnumber
    linkDistanceLink distancenumber
    velocityDecayVelocity decaynumber
    alphaDecayAlpha decaynumber
  • params.transform

    NameDescriptionType
    xx offsetnumber
    yy offsetnumber
    kZoom scalenumber
  • params.scaleExtent

    NameDescriptionType
    minMinimum Zoom value (if 0, can zoom out infinitely)number
    maxMaximum Zoom value (if Infinity, can zoom in infinitely)number
Detailed Types
type ColorType = 'none' | 'label' | 'labelContrast' | 'primary' | 'secondary' | 'background'

interface ComputedNode {
  id: string
  index: number
  label: string
  visible: boolean
  data: any
  value: number | null
  color: string
  categoryIndex: number
  categoryLabel: string
}

interface ComputedEdge {
  id: string
  index: number
  label: string
  visible: boolean
  data: any
  value: number | null
  color: string
  categoryIndex: number
  categoryLabel: string
  startNode: ComputedNode
  endNode: ComputedNode
}
  • Default values:
{
  bubble: {
    radiusMin: 15,
    radiusMax: 45,
    arcScaleType: 'area',
    fillColorType: 'label',
    strokeColorType: 'label',
    strokeWidth: 1,
    styleFn: (node) => '',
  },
  bubbleLabel: {
    fillRate: 0.9,
    lineHeight: 1,
    maxLineLength: 6,
    wordBreakAll: true,
    colorType: 'labelContrast',
    styleFn: (node) => ''
  },
  arrow: {
    colorType: 'primary',
    strokeWidthMin: 1.5,
    strokeWidthMax: 4.5,
    pointerWidth: 5,
    pointerHeight: 5,
    styleFn: (node) => '',
  },
  arrowLabel: {
    colorType: 'primary',
    sizeFixed: false,
    styleFn: (node) => ''
  },
  force: {
    nodeStrength: -500,
    linkDistance: 130,
    velocityDecay: 0.1,
    alphaDecay: 0.05
  },
  zoomable: true,
  transform: {
    x: 0,
    y: 0,
    k: 1
  },
  scaleExtent: {
    min: 0,
    max: Infinity
  }
}