MCPcopy
hub / github.com/apache/echarts / applyCurveStyle

Function applyCurveStyle

src/chart/sankey/SankeyView.ts:412–437  ·  view source on GitHub ↗

* Special color, use source node color or target node color * @param curveProps curve's style to parse * @param orient direction * @param edge current curve data

(curveProps: PathStyleProps, orient: 'horizontal' | 'vertical', edge: GraphEdge)

Source from the content-addressed store, hash-verified

410 * @param edge current curve data
411 */
412function applyCurveStyle(curveProps: PathStyleProps, orient: 'horizontal' | 'vertical', edge: GraphEdge) {
413 switch (curveProps.fill) {
414 case 'source':
415 curveProps.fill = edge.node1.getVisual('color');
416 curveProps.decal = edge.node1.getVisual('style').decal;
417 break;
418 case 'target':
419 curveProps.fill = edge.node2.getVisual('color');
420 curveProps.decal = edge.node2.getVisual('style').decal;
421 break;
422 case 'gradient':
423 const sourceColor = edge.node1.getVisual('color');
424 const targetColor = edge.node2.getVisual('color');
425 if (isString(sourceColor) && isString(targetColor)) {
426 curveProps.fill = new graphic.LinearGradient(
427 0, 0, +(orient === 'horizontal'), +(orient === 'vertical'), [{
428 color: sourceColor,
429 offset: 0
430 }, {
431 color: targetColor,
432 offset: 1
433 }]
434 );
435 }
436 }
437}
438
439// Add animation to the view
440function createGridClipShape(rect: RectLike, seriesModel: SankeySeriesModel, cb: () => void) {

Callers 1

renderMethod · 0.85

Calls 1

getVisualMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…