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

Start rendering graph nodes #225

Merged
merged 5 commits into from
Oct 5, 2023
Merged

Start rendering graph nodes #225

merged 5 commits into from
Oct 5, 2023

Conversation

pleek91
Copy link
Collaborator

@pleek91 pleek91 commented Oct 4, 2023

Description

Start rendering graph nodes on the graph. Also adds a consistent way for fetching graph data in different objects.

@pleek91 pleek91 requested a review from a team as a code owner October 4, 2023 22:13
@netlify
Copy link

netlify bot commented Oct 4, 2023

Deploy Preview for prefect-graphs ready!

Name Link
🔨 Latest commit c7ddbcc
🔍 Latest deploy log https://app.netlify.com/sites/prefect-graphs/deploys/651de36fb14d660008132aff
😎 Deploy Preview https://deploy-preview-225--prefect-graphs.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@@ -26,6 +26,7 @@ function createApplication(stage: HTMLDivElement): void {
application = new Application({
background: '#1099bb',
resizeTo: stage,
antialias: true,
Copy link
Contributor

Choose a reason for hiding this comment

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

Antialiasing will help, but you'll def want the resolution: window.devicePixelRatio || 2, so that it uses the proper screen px density

Copy link
Contributor

@znicholasbrown znicholasbrown left a comment

Choose a reason for hiding this comment

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

2 non-blocking questions, otherwise good progress!

.eslintrc.json Show resolved Hide resolved
demo/sections/components/RunGraphDemo.vue Show resolved Hide resolved
src/objects/box.ts Show resolved Hide resolved

let subscription: UseSubscription<RunGraphFetch> | null = null
const { fetch: getData, stop: stopData } = graphDataFactory()
const nodes = new Map<string, Graphics>()
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you help me understand why the intermediary store of nodes here? Is this because the pixi app doesn't keep a reference of the graphics drawn to the canvas and otherwise we'd be re-rendering everything each time we got new data?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The way I understand it is since we added graphics to the viewport we either need to A, remove the old graphics and draw new ones (slow) or redraw the existing graphics (faster). So keeping a reference to the graphics for each node means we can redraw them even though they've already been added to the viewport.

Copy link
Contributor

Choose a reason for hiding this comment

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

My rough understanding. As long as the class is still in existence there is a texture and a sprite (graphics() = some utils + texture + sprite) for it whether it's on the screen or not. Actually it may still exist even if the class goes away if it hasn't been cleaned up enough.

It's like a 2d sidescroller game. You'll have textures loaded, things at the ready for when they enter the scene (a gun blast graphic graphic or something).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The specific implementation here is also likely to change. I'm focused more on the patterns and logic than the actual graphics/sprites themselves at this point.

src/utilities/graphDataFactory.ts Show resolved Hide resolved
@pleek91 pleek91 merged commit fbea409 into main Oct 5, 2023
3 checks passed
@pleek91 pleek91 deleted the graph-nodes branch October 5, 2023 18:32
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.

3 participants