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

psp-10029 use debounce, memo to limit renders of clusters/markers. Update cluster library. #4661

Merged
merged 3 commits into from
Feb 24, 2025

Conversation

devinleighsmith
Copy link
Collaborator

No description provided.

@devinleighsmith devinleighsmith added bug Something isn't working enhancement New feature or request labels Feb 18, 2025
@devinleighsmith devinleighsmith self-assigned this Feb 18, 2025
@@ -46,7 +56,7 @@ const useSupercluster = <
* greater than 100 (avoid perfomrance issues when rendering all points)
*/
if (bounds && (options?.enableClustering || points.length > 100)) {
setClusters(superclusterRef.current.getClusters(bounds, zoomInt));
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Due to useEffects and other prop changes, this method would be called 3-4 times per user interaction prior to this change.

} else {
const clusterFeature = cluster as PointFeature<
const mapMarkerClickFn = mapMachine.mapMarkerClick;
const renderedPoints = useMemo(() => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In normal situations, react handles the prevention of unnecessary renders to the render tree. However, it may not be able to do so here due to interactions with leaflet - as a result, this render method was greatly slowing down the overall map render time.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

(without this memo, this render method is called 4-6 times per user action)

@@ -51,7 +51,7 @@
"redux-thunk": "2.3.0",
"retry-axios": "2.4.0",
"styled-components": "5.3.6",
"supercluster": "7.1.3",
"supercluster": "8.0.1",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

tested, has better getcluster performance.

Copy link
Contributor

See CodeCov Report Here: https://app.codecov.io/github/bcgov/psp/pull/4661

1 similar comment
Copy link
Contributor

See CodeCov Report Here: https://app.codecov.io/github/bcgov/psp/pull/4661

Copy link
Collaborator

@FuriousLlama FuriousLlama left a comment

Choose a reason for hiding this comment

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

glad you had the time to look into this! thank you

Copy link
Contributor

See CodeCov Report Here: https://app.codecov.io/github/bcgov/psp/pull/4661

@asanchezr asanchezr merged commit 8f6a96b into bcgov:dev Feb 24, 2025
8 checks passed
devinleighsmith added a commit that referenced this pull request Mar 6, 2025
* Bump version 100 (#4655)

* Bump version - IS 100

* json formatting

* CI: Bump version to v5.8.0-100.1

* PSP-10013 : New wording for the modal and tooltip ( PSP-9563) (#4656)

* CI: Bump version to v5.8.0-100.2

* PSP-10014 : FT:Lease&License: Override modal is populated every time after the user enters into the edit mode and doesn't make any changes on the file (#4658)

Co-authored-by: Herrera <[email protected]>

* CI: Bump version to v5.8.0-100.3

* IS100.00 Database Schema (#4653)

* IS100.00 Database Schema

PSP_PIMS | Development Sprint: S100.00 | Design Sprint: 99 | Date: 2025-Feb-12
- Added tables:
  - PIMS_COMP_REQ_ACQ_PAYEE
  - PIMS_COMP_REQ_ACQ_PAYEE_HIST
  - PIMS_COMP_REQ_LEASE_PAYEE
  - PIMS_COMP_REQ_LEASE_PAYEE_HIST
  - PIMS_LEASE_LICENSE_TEAM
  - PIMS_LEASE_LICENSE_TEAM_HIST
  - PIMS_LL_TEAM_PROFILE_TYPE
- Altered tables:
  - PIMS_DSP_PURCH_AGENT
  - PIMS_DSP_PURCH_SOLICITOR
  - PIMS_DISPOSITION_PURCHASER
- Dropped tables:
  - PIMS_COMP_REQ_PAYEE
  - PIMS_COMP_REQ_PAYEE_HIST
  - PIMS_LEASE_STAKEHOLDER_COMP_REQ
  - PIMS_LEASE_STAKEHOLDER_COMP_REQ_HIST
- Added seed scripts:
  - 007_PSP_PIMS_COMP_REQ_PAYEE_HIST_Add.sql
  - 117_PIMS_LEASE_LICENSE_TEAM.sql
  - 164_DML_PIMS_LL_TEAM_PROFILE_TYPE.sql
- Altered seed scripts:
  - 087_PIMS_COMP_REQ_ACQ_PAYEE.sql
  - 100_PIMS_COMP_REQ_LEASE_PAYEE.sql
  - 163_DML_PIMS_ACQ_FILE_EXPROP_RISK_TYPE.sql
- Added test scripts:
  - 117_PIMS_LEASE_LICENSE_TEAM.sql
- Altered test scripts:
  - 100_PIMS_COMP_REQ_LEASE_PAYEE.sql
  - 087_PIMS_COMP_REQ_ACQ_PAYEE.sql
- Requires additional metadata to meet standards

* Altered 092_DML_PIMS_ACQ_PHYS_FILE_STATUS_TYPE.sql

Added "Unknown" status type

---------

Co-authored-by: Manuel Rodriguez <[email protected]>

* CI: Bump version to v5.8.0-100.4

* Contact Manager filter placeholder change (#4657)

Co-authored-by: Alejandro Sanchez <[email protected]>

* CI: Bump version to v5.8.0-100.5

* Scaffold S100 (#4659)

* Generated scaffold

* Fixed compilation and tests

* CI: Bump version to v5.8.0-100.6

* PSP-10034: Fixing Font sizes, spaces and icons and icons alignment (#4660)

* PSP-10034 fix

* Changing style.ts

* Snapshots update

* Changing icons positions and missing icons updates

* snapshots update

---------

Co-authored-by: Alejandro Sanchez <[email protected]>

* CI: Bump version to v5.8.0-100.7

* DB Scripts - Fix alphanumeric sorting for folders S100 and greater (#4662)

* CI: Bump version to v5.8.0-100.8

* PSP-10051 : FT:Lease&License: Acknowledgement modal verbiage is populating incorrectly (#4665)

Co-authored-by: Herrera <[email protected]>

* CI: Bump version to v5.8.0-100.9

* Psp 10042 fix error when trying to delete documents with no document queue. (#4663)

* psp-9813 ensure error messages from backend display properly.

* psp-10042, ignore deletion failures when no document queue item exists.

---------

Co-authored-by: Alejandro Sanchez <[email protected]>

* CI: Bump version to v5.8.0-100.10

* Psp 10048 - research final file edit behaviour corrections. (#4664)

* psp-9813 ensure error messages from backend display properly.

* psp-10048 add logic to hide research file edit when file in final status - only make editable for admins.

---------

Co-authored-by: Alejandro Sanchez <[email protected]>

* CI: Bump version to v5.8.0-100.11

* psp-10029 use debounce, memo to limit renders of clusters/markers. Update cluster library. (#4661)

* psp-10029 use debounce, memo to limit renders of clusters/markers.

* add mocking of lodash to mapcontainer method.

---------

Co-authored-by: Alejandro Sanchez <[email protected]>

* CI: Bump version to v5.8.0-100.12

* Psp 9943 highway layer url display (#4667)

* psp-9813 ensure error messages from backend display properly.

* psp-9943 show hyperlink for highway layer popup.

* support multiple highway layer properties at the same click location.

---------

Co-authored-by: Alejandro Sanchez <[email protected]>

* CI: Bump version to v5.8.0-100.13

* Merge pull request #4666 from devinleighsmith/psp-9528

psp-9528 double click to zoom the map.

* CI: Bump version to v5.8.0-100.14

* Reqnroll changes (#4670)

* CI: Bump version to v5.8.0-100.15

* Psp 9943 - change highway layer type for point querying - use the plan footprint instead of parcel boundaries. (#4671)

* psp-9943 show hyperlink for highway layer popup.

* support multiple highway layer properties at the same click location.

* psp-9943, swap highway layer to use the overall plan outline instead of the property boundaries, as this is clearer on the map.

* snapshot updates.

* snapshot updates.

* CI: Bump version to v5.8.0-100.16

* Psp 9916 - multiple payees for lease/license (#4669)

* psp-9916 multiple payees for leases.

* test corrections.

* code review comments.

* psp-9916, final corrections.

* revert changes to highway.

* snapshot updates.

* update handler.

* CI: Bump version to v5.8.0-100.17

* PSP-10035: IS100 Automation Test changes (#4672)

* Changes on automation branch

* Changes on existing automated test based on last changes from IS98

* Update Acquisition Details file

* Implementation of automated reports

* Update BrowserDriver and PageObjectBase

* integration test changes to implement extent reports

* Applying changes for Extent report to work on github actions

* Deleting v2 artifact command

* integration test changes to implement extent reports

* Changing Firefox driver location

* Moving geckodriver to readeable path

* Extent report implementation

* integration test changes

* reports last step from workflow

* Correcting folder

* Changes on extent report config

* Changes on Extent report config

* uploading report example

* Changes on automation set to accomodate data on DEV environment

* Adding SSH to avoid errors

* Changes integration-test.yml

* Changing extent report folder name

* Chnages on extent report folder name

* Changing directory of the report for github actions

* Adding creating a folder for reports on github actions

* integration-test.yml changes

* Changing extent reports folder

* generate report fix

* Changes to generate images on github actions report

* Changes on report

* Delete testing/PIMS.Tests.Automation/Reports/Extent_Reports/PIMS_AutomationReport.html

* Changes IS100 automation test set

* Changes on IS100 automation

---------

Co-authored-by: Alejandro Sanchez <[email protected]>

* CI: Bump version to v5.8.0-100.18

* Lease and License updates (#4673)

* CI: Bump version to v5.8.0-100.19

* psp-10020 AOSLCTR backwards-compatibility (#4676)

* psp-10020

* psp-10118 override feature open event when marker double clicked.

* test corrections.

* CI: Bump version to v5.8.0-100.20

* Fixed layout (#4680)

* CI: Bump version to v5.8.0-100.21

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Eduardo <[email protected]>
Co-authored-by: Herrera <[email protected]>
Co-authored-by: Doug Filteau <[email protected]>
Co-authored-by: Manuel Rodriguez <[email protected]>
Co-authored-by: Sue Tairaku <[email protected]>
Co-authored-by: devinleighsmith <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants