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 BubbleSets plugin #5653

Merged
merged 9 commits into from
Apr 23, 2024
Merged

feat: add BubbleSets plugin #5653

merged 9 commits into from
Apr 23, 2024

Conversation

yvonneyx
Copy link
Contributor

@yvonneyx yvonneyx commented Apr 17, 2024

新增插件 BubbleSets,基于社区三方库 bubblesets-js 实现

import type { IBubbleSetOptions } from 'bubblesets-js';

export interface BubbleSetsOptions extends BasePluginOptions, IBubbleSetOptions, AnnotatedPathStyleProps {
  /**
   * <zh/> 成员元素,包括节点和边
   *
   * <en/> Member elements, including nodes and edges
   */
  members: ID[];
  /**
   * <zh/> 非成员元素,仅包括节点
   *
   * <en/> Non-member elements, only nodes
   */
  nonMembers?: ID[];
}
image

@yvonneyx yvonneyx force-pushed the feat/bubblesets branch 2 times, most recently from 7f8c9e2 to df336d9 Compare April 17, 2024 08:25
@hustcc
Copy link
Member

hustcc commented Apr 17, 2024

为啥使用 bubblesets-js 而不是 bubblesets,另外,两个 repo 的 star 数量,下载量都不算高。

@yvonneyx
Copy link
Contributor Author

为啥使用 bubblesets-js 而不是 bubblesets,另外,两个 repo 的 star 数量,下载量都不算高。

首先,Bubble Sets 是由 Christopher Collins 提出的一种可视化技术。 bubblesets 库就是 Bubble Sets 的一个 JS 实现,它透出的 API 相对来说比较原生。 bubblesets-js 则是在 bubblesets 库的基础上进行了改造,提供了更友好的 API。目前也是 cytoscape bubblesets 插件的底层实现库,感觉比较可靠。所以就选择了 bubblesets-js


type HullLabelStyleProps = LabelStyleProps & {
interface ContourLabelStyleProps extends LabelStyleProps {
/**
* <zh/> 标签位置,可选值为 'top'、'right'、'bottom'、'left'、'center';默认为 'bottom'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

后续统一注释格式

return this.path;
};

public addMember(members: ID | ID[]) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

后续补下注释

@yvonneyx yvonneyx merged commit 57317d4 into v5 Apr 23, 2024
5 checks passed
@yvonneyx yvonneyx deleted the feat/bubblesets branch April 23, 2024 02:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants