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

72 make legend box component #82

Merged
merged 25 commits into from
Jul 3, 2024
Merged

Conversation

amaliejvik
Copy link
Contributor

@amaliejvik amaliejvik commented Jul 3, 2024

  • A sticky box located in the upper left corner that displays an overview of which components are present in the scene in Latex
  • Can be collapsed into a small square, and then extended again by clicking the arrow icons
  • When hovering over elements of type Plot, Point and Circle in the LegendBox, the corresponding Components in the scene are highlighted
  • Support for State variables, which LaTeX-strings can rely on. Further, LaTeX-strings in LegendBox will update according to the state variables

The following information is currently configured to be displayed for the given element types:

  • Plots: <Plot name> : <Plot expression>
  • Points: <Point name> : (x,y)
  • Stat variables: <State name> : <State value>
  • String: <String with state variables> : <String where state variables are replaced with actual current state values>
  • Remaining components: <Component ClassName>
Skjermbilde 2024-07-03 kl  15 37 06

Closes #72

- Plots get names starting from f and following the alphabet
- Plots get colors from a default list that cycles
- Some styling

Related to #72
- Add getName() function on Component class, which returns its ClassName if not defined to something else in the component itself and an empty string if component.name is not defined either
- Components can have a displayText() function, which defines which text should be present in LegendBox
- In the LegendBox, each row consists of <dot of plot color | black dot> + <component.name>. If displayText exists on component, this is displayed after <component.name> (ex. function expression for plots and coordinates for point)
- Add emitter for Point, such that LegendBox updates when point is dragged around

Related to #72
… on these variables in the legendBox

(A draft that works, code must still be refined)

Related to #72
@amaliejvik amaliejvik self-assigned this Jul 3, 2024
@amaliejvik amaliejvik linked an issue Jul 3, 2024 that may be closed by this pull request
@amaliejvik amaliejvik requested a review from jonasdeluna July 3, 2024 13:38
Copy link
Member

@jonasdeluna jonasdeluna left a comment

Choose a reason for hiding this comment

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

Great work, just fix the lint/prettier 🚀

@amaliejvik amaliejvik merged commit 9fa6c62 into master Jul 3, 2024
2 checks passed
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.

Make legend box component
2 participants