OrbCharts 文件
文件
返回首頁
Github
  • English
  • 繁體中文
文件
返回首頁
Github
  • English
  • 繁體中文
  • 指南
  • 基本概念

    • 6種資料格式
    • 核心技術
  • 快速開始 !

    • 安裝
    • 範例
  • 基礎使用

    • 建立圖表
    • 使用預設集(Preset)
    • 繪製圖表
    • 資料標籤
  • 圖表 API

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

    • 建立 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

  • 名稱:ForceDirected(力導向關聯圖)

  • 說明:以 d3-force 繪製的力導向關聯圖形

  • Playground 範例

params$

  • 型別:DeepPartial<ForceDirectedParams>

  • 欄位:

    名稱說明型別
    dot圓點設定Object
    dotLabel圓點標籤設定Object
    arrow箭頭設定Object
    arrowLabel箭頭標籤設定Object
    forced3-force(力導向)設定Object
    zoomable能否 Zoom In/Out/Drag(滑鼠操作)boolean
    transform位移變形設定Object
    scaleExtentZoom In/Out 最小/大值Object
  • params.dot

    名稱說明型別
    radius半徑number
    fillColorType底色顏色類別ColorType
    strokeColorType外框顏色類別ColorType
    strokeWidth外框寬度number
    styleFnNode 樣式函式(node: ComputedNode) => string
  • params.dotLabel

    名稱說明型別
    colorType顏色類別ColorType
    sizeFixed是否固定大小(不受到 Zoom In/Out 影響)boolean
    styleFnNode 標籤樣式函式(node: ComputedNode) => string
  • params.arrow

    名稱說明型別
    colorType半徑ColorType
    strokeWidth外框寬度number
    pointerWidth箭頭寬度number
    pointerWidth箭頭高度number
    styleFn箭頭樣式函式(node: ComputedEdge) => string
  • params.arrowLabel

    名稱說明型別
    colorType半徑ColorType
    sizeFixed是否固定大小(不受到 Zoom In/Out 影響)boolean
    styleFnEdge 標籤樣式函式(node: ComputedEdge) => string
  • params.force

    名稱說明型別
    nodeStrength泡泡引力number
    linkDistance連結長度number
    velocityDecay速度衰減數number
    alphaDecayα 衰減數number
  • params.transform

    名稱說明型別
    xx 偏移number
    yy 偏移number
    k放大倍率number
  • params.scaleExtent

    名稱說明型別
    minZoom 最小值,如為 0 則可無限縮小number
    maxZoom 最大值,如為 Infinity 則可無限放大number
詳細型別
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
}
  • 預設值:
{
  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
  }
}