Skip to content
Discussion options

You must be logged in to vote

I was able to do that intercepting _drawNodes. It also allows other customizations :)

export function validateSizeValue(size: any): "min" | "max" {
  if (!size || ["min", "max"].indexOf(size) === -1) {
    return "max";
  }
  return size;
}

(SankeyController as any).prototype._drawNodes = function () {
  const ctx = this.chart.ctx;
  const nodes = this._nodes || new Map();
  const { borderColor, borderWidth = 0, nodeWidth = 10, size } = this.options;
  const sizeMethod = validateSizeValue(size);
  const { xScale, yScale } = this._cachedMeta;

  ctx.save();
  if (borderColor && borderWidth) {
    ctx.strokeStyle = borderColor;
    ctx.lineWidth = borderWidth;
  }

  for (const node of nodes.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by fesvieira
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant