fbreitwieser / sankeyD3

D3 Sankey Network Graphs from R
65 stars 27 forks source link

Make `fontSize =` also affect `xAxisDomain` and the vertical distance between nodes #27

Open SchmidtPaul opened 2 years ago

SchmidtPaul commented 2 years ago

Currently, increasing the font size

links <- data.frame(
  source = c(0, 0, 1, 2),
  target = c(1, 2, 3, 3),
  value = c(10, 20, 10, 20)
)

nodes <- data.frame(
  label = c("A", "B", "C", "D")
)

xAxisDomain <-  c("Tick", "Trick", "Track")

sankeyD3::sankeyNetwork(
  Links = links,
  Nodes = nodes,
  Source = "source",
  Target = "target",
  Value  = "value",
  NodeID = "label",
  numberFormat = ",.0f",
  fontFamily = "Arial",
  xAxisDomain = xAxisDomain,
  fontSize = 12,
  width  = 400,
  height = 300)

image

sankeyD3::sankeyNetwork(
  Links = links,
  Nodes = nodes,
  Source = "source",
  Target = "target",
  Value  = "value",
  NodeID = "label",
  numberFormat = ",.0f",
  xAxisDomain = xAxisDomain,
  fontFamily = "Arial",
  fontSize = 24, # <-----------
  width  = 400,
  height = 300)

image