Skip to content

Conversation

@XiaoMing-xmg666
Copy link
Collaborator

@XiaoMing-xmg666 XiaoMing-xmg666 commented Jul 21, 2025

Kapture 2025-07-22 at 16 59 16
image

@XiaoMing-xmg666 XiaoMing-xmg666 requested a review from hustcc July 21, 2025 06:39
gemini-code-assist[bot]

This comment was marked as outdated.

gemini-code-assist[bot]

This comment was marked as outdated.

@XiaoMing-xmg666 XiaoMing-xmg666 requested a review from hustcc July 23, 2025 03:29
}

return [title, subTitle];
}
Copy link
Member

Choose a reason for hiding this comment

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

这个写法不太符合 G component 的写法。G component 有点类似于 React。

伪代码如下:

class TitleComponent extends CustomElement<T> {

    constructor(config: DisplayObjectConfig<T>) {
      super(config);
    }

    connectedCallback() {
    }

    public update(cfg = {}) {
      this.attr(deepMix({}, this.attributes, cfg));
    }

    render(attributes, container) {
       this.add(titleLabel);
       this.add(subtitleLabel);
    }
  };

Copy link
Member

Choose a reason for hiding this comment

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

下一个 pr 写到 component 中。

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

1

@hustcc hustcc requested a review from yvonneyx July 23, 2025 06:04
@XiaoMing-xmg666 XiaoMing-xmg666 changed the title wip: title plugin feat: title plugin Jul 23, 2025
@XiaoMing-xmg666 XiaoMing-xmg666 requested a review from hustcc July 23, 2025 08:18
}

export class Title extends BasePlugin<TitleOptions> {
private static commonStyle: Partial<LabelStyleProps> = {
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
Collaborator Author

Choose a reason for hiding this comment

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

改了

Used to configure the horizontal alignment of the title plugin. Default is `left`. You can choose `left`, `center`, or `right`, representing left-aligned, center-aligned, and right-aligned respectively.

```js | ob { pin: false }
createGraph(
Copy link
Contributor

Choose a reason for hiding this comment

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

这个demo代码写法可以不用使用 createGraph 了,参考一下内置圆形节点效果写法

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

image 这里要用playerplayground

@XiaoMing-xmg666 XiaoMing-xmg666 merged commit 67d6232 into v5 Jul 30, 2025
2 of 3 checks passed
@XiaoMing-xmg666 XiaoMing-xmg666 deleted the feat/plugin-title branch July 30, 2025 06:27
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.

4 participants