score:0
as already mentioned in the comments, you might want to give networkd3
a shot.
here is an example based on the sample data you provide.
# create nodes and links data.frames
nodes <- data.frame(name = unique(unlist(hc_dat[, 1:2])))
links <- data.frame(
source = match(hc_dat$from, nodes$name) - 1,
target = match(hc_dat$to, nodes$name) - 1,
value = hc_dat$n)
# draw a sankey diagram
library(networkd3)
sankeynetwork(
links = links, nodes = nodes,
source = "source", target = "target", value = "value", nodeid = "name",
fontsize = 16, fontfamily = "sans-serif", nodewidth = 30, nodepadding = 30)
score:3
sankey from a->b and from b->c can be done by re-defining your underlying data:
hc_dat <- data.frame(from = c("a", "b"),
to = c("b", "c"), n = c(7, 5))
similarly, you can define node from a->c
hc_dat <- data.frame(from = c("a", "b", "a"),
to = c("b", "c", "c"), n = c(5, 5, 7))
this does not render a nice plot, though.
Source: stackoverflow.com
Related Query
- R Highcharter Sankey nodes column property trouble
- Sorting Sankey chart's source & destination nodes alphabetically
- How to change the palette colors of a highcharter column plot which depends on a variable?
- Highcharter - move data label to top of column
- highchart Sankey chart nodes flow with image for insights
- Adding a pattern fill to a black and white column graph in Highcharter
- set font size of sankey chart in HIghcharter for R
- Strange character in the Highstock source code
- Column Labels in Sankey Charts in Highcharts
- Different ToolTip text For Links and Nodes in Highcharts Sankey Charts
- Column based Highchart drilldown series assign color code to each column
- Having trouble mapping highcharter aesthetics to reactive object elements
- xAxis order of R highcharter column plot
- Why does highcharts sankey chart sometimes combine multiple nodes with same node name but different Id into one and hide the lines?
- trouble with categories on highcharts column chart
- drilldown feature with url property for column graph in Highcharts
- Trouble Animating svgX of HighCharts Column Label
- HighCharts Sankey + NextJS: TypeError: Cannot read property 'Core/Series/Point.js' of undefined
- sorting categories in a highcharter stacked column chart
- Highcharts sankey draggable nodes
- How to create a column range chart in Highcharts using range and navigator functions?
- How do you change the colour of each category within a highcharts column chart?
- set different colors for each column in highcharts
- Highchart specific width stack column bar graph
- Disable-Click on Legend in HighCharts Column Graph
- Maximum bar width in Highcharts column charts
- How to hide zero values in Column chart
- Displaying percentage in Y-axis of Highcharts column chart
- Highcharts : Change opacity of a column chart
- SyntaxError: JSON.parse: expected property name or '}' while using highcharts
More Query from same tag
- enable disable hover in highchart.stock
- highcharts - to show a no data picture in case nothing to render from mysql query
- Application crashing when clicking on Highcharts data export menu
- All series data are equal highcharts
- Highcharts stacked area - update tooltip only after exact area mouse over
- Highcharts Gauge - how to read input from file?
- Highcharts heatmap logarithmic colorAxis fails when 0
- Where to find charts plug-in like this?
- Highchart bar pagination
- Highcharts series label legend in one line
- Define and apply theme on highcharts-react-official
- Highcharts adding additional series and axis breaks existing yAxis min/max
- Highcharts - highlight mouse position within a range
- Show datalabels for spiderweb only when hovered over the line or the legend?
- Referencing a JSON object created in Java through javascript in the one JSP page
- Reduce no of points in X axis HighChart
- Dotted lines in highcharts.net
- Highcharts add "expected" value
- How to add fullscreen event to a Highchart?
- Typescript and HighCharts
- Print charts in new tab
- How to set HighCharts dataGroup to a range/timeframe?
- could not find function "hc_add_series_density" Highcharter R
- how to add dynamic data in a highchart?
- HighCharts does not add a new points
- highcharts remove gap (column) with zero value
- How to reverse colors order for the first label?
- Asynchronous data input in highcharts
- How to set brightness effects on specific columns on the stacked column/bar chart when using Highcharts?
- Setting rounded corners on an image using Highcharts Renderer