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

How does shape use gradients or textures? #7

Closed
unrealsmart opened this issue Dec 30, 2020 · 4 comments
Closed

How does shape use gradients or textures? #7

unrealsmart opened this issue Dec 30, 2020 · 4 comments

Comments

@unrealsmart
Copy link

https://g.antv.vision/en/docs/api/shape/attrs#%E7%BA%B9%E7%90%86

@entronad
Copy link
Owner

entronad commented Dec 30, 2020

Wether geoms should have a style param has not been decided.
There are lots of questions about geom style: witch should be chosen? what's the relation to the attr? should gradient offsets be relative?

If you really need to set the gradient(or other paint style) now, please custom your own Shape class and set your own shader of the renderShapes in it, like:

class TriangleShape extends graphic.IntervalShape {

@unrealsmart
Copy link
Author

yes, like this
image
I can't find the shape to set the picture, maybe there are a lot of icons

@entronad
Copy link
Owner

No picture marker yet.

@entronad
Copy link
Owner

entronad commented Oct 27, 2021

Upgrade to v0.4

The gradient attribute here:
https://pub.dev/documentation/graphic/latest/graphic/GradientAttr-class.html

The custom tooltip or custom figure annotation seem to fit your task for drawing icons (You have to draw with dart Path, not picture file):
https://pub.dev/documentation/graphic/latest/graphic/TooltipGuide-class.html
https://pub.dev/documentation/graphic/latest/graphic/CustomAnnotation-class.html

See examples here:
https://github.com/entronad/graphic/blob/main/example/lib/pages/custom.dart

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

2 participants