react-d3-graph icon indicating copy to clipboard operation
react-d3-graph copied to clipboard

add link.view_generator

Open yoshi6jp opened this issue 4 years ago • 2 comments

This PR add link pathGenerator, when pathGenerator is used, it supports customizable link.

yoshi6jp avatar May 05 '21 03:05 yoshi6jp

Hi @yoshi6jp ,

Thank you very much for opening this PR, it will be an awesome addition to the library.

From an API point of view, what do you think about making it like the node.viewGenerator?

Which would be :

  • renaming pathGenerator to viewGenerator
  • passing all the node props to the generator instead of passing lineProps and other props, once more to make the API look like the nodeGenerator API

antoninklopp avatar May 13 '21 14:05 antoninklopp

Hi @dgautsch , @antoninklopp I fixed PR

  • rename pathGenerator to viewGenerator
  • change link.viewGenerator parameters
viewGenerator: (props, options) => (
    <CustomLink
     label={props.label}
     source={props.source}
     target={props.target}
     id={options.id}
     textProps={options.textProps}
     lineProps={options.lineProps}
  />)

yoshi6jp avatar May 18 '21 09:05 yoshi6jp