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

Refactoring (Map): initial phase #512

Merged
merged 31 commits into from
Feb 5, 2021
Merged

Refactoring (Map): initial phase #512

merged 31 commits into from
Feb 5, 2021

Conversation

Konstiman
Copy link
Contributor

This PR introduces the 1st part of the knowledge map component refactoring. I refactored everything at once (chart + bubbles + papers).

The new code can be tested by building the application with MODERN_FRONTEND=true.

Main features:

Libraries:

  • I installed one new library: react-hyphen. I use it for hyphenating the paper content.
  • d3 sub-libraries were added (somehow d3 didn't work without them in the new code)

Redux:

  • New actions and reducers for handling force layout and animations added.
  • If the animation is running, all actions (with some exceptions) are queued and triggered after the animation finishes.
  • New middlewares that do things unrelated to the legacy code - scrolling, queuing, force layout, streamgraph detection.
  • Most reducers were changed to support the queuing.

Components:

  • Highlight component had to change so it supports hyphenated strings.
  • New components KnowledgeMap, Chart, Bubble and Paper.
  • BubbleTitle component encapsulates the old highlighting + hyphenating + truncating logic.

Legacy code:

  • Disabled a lot of code in canvas.js, bubbles.js, papers.js and list.js.
  • Refactored the dimension computation into a separate file.

Testing:

  • No unit tests yet.

Known bugs:

  • Wrong map height in LinkedCat (both knowledge map and streamgraph).

Jan Konstant added 30 commits December 1, 2020 15:41
commented out most of the legacy code
components prototypes
force layout first working version
zoom in/out (no animation yet)
resize in zoom
bubbles order on hover/zoom
selecting, hovering, deselecting
the resize on hover is just prototype
with known bug: zooming to a different bubble
prepared middleware for queued actions
any action that changes the map state is queued during the animation

bubble and paper order moved to store

known bug: hovered paper after zoom in
text truncating doesn't work again
hyphenation + shave + highlighting
commented out more legacy code
middlewares in intermediate
bubble titles set with dangerouslySetInnerHTML
@chreman chreman merged commit d159b9b into master Feb 5, 2021
@Konstiman Konstiman deleted the refactoring-map-initial branch March 9, 2021 09:48
chreman added a commit to chreman/Headstart that referenced this pull request Oct 13, 2021
…toring-map-initial

Refactoring (Map): initial phase

Former-commit-id: d159b9b
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