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

Highcharts/8 packed bubble algorithm #9

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

MarkusBarstad
Copy link
Contributor

not perfect, but somewhat working, and ready for pros to look at and help 8)

main_part3.js contains text regarding the exercise

MarkusBarstad and others added 9 commits August 26, 2022 16:31
i have 3 scripts in the html for each part of the exercise

part 2 and 3 are outcommented but are hooked up to the same container 'container' in the html-file
@MarkusBarstad MarkusBarstad self-assigned this Sep 3, 2022
Copy link

@hihajdus hihajdus left a comment

Choose a reason for hiding this comment

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

Thanks!
To be add part of 8.1 task, throwing points between series.

@MarkusBarstad
Copy link
Contributor Author

Thank you for your comments, man!

I will implement your suggested changes when I have time and ping you on slack after I have done so! :)

@MarkusBarstad
Copy link
Contributor Author

A bubble now moves between series at initial load-event!

Copy link

@hihajdus hihajdus left a comment

Choose a reason for hiding this comment

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

Exactly!


const radiiDistance = (c1, c2) => Math.sqrt(squared(c1.x - c2.x) + squared(c1.y - c2.y));

const collides = (c1, c2) => (radiiDistance(c1, c2) <= c1.r + c2.r);

Choose a reason for hiding this comment

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

Bravo, this way of looking for collisions is interesting, close to a solution!

I have other propose that can be used to find collisions, witch refers to the layoutAlgorithm.repulsiveForce and value of d, current distance between two nodes.

https://jsfiddle.net/BlackLabel/3okh25x9/6/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cool way to solve it, I haven't realized you can use stuff from other series-types that way, thanks for shoving! I will implement it today or tomorrow!

* i am also not able to drag bubbles in this chart which specifically states that this is possible:
https://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/series-packedbubble/packed-dashboard/

* i think it could be the old laptop i am currently working on which is the issue, it is very old and kindof buggy x)

Choose a reason for hiding this comment

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

It looks like it's not a problem with old computer ;)
Drag and drop stoped work and It's related to this bug, regression HC version.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, i see! x) Thank you for the info!

Copy link

@hihajdus hihajdus left a comment

Choose a reason for hiding this comment

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

Exercise complete 👌, impressed that you created a mechanism to find bubbles collision, well done 🙂

@MarkusBarstad
Copy link
Contributor Author

Exercise complete ok_hand, impressed that you created a mechanism to find bubbles collision, well done slightly_smiling_face

Oh, thank you! I didn't realize my commit updated this PR lol! x)

My plan was to use repulsiveForce like you showed, I was just cleaning my code a bit before implementing it xD

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.

2 participants