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

refactor: minimap wont override specified container style #6693

Merged
merged 1 commit into from
Jan 3, 2025

Conversation

Aarebecca
Copy link
Contributor

  • Minimap 当用户指定容器时,不会修改该容器样式

Copy link

Walkthrough

This pull request refactors the createPluginCanvas function to ensure that when a user specifies a container, the style of that container is not overridden. The changes involve removing the application of styles to the container when it is specified by the user.

Changes

File Summary
packages/g6/src/plugins/utils/canvas.ts Refactored createPluginCanvas to avoid overriding user-specified container styles by removing style assignments when a container is provided.

@@ -33,18 +33,8 @@ interface Options {
* @returns <zh/> [容器, 画布] | <en/> [container, canvas]
*/
export function createPluginCanvas(options: Options): [HTMLElement, GCanvas] {
const { width, height, renderer, containerStyle } = options;
const { width, height, renderer } = options;

Choose a reason for hiding this comment

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

The removal of containerStyle from the destructuring assignment means that user-specified styles will not be applied to the container. Ensure that this change is intentional and that the container's style is managed elsewhere if needed.

@Aarebecca Aarebecca merged commit ea4bae0 into v5 Jan 3, 2025
2 checks passed
@Aarebecca Aarebecca deleted the fix/minimap-style branch January 3, 2025 11:43
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.

1 participant