-
-
Notifications
You must be signed in to change notification settings - Fork 419
Point form customization #1082
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
base: master
Are you sure you want to change the base?
Point form customization #1082
Conversation
I'm marking this PR as ready to review. But in my mind, I wanted to open a discussion with you to cursor's form and legend markers. If you prefer, I'll mark it as a draft again. |
thanks for the PR, i will take a look soon. however, i definitely prefer to discuss things like this in an issue/proposal first instead of getting a random code dump without prior context. it will help you better align your PRs with future changes and understand where things are headed that are not immediately obvious from the repo code or conversations. i've been thinking long term about rendering markers on a dedicated canvas layer, which would fix the misalignment issues between DOM and canvas: #922 i'm currently experimenting with fast svg pathstring marker rendering in https://github.com/leeoniya/uMarks
if you attain an improvement, maybe put that into a separate PR (if it improves the existing hover point alignment) |
also, please leave the build files out of PRs for easier review. i will do a build commit when the PR is merged. |
this may be true of the demo, but this callback does receive all the necessary arguments needed for conditional point visibility. it does require copying some code, though. Line 830 in abadf17
|
Several things are done in this PR:
Today, the example to override the point form (draw-hooks.html) is not performant. In order to draw the custom point, the
points.show
function is overidden; this force the drawing of every point, regardless of the serie's size.With this PR, the alignement of the points to be drawn is handled by the uPlot library, no need to override the
points.paths
function and copy the alignment logic.Maybe we could reuse the draw method, but SVG are nicely displayed and does not suffer of pixel blur.
Some discrepancies remain:
This PR shows that pixel alignment is weird. For example, the Small CROSS of size 8 and width 1, when pixelAlign is set to 1, looks like more a diamond than a CROSS. I'll work on pixelAlign next.