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

ForceDirected

  • Name: Force Directed

  • Description: Force-directed relationship graph drawn with d3-force

  • Playground Example

params$

  • Type: DeepPartial<ForceDirectedParams>

  • Fields:

    NameDescriptionType
    dotDot settingsObject
    dotLabelDot 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.dot

    NameDescriptionType
    radiusRadiusnumber
    fillColorTypeBackground color typeColorType
    strokeColorTypeBorder color typeColorType
    strokeWidthBorder widthnumber
    styleFnNode style function(node: ComputedNode) => string
  • params.dotLabel

    NameDescriptionType
    colorTypeColor typeColorType
    sizeFixedWhether the size is fixed (not affected by Zoom In/Out)boolean
    styleFnNode label style function(node: ComputedNode) => string
  • params.arrow

    NameDescriptionType
    colorTypeRadiusColorType
    strokeWidthBorder widthnumber
    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
    nodeStrengthNode strengthnumber
    linkDistanceLink distancenumber
    velocityDecayVelocity decaynumber
    alphaDecayAlpha decaynumber
  • params.transform

    NameDescriptionType
    xx offsetnumber
    yy offsetnumber
    kScale factornumber
  • params.scaleExtent

    NameDescriptionType
    minMinimum zoom value, if 0 can zoom out infinitelynumber
    maxMaximum zoom value, if Infinity can zoom in infinitelynumber
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:
{
  dot: {
    radius: 10,
    fillColorType: 'label',
    strokeColorType: 'label',
    strokeWidth: 1,
    styleFn: (node) => '',
  },
  dotLabel: {
    colorType: 'primary',
    sizeFixed: false,
    styleFn: (node) => 'text-shadow:0 1px 0 #fff, 1px 0 0 #fff, 0 -1px 0 #fff, -1px 0 0 #fff'
  },
  arrow: {
    colorType: 'primary',
    strokeWidth: 1.5,
    pointerWidth: 5,
    pointerHeight: 5,
    styleFn: (edge) => '',
  },
  arrowLabel: {
    colorType: 'primary',
    sizeFixed: false,
    styleFn: (edge) => ''
  },
  force: {
    nodeStrength: -500,
    linkDistance: 100,
    velocityDecay: 0.1,
    alphaDecay: 0.05
  },
  zoomable: true,
  transform: {
    x: 0,
    y: 0,
    k: 1
  },
  scaleExtent: {
    min: 0,
    max: Infinity
  }
}