Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add edge bundling plugin #6391

Merged
merged 2 commits into from
Oct 11, 2024
Merged

feat: add edge bundling plugin #6391

merged 2 commits into from
Oct 11, 2024

Conversation

yvonneyx
Copy link
Contributor

  • add edge bundling plugin

Oct-10-2024 14-34-08

interface EdgeBundlingOptions extends BasePluginOptions {
  /**
   * <zh/> 边的强度
   *
   * <en/> The strength of the edge
   * @defaultValue 0.1
   */
  K?: number;
  /**
   * <zh/> 初始步长。在后续的周期中,步长将双倍递增
   *
   * <en/> An initial step size. In subsequent cycles, the step size will double incrementally
   * @defaultValue 0.1
   */
  lambda?: number;
  /**
   * <zh/> 模拟周期数
   *
   * <en/> The number of simulation cycles
   * @defaultValue 6
   */
  cycles?: number;
  /**
   * <zh/> 初始切割点数。在后续的周期中,切割点数将根据 `divRate` 逐步递增
   *
   * <en/> An initial number of subdivision points for each edge. In subsequent cycles, the number of subdivision points will increase gradually according to `divRate`
   * @defaultValue 1
   */
  divisions?: number;
  /**
   * <zh/> 切割点数增长率
   *
   * <en/> The rate at which the number of subdivision points increases
   * @defaultValue 2
   */
  divRate?: number;
  /**
   * <zh/> 指定在第一个周期中执行的迭代次数。在后续的周期中,迭代次数将根据 `iterRate` 逐步递减
   *
   * <en/> The number of iteration steps during the first cycle. In subsequent cycles, the number of iterations will decrease gradually according to `iterRate`
   * @defaultValue 90
   */
  iterations?: number;
  /**
   * <zh/> 迭代次数递减率
   *
   * <en/> The rate at which the number of iterations decreases
   * @defaultValue 2 / 3
   */
  iterRate?: number;
  /**
   * <zh/> 边兼容性阈值,决定了哪些边应该被绑定在一起
   *
   * <en/> Edge compatibility threshold, which determines which edges should be bundled together
   * @defaultValue 0.6
   */
  bundleThreshold?: number;
}

*/
export class EdgeBundling extends BasePlugin<EdgeBundlingOptions> {
static defaultOptions: Partial<EdgeBundlingOptions> = {
K: 0.1,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个为什么是大写呢

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4.0 就是这个命名,变量名没做修改~

*
* <en/> The edge bundling plugin provided in G6 is based on the implementation of the paper FEDB (Force-Directed Edge Bundling for Graph Visualization): modeling edges as flexible springs that can attract each other and bundling them in a self-organizing way.
*/
export class EdgeBundling extends BasePlugin<EdgeBundlingOptions> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

整体实现有相关参考链接吗?可以贴一下方便后续维护

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remarks 里写了是根据论文 Force-Directed Edge Bundling for Graph Visualization 实现的

@yvonneyx yvonneyx merged commit 7c87eb3 into v5 Oct 11, 2024
5 checks passed
@yvonneyx yvonneyx deleted the plugin-edge-bundling branch October 11, 2024 02:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants