Skip to content

Conversation

@asuzuki-jumptrading
Copy link
Collaborator

No description provided.

@asuzuki-jumptrading asuzuki-jumptrading force-pushed the asuzuki/shreds-header branch 2 times, most recently from a82c21e to ebd5a6d Compare November 23, 2025 21:04
@asuzuki-jumptrading asuzuki-jumptrading marked this pull request as ready for review November 24, 2025 15:45
@asuzuki-jumptrading asuzuki-jumptrading force-pushed the asuzuki/shreds-header branch 2 times, most recently from 2cd592b to 0e728a3 Compare November 25, 2025 00:36
@asuzuki-jumptrading asuzuki-jumptrading force-pushed the asuzuki/shreds-header branch 2 times, most recently from cb6e063 to 609e5d3 Compare November 25, 2025 19:42
background-color: #080b13;
border-radius: 2px;
border: 1px solid #3c4652;
will-change: transform, width;
Copy link
Collaborator

Choose a reason for hiding this comment

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

why is width needed here and below?


const uplotRef = useRef<uPlot>();
const lastRedrawRef = useRef(0);
const labelPositionsRef = useRef<LabelPositions>();
Copy link
Collaborator

Choose a reason for hiding this comment

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

don't get why we need this ref? This isn't used anywhere but the plugin right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is so I can compare the last + current draw label positions, and not update width / x position if it hasn't changed

Copy link
Collaborator

Choose a reason for hiding this comment

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

but why a ref vs just making some vars in your plugin? Since you're not consuming the ref from anywhere outside the plugin

Copy link
Collaborator

Choose a reason for hiding this comment

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

or are you re-initializing your plugin and you need a stable reference?

overflow="hidden"
position="relative"
// extra space for borders
height={`${height + 2}px`}
Copy link
Collaborator

Choose a reason for hiding this comment

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

changing box sizing to border-box would work too i think?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It doesn't seem to work with position: absolute 😢

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