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

自定义线条样式未生效 #1734

Open
t-j-d opened this issue Jul 15, 2024 · 1 comment
Open

自定义线条样式未生效 #1734

t-j-d opened this issue Jul 15, 2024 · 1 comment

Comments

@t-j-d
Copy link

t-j-d commented Jul 15, 2024

import { subStyleProps, Quadratic } from '@antv/g6';
import { Circle, Line } from '@antv/g';

export class FlyMarkerCubic extends Quadratic {
getMarkerStyle(attributes) {
return { r: 5, fill: '#c3d5f9', offsetPath: this.shapeMap.key, ...subStyleProps(attributes, 'marker') };
}
getLineStyle(attributes) {
return { stroke: '#c3d5f9', offsetPath: this.shapeMap.key, ...subStyleProps(attributes, 'marker') };
}
onCreate() {
const marker = this.upsert('marker', Circle, this.getMarkerStyle(this.attributes), this);
marker?.animate([{ offsetDistance: 0 }, { offsetDistance: 1 }], {
duration: 3000,
iterations: Infinity,
});
const line = this.upsert('line_style', Line, this.getLineStyle(this.attributes), this);
line.animate([{ lineDashOffset: 20 }, { lineDashOffset: 0 }], {
duration: 500,
iterations: Infinity,
});
}
}

@t-j-d
Copy link
Author

t-j-d commented Jul 15, 2024

自定义的Circle生效了,line未生效

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

No branches or pull requests

1 participant