feat: new classifications and legend improvements [DHIS2-18242]#3637
Draft
BRaimbault wants to merge 32 commits into
Draft
feat: new classifications and legend improvements [DHIS2-18242]#3637BRaimbault wants to merge 32 commits into
BRaimbault wants to merge 32 commits into
Conversation
Contributor
|
🚀 Deployed on https://pr-3637.maps.netlify.dhis2.org |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description last updated with: 9039317
Implements
Description
DHIS2-21356: Saving event layer without choosing predefined legend set breaks layer
JIRA ticket: DHIS2-21356
Test map:
Details
When switching to predefined legend type, automatically select the data item's associated legend set by default (or the first available one if none is associated), so saving without manually picking a legend set no longer breaks the layer
LegendSetSelect, where the available list is guaranteed to be loaded:src/components/classification/LegendSetSelect.jsxuseEffectauto-selection fromNumericLegendStyle; passdefaultLegendSet={dataItem?.legendSet}down toLegendSetSelectinstead:src/components/classification/NumericLegendStyle.jsxDHIS2-21142: Add new classification method (natural breaks, pretty breaks, log, sd)
JIRA ticket: DHIS2-21142
Test map: KKmdCyobwV8
Details
+ Changes:
simple-statistics+ Code:
i18n/en.potsrc/constants/layers.jssrc/util/classify.jssrc/components/classification/LegendTypeSelect.jsxsimple-statistics:package.jsonandyarn.lockDHIS2-20818: Thematic layer, bubble style - legends shows NaN when the all mapped values are equal
JIRA ticket: DHIS2-20818
Test map: nxq2hIlZdAK
Details
+ Code:
minValue === maxValueedge case in bubble radius calculation:src/util/bubbles.jsDHIS2-20287: Hide or show map layers while on the dashboard like it is the charts
JIRA ticket: DHIS2-20287
Test map: vk5afupHOqr?interpretationId=PQfGfYQRzG8
Details
+ Changes:
+ Code:
src/components/plugin/LegendLayer.jsxtoggleLayerVisibilitycallback andvisibilityOverridesstate (reset when map views change):src/components/plugin/Map.jsxtoggleLayerVisibilitydown toLegendLayer:src/components/plugin/Legend.jsxsrc/components/plugin/styles/Legend.cssDHIS2-19984: Values not displayed for data item with type NUMBER and associated to an option set in Maps app data table
JIRA ticket: DHIS2-19984
Test map: wDv1BBwTCyQ
Details
+ Changes:
+ Code:
src/components/datatable/useTableData.jssrc/loaders/eventLoader.jsDHIS2-19983: Improve ranges/legend sorting in Maps data table
JIRA ticket: DHIS2-19983
Test map:
Details
+ Changes:
rawValue) so the value column also sorts numerically+ Code:
rawValue:src/components/datatable/useTableData.jsparseRangeutility (handles digit-group separators):src/util/legend.jsDHIS2-19982: Chevron icon is not centered in the color select button
JIRA ticket: DHIS2-19982
Test map:
Details
+ Changes:
+ Code:
width={50}to theColorPickerin the option style row:src/components/optionSet/OptionStyle.jsxwidth: 32px; height: 32pxconstraint and switch to flexbox layout:src/components/optionSet/styles/OptionStyle.module.cssBooleanStyleis unaffected directly as it reusesOptionStyle:src/components/dataItem/BooleanStyle.jsxsrc/components/core/styles/ColorScale.module.cssDHIS2-19850: Thematic / Facility / OrgUnits / Earth Engine layer - Deal with OrgUnits without coordinates
JIRA ticket: DHIS2-19850
Test map:
Details
+ Changes:
+ Code:
countOrgUnitsWithoutCoordinatesaction and reducer:src/actions/layerEdit.jssrc/components/edit/FacilityDialog.jsx,src/components/edit/earthEngine/StyleTab.jsx,src/components/edit/orgUnit/OrgUnitDialog.jsx,src/components/edit/thematic/ThematicDialog.jsxsrc/components/legend/Legend.jsxsrc/loaders/facilityLoader.js,src/loaders/orgUnitLoader.js,src/loaders/thematicLoader.js,src/loaders/earthEngineLoader.jssrc/util/orgUnits.js,src/util/requests.jssrc/components/datatable/useTableData.jssrc/util/favorites.js,src/util/config.jsDHIS2-19812: Properly distinguish values outside of legend and no data and allow user to display both independently
JIRA ticket: DHIS2-19812
Test map:
Details
+ Changes:
+ Code:
NoDataLegendreusable component (checkbox + color picker + name field):src/components/edit/shared/NoDataLegend.jsxUnclassifiedLegendreusable component (checkbox + color picker + name field):src/components/edit/shared/UnclassifiedLegend.jsxNoDataColorcomponent (replaced by the two above):src/components/edit/thematic/NoDataColor.jsxsrc/components/edit/thematic/ThematicDialog.jsxsrc/components/edit/event/EventDialog.jsxnoDataLegendandunclassifiedLegendseparately (including migration from legacynoDataColor):src/loaders/thematicLoader.js,src/loaders/eventLoader.jsnoDataLegendandunclassifiedLegendindependently:src/util/styleByDataItem.jssrc/components/map/layers/ThematicLayer.jsxsrc/components/legend/Bubbles.jsxsrc/util/favorites.jssrc/util/__tests__/styleByDataItem.spec.jsDHIS2-19203: Use "Classes" instead of "Steps"
JIRA ticket: DHIS2-19203
Test map:
Details
+ Changes:
+ Code:
src/components/edit/earthEngine/StyleSelect.jsxDHIS2-19078: Save visibility toggle state of layers and visibility and opacity of basemap with map
JIRA ticket: DHIS2-19078
Test map:
Details
+ Changes:
+ Code:
isVisiblefor all layers and basemap opacity/ID:src/util/favorites.jssrc/util/getMigratedMapConfig.jsserverVersionto apply migration conditionally:src/components/app/FileMenu.jsxsrc/components/map/layers/EventLayer.jsx,FacilityLayer.jsx,GeoJsonLayer.js,Layer.js,OrgUnitLayer.jsx,ThematicLayer.jsx,TrackedEntityLayer.jsx,ExternalLayer.js,earthEngine/EarthEngineLayer.jsxsrc/loaders/thematicLoader.js,eventLoader.js,facilityLoader.js,orgUnitLoader.js,geoJsonUrlLoader.js,earthEngineLoader.js,externalLoader.js,trackedEntityLoader.jssrc/components/plugin/Map.jsxsrc/util/__tests__/favorites.spec.js,src/util/__tests__/getMigratedMapConfig.spec.jsDHIS2-18963: Digit groups separator functionality in maps
JIRA ticket: DHIS2-18963
Test maps: gugP3BzGjK1 - thematic) / UPtjWBCx4pJ - events / lL0i0WO23Gw - tracked entities / DpskVx1d2Jh - earth engine / gmSDDyzZHy2 - geojson / WR6S8roHTao - org unit / N3N3m9zyKy5 - facility
Details
+ Changes:
Values/counts are formatted with the system digit group separator and appear in:
+ Code:
formatWithSeparatorand parsing utilityparseWithSeparator:src/util/numbers.jssrc/util/helpers.jskeyAnalysisDigitGroupSeparatorto fetched system settings:src/constants/settings.jssrc/hooks/useLayersLoader.js,src/components/plugin/LayerLoader.jsxsrc/components/legend/LegendItemRange.jsx,src/components/legend/Bubble.jsxsrc/components/edit/earthEngine/LegendPreview.jsxsrc/components/map/layers/EventPopup.jsx,TrackedEntityPopup.jsx,earthEngine/EarthEnginePopup.jsxsrc/components/orgunits/OrgUnitData.jsx,src/components/orgunits/OrgUnitInfo.jsxsrc/components/datatable/useTableData.js,src/components/datatable/DataTable.jsxsrc/loaders/thematicLoader.js,src/loaders/earthEngineLoader.js,src/loaders/eventLoader.js,src/loaders/trackedEntityLoader.jssrc/components/map/layers/GeoJsonLayer.js,src/loaders/geoJsonUrlLoader.jsDHIS2-15514: Isolate a single value (eg. 0) in Maps
JIRA ticket: DHIS2-15514
Test map:
Details
+ Changes:
+ Code:
IsolatedClasscomponent (checkbox + min/max fields + color picker + name field):src/components/classification/IsolatedClass.jsxsrc/components/classification/Classification.jsxsrc/util/legend.jssrc/loaders/thematicLoader.jssrc/components/legend/Bubbles.jsxsrc/util/favorites.jssrc/util/__tests__/legend.spec.jsDHIS2-12860: Equal counts distribution is not ideal when many values are the same
JIRA ticket: DHIS2-12860
Test map: APqEkeE0Nr5
Details
+ Changes:
startValue === endValue(e.g. 100–100) can actually be matched against data values+ Code:
src/util/classify.jsstartValue === endValue:src/util/classify.jsDHIS2-10823: Improve the predefined legend display
JIRA ticket: DHIS2-10823
Test map: oXqCWc5JtS5
Details
+ Changes:
+ Code:
showRangeflag in:src/components/legend/Legend.jsxshowRangeflag down in:src/components/legend/LegendItem.jsxshowRangeflag to conditionally render the range in:src/components/legend/LegendItemRange.jsxlegendNamesContainRangeutility:src/util/legend.jsDHIS2-8478: Automatic legends with few data points
JIRA ticket: DHIS2-8478
Test map: r56Jrw3ZOQs
Details
+ Changes:
+ Code:
hasInsufficientValuesflag and reduce class count accordingly:src/util/classify.jsDHIS2-3156: Allow setting of numeric precision in automatic map legends
JIRA ticket: DHIS2-3156
Test map:
Details
+ Changes:
+ Code:
SelectFieldin the classification panel:src/components/classification/Classification.jsxSelectFieldin the single-color panel:src/components/classification/SingleColor.jsxlegendDecimalPlacesaction and reducer:src/actions/layerEdit.jssrc/util/classify.jssrc/util/numbers.js,src/util/helpers.jssrc/loaders/thematicLoader.js,src/loaders/eventLoader.jssrc/components/datatable/useTableData.jssrc/util/favorites.jssrc/util/__tests__/classify.spec.jsDHIS2-237: Deal with events without coordinates
JIRA ticket: DHIS2-237
Test map: oYiqu1VidCh
Details
+ Changes:
+ Code:
src/components/edit/event/EventDialog.jsxsrc/loaders/eventLoader.jssrc/util/geojson.jssrc/components/legend/Legend.jsxsrc/components/datatable/useTableData.jscountEventsWithoutCoordinatesfrom saved map config:src/util/event.jssrc/util/favorites.jssrc/components/datatable/__tests__/useTableData.spec.jsxOthers
Details
src/loaders/thematicLoader.jssrc/util/legend.jsgetLegendItemsto also returnvalueFormat:src/util/classify.jsgetAutomaticLegendItemsto also returnvalueFormat:src/util/legend.jsvalueFormatthrough:src/loaders/thematicLoader.jsvalueFormatingetLegendItemForValue:src/util/classify.jssrc/util/__tests__/classify.spec.js,src/util/__tests__/legend.spec.jsQuality checklist
Add N/A to items that are not applicable.