@sis-cc/dotstatsuite-components 22.5.0 → 23.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/index.js +4 -5
- package/dist/_virtual/index.js.map +1 -1
- package/dist/_virtual/index2.js +4 -5
- package/dist/_virtual/index2.js.map +1 -1
- package/dist/_virtual/index3.js +4 -4
- package/dist/_virtual/index4.js +2 -6
- package/dist/_virtual/index4.js.map +1 -1
- package/dist/_virtual/index5.js +3 -5
- package/dist/_virtual/index5.js.map +1 -1
- package/dist/_virtual/index6.js +2 -6
- package/dist/_virtual/index6.js.map +1 -1
- package/dist/_virtual/index7.js +2 -6
- package/dist/_virtual/index7.js.map +1 -1
- package/dist/bridge-d3-react/src/index.js +1 -2
- package/dist/bridge-d3-react/src/index.js.map +1 -1
- package/dist/node_modules/@mui/styles/StylesProvider/StylesProvider.js +1 -1
- package/dist/node_modules/@mui/system/colorManipulator.js +2 -2
- package/dist/node_modules/@mui/system/esm/responsivePropType.js +1 -1
- package/dist/node_modules/@mui/utils/esm/getDisplayName/getDisplayName.js +1 -1
- package/dist/node_modules/@mui/utils/node_modules/react-is/index.js +1 -1
- package/dist/node_modules/date-fns/esm/_lib/defaultOptions/index.js +7 -0
- package/dist/node_modules/date-fns/esm/_lib/defaultOptions/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/_lib/isSameUTCWeek/index.js +12 -0
- package/dist/node_modules/date-fns/esm/_lib/isSameUTCWeek/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/_lib/requiredArgs/index.js +8 -0
- package/dist/node_modules/date-fns/esm/_lib/requiredArgs/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/_lib/startOfUTCWeek/index.js +25 -0
- package/dist/node_modules/date-fns/esm/_lib/startOfUTCWeek/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/_lib/toInteger/index.js +13 -0
- package/dist/node_modules/date-fns/esm/_lib/toInteger/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/getISOWeek/index.js +39 -0
- package/dist/node_modules/date-fns/esm/getISOWeek/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/getISOWeekYear/index.js +47 -0
- package/dist/node_modules/date-fns/esm/getISOWeekYear/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/getTime/index.js +29 -0
- package/dist/node_modules/date-fns/esm/getTime/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/isFriday/index.js +27 -0
- package/dist/node_modules/date-fns/esm/isFriday/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/isMonday/index.js +27 -0
- package/dist/node_modules/date-fns/esm/isMonday/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/isSaturday/index.js +27 -0
- package/dist/node_modules/date-fns/esm/isSaturday/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/isSunday/index.js +27 -0
- package/dist/node_modules/date-fns/esm/isSunday/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/isThursday/index.js +27 -0
- package/dist/node_modules/date-fns/esm/isThursday/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/isTuesday/index.js +27 -0
- package/dist/node_modules/date-fns/esm/isTuesday/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/isWednesday/index.js +27 -0
- package/dist/node_modules/date-fns/esm/isWednesday/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/locale/_lib/buildFormatLongFn/index.js +12 -0
- package/dist/node_modules/date-fns/esm/locale/_lib/buildFormatLongFn/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/locale/_lib/buildLocalizeFn/index.js +21 -0
- package/dist/node_modules/date-fns/esm/locale/_lib/buildLocalizeFn/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/locale/_lib/buildMatchFn/index.js +45 -0
- package/dist/node_modules/date-fns/esm/locale/_lib/buildMatchFn/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/locale/_lib/buildMatchPatternFn/index.js +20 -0
- package/dist/node_modules/date-fns/esm/locale/_lib/buildMatchPatternFn/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/locale/ar/_lib/formatDistance/index.js +119 -0
- package/dist/node_modules/date-fns/esm/locale/ar/_lib/formatDistance/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/locale/ar/_lib/formatLong/index.js +37 -0
- package/dist/node_modules/date-fns/esm/locale/ar/_lib/formatLong/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/locale/ar/_lib/formatRelative/index.js +14 -0
- package/dist/node_modules/date-fns/esm/locale/ar/_lib/formatRelative/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/locale/ar/_lib/localize/index.js +121 -0
- package/dist/node_modules/date-fns/esm/locale/ar/_lib/localize/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/locale/ar/_lib/match/index.js +102 -0
- package/dist/node_modules/date-fns/esm/locale/ar/_lib/match/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/locale/ar/index.js +30 -0
- package/dist/node_modules/date-fns/esm/locale/ar/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/locale/de/_lib/formatDistance/index.js +178 -0
- package/dist/node_modules/date-fns/esm/locale/de/_lib/formatDistance/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/locale/de/_lib/formatLong/index.js +42 -0
- package/dist/node_modules/date-fns/esm/locale/de/_lib/formatLong/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/locale/de/_lib/formatRelative/index.js +14 -0
- package/dist/node_modules/date-fns/esm/locale/de/_lib/formatRelative/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/locale/de/_lib/localize/index.js +137 -0
- package/dist/node_modules/date-fns/esm/locale/de/_lib/localize/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/locale/de/_lib/match/index.js +103 -0
- package/dist/node_modules/date-fns/esm/locale/de/_lib/match/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/locale/de/index.js +33 -0
- package/dist/node_modules/date-fns/esm/locale/de/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/locale/en-US/_lib/formatDistance/index.js +85 -0
- package/dist/node_modules/date-fns/esm/locale/en-US/_lib/formatDistance/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/locale/en-US/_lib/formatLong/index.js +37 -0
- package/dist/node_modules/date-fns/esm/locale/en-US/_lib/formatLong/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/locale/en-US/_lib/formatRelative/index.js +14 -0
- package/dist/node_modules/date-fns/esm/locale/en-US/_lib/formatRelative/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/locale/en-US/_lib/localize/index.js +146 -0
- package/dist/node_modules/date-fns/esm/locale/en-US/_lib/localize/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/locale/en-US/_lib/match/index.js +101 -0
- package/dist/node_modules/date-fns/esm/locale/en-US/_lib/match/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/locale/en-US/index.js +30 -0
- package/dist/node_modules/date-fns/esm/locale/en-US/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/locale/es/_lib/formatDistance/index.js +85 -0
- package/dist/node_modules/date-fns/esm/locale/es/_lib/formatDistance/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/locale/es/_lib/formatLong/index.js +37 -0
- package/dist/node_modules/date-fns/esm/locale/es/_lib/formatLong/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/locale/es/_lib/formatRelative/index.js +26 -0
- package/dist/node_modules/date-fns/esm/locale/es/_lib/formatRelative/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/locale/es/_lib/localize/index.js +122 -0
- package/dist/node_modules/date-fns/esm/locale/es/_lib/localize/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/locale/es/_lib/match/index.js +102 -0
- package/dist/node_modules/date-fns/esm/locale/es/_lib/match/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/locale/es/index.js +33 -0
- package/dist/node_modules/date-fns/esm/locale/es/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/locale/fr/_lib/formatDistance/index.js +85 -0
- package/dist/node_modules/date-fns/esm/locale/fr/_lib/formatDistance/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/locale/fr/_lib/formatLong/index.js +37 -0
- package/dist/node_modules/date-fns/esm/locale/fr/_lib/formatLong/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/locale/fr/_lib/formatRelative/index.js +14 -0
- package/dist/node_modules/date-fns/esm/locale/fr/_lib/formatRelative/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/locale/fr/_lib/localize/index.js +97 -0
- package/dist/node_modules/date-fns/esm/locale/fr/_lib/localize/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/locale/fr/_lib/match/index.js +101 -0
- package/dist/node_modules/date-fns/esm/locale/fr/_lib/match/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/locale/fr/index.js +30 -0
- package/dist/node_modules/date-fns/esm/locale/fr/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/locale/it/_lib/formatDistance/index.js +85 -0
- package/dist/node_modules/date-fns/esm/locale/it/_lib/formatDistance/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/locale/it/_lib/formatLong/index.js +37 -0
- package/dist/node_modules/date-fns/esm/locale/it/_lib/formatLong/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/locale/it/_lib/formatRelative/index.js +54 -0
- package/dist/node_modules/date-fns/esm/locale/it/_lib/formatRelative/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/locale/it/_lib/localize/index.js +122 -0
- package/dist/node_modules/date-fns/esm/locale/it/_lib/localize/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/locale/it/_lib/match/index.js +101 -0
- package/dist/node_modules/date-fns/esm/locale/it/_lib/match/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/locale/it/index.js +31 -0
- package/dist/node_modules/date-fns/esm/locale/it/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/locale/nl/_lib/formatDistance/index.js +85 -0
- package/dist/node_modules/date-fns/esm/locale/nl/_lib/formatDistance/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/locale/nl/_lib/formatLong/index.js +37 -0
- package/dist/node_modules/date-fns/esm/locale/nl/_lib/formatLong/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/locale/nl/_lib/formatRelative/index.js +14 -0
- package/dist/node_modules/date-fns/esm/locale/nl/_lib/formatRelative/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/locale/nl/_lib/localize/index.js +88 -0
- package/dist/node_modules/date-fns/esm/locale/nl/_lib/localize/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/locale/nl/_lib/match/index.js +100 -0
- package/dist/node_modules/date-fns/esm/locale/nl/_lib/match/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/locale/nl/index.js +34 -0
- package/dist/node_modules/date-fns/esm/locale/nl/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/locale/th/_lib/formatDistance/index.js +89 -0
- package/dist/node_modules/date-fns/esm/locale/th/_lib/formatDistance/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/locale/th/_lib/formatLong/index.js +37 -0
- package/dist/node_modules/date-fns/esm/locale/th/_lib/formatLong/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/locale/th/_lib/formatRelative/index.js +14 -0
- package/dist/node_modules/date-fns/esm/locale/th/_lib/formatRelative/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/locale/th/_lib/localize/index.js +121 -0
- package/dist/node_modules/date-fns/esm/locale/th/_lib/localize/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/locale/th/_lib/match/index.js +100 -0
- package/dist/node_modules/date-fns/esm/locale/th/_lib/match/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/locale/th/index.js +31 -0
- package/dist/node_modules/date-fns/esm/locale/th/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/startOfISOWeek/index.js +32 -0
- package/dist/node_modules/date-fns/esm/startOfISOWeek/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/startOfISOWeekYear/index.js +37 -0
- package/dist/node_modules/date-fns/esm/startOfISOWeekYear/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/startOfWeek/index.js +52 -0
- package/dist/node_modules/date-fns/esm/startOfWeek/index.js.map +1 -0
- package/dist/node_modules/date-fns/esm/toDate/index.js +56 -0
- package/dist/node_modules/date-fns/esm/toDate/index.js.map +1 -0
- package/dist/node_modules/prop-types/index.js +1 -1
- package/dist/node_modules/react-is/index.js +1 -1
- package/dist/rules/src/chart/getAxisOptions.js +22 -22
- package/dist/rules/src/chart/getAxisOptions.js.map +1 -1
- package/dist/rules/src/chart/getChartOptions.js +1 -1
- package/dist/rules/src/chart/getChartOptions.js.map +1 -1
- package/dist/rules/src/constants.js +1 -35
- package/dist/rules/src/constants.js.map +1 -1
- package/dist/rules/src/date.js +40 -40
- package/dist/rules/src/date.js.map +1 -1
- package/dist/rules/src/dimension-utils.js +26 -24
- package/dist/rules/src/dimension-utils.js.map +1 -1
- package/dist/rules/src/factories/choro-series.js +43 -32
- package/dist/rules/src/factories/choro-series.js.map +1 -1
- package/dist/rules/src/factories/focus.js +20 -0
- package/dist/rules/src/factories/focus.js.map +1 -0
- package/dist/rules/src/factories/getChartSeries.js +11 -0
- package/dist/rules/src/factories/getChartSeries.js.map +1 -0
- package/dist/rules/src/factories/sample-focus.js +14 -18
- package/dist/rules/src/factories/sample-focus.js.map +1 -1
- package/dist/rules/src/factories/sample-series.js +20 -20
- package/dist/rules/src/factories/sample-series.js.map +1 -1
- package/dist/rules/src/factories/scatter-focus.js +21 -35
- package/dist/rules/src/factories/scatter-focus.js.map +1 -1
- package/dist/rules/src/factories/scatter-series.js +5 -5
- package/dist/rules/src/factories/scatter-series.js.map +1 -1
- package/dist/rules/src/factories/series.js +48 -0
- package/dist/rules/src/factories/series.js.map +1 -0
- package/dist/rules/src/factories/stacked-series.js +6 -7
- package/dist/rules/src/factories/stacked-series.js.map +1 -1
- package/dist/rules/src/factories/symbol-series.js +39 -46
- package/dist/rules/src/factories/symbol-series.js.map +1 -1
- package/dist/rules/src/factories/timeline-focus.js +10 -14
- package/dist/rules/src/factories/timeline-focus.js.map +1 -1
- package/dist/rules/src/factories/timeline-series.js +37 -41
- package/dist/rules/src/factories/timeline-series.js.map +1 -1
- package/dist/rules/src/get-values-enhanced.js +8 -2
- package/dist/rules/src/get-values-enhanced.js.map +1 -1
- package/dist/rules/src/index.js +6 -371
- package/dist/rules/src/index.js.map +1 -1
- package/dist/rules/src/layout.js +4 -2
- package/dist/rules/src/layout.js.map +1 -1
- package/dist/rules/src/observation-formater.js +8 -14
- package/dist/rules/src/observation-formater.js.map +1 -1
- package/dist/rules/src/properties/focus.js +51 -3
- package/dist/rules/src/properties/focus.js.map +1 -1
- package/dist/rules/src/properties/getHeaderProps.js +2 -53
- package/dist/rules/src/properties/getHeaderProps.js.map +1 -1
- package/dist/rules/src/properties/index.js +3 -94
- package/dist/rules/src/properties/index.js.map +1 -1
- package/dist/rules/src/properties/linear.js +4 -4
- package/dist/rules/src/properties/linear.js.map +1 -1
- package/dist/rules/src/properties/scatter.js +4 -4
- package/dist/rules/src/properties/scatter.js.map +1 -1
- package/dist/rules/src/properties/stacked.js +5 -7
- package/dist/rules/src/properties/stacked.js.map +1 -1
- package/dist/rules/src/properties/symbol.js.map +1 -1
- package/dist/rules/src/properties/utils.js +11 -12
- package/dist/rules/src/properties/utils.js.map +1 -1
- package/dist/rules/src/sdmx-data/index.js +2 -27
- package/dist/rules/src/sdmx-data/index.js.map +1 -1
- package/dist/rules2/src/combinedValuesDisplay.js +2 -2
- package/dist/rules2/src/combinedValuesDisplay.js.map +1 -1
- package/dist/rules2/src/getAttributes.js +37 -0
- package/dist/rules2/src/getAttributes.js.map +1 -0
- package/dist/rules2/src/getDataflowTooltipAttributesIds.js +2 -2
- package/dist/rules2/src/getDataflowTooltipAttributesIds.js.map +1 -1
- package/dist/rules2/src/getHeaderCombinations.js +1 -1
- package/dist/rules2/src/getHeaderCombinations.js.map +1 -1
- package/dist/rules2/src/getHeaderSubtitle.js +1 -1
- package/dist/rules2/src/getHeaderSubtitle.js.map +1 -1
- package/dist/rules2/src/getHeaderTitle.js +1 -1
- package/dist/rules2/src/getHeaderTitle.js.map +1 -1
- package/dist/rules2/src/getMetadataCoordinates.js +1 -1
- package/dist/rules2/src/getMetadataCoordinates.js.map +1 -1
- package/dist/rules2/src/getNotDisplayedIds.js +1 -1
- package/dist/rules2/src/getNotDisplayedIds.js.map +1 -1
- package/dist/rules2/src/index.js +1 -0
- package/dist/rules2/src/index.js.map +1 -1
- package/dist/rules2/src/parseAttributes.js +2 -2
- package/dist/rules2/src/parseAttributes.js.map +1 -1
- package/dist/rules2/src/parseHierarchicalCodelist.js +1 -1
- package/dist/rules2/src/parseHierarchicalCodelist.js.map +1 -1
- package/dist/rules2/src/parseMetadataSeries.js +1 -1
- package/dist/rules2/src/parseMetadataSeries.js.map +1 -1
- package/dist/rules2/src/prepareData.js +10 -3
- package/dist/rules2/src/prepareData.js.map +1 -1
- package/dist/rules2/src/refineDimensions.js +53 -8
- package/dist/rules2/src/refineDimensions.js.map +1 -1
- package/dist/rules2/src/refineTimePeriod.js +12 -16
- package/dist/rules2/src/refineTimePeriod.js.map +1 -1
- package/dist/rules2/src/table/getCells.js +1 -1
- package/dist/rules2/src/table/getCells.js.map +1 -1
- package/dist/rules2/src/table/getLayout.js +1 -1
- package/dist/rules2/src/table/getLayout.js.map +1 -1
- package/dist/rules2/src/table/getTableLayoutIds.js +1 -1
- package/dist/rules2/src/table/getTableLayoutIds.js.map +1 -1
- package/dist/rules2/src/table/getTableProps.js +0 -1
- package/dist/rules2/src/table/getTableProps.js.map +1 -1
- package/dist/rules2/src/table/parseValueHierarchy.js.map +1 -1
- package/dist/rules2/src/table/refineLayoutSize2.js +1 -1
- package/dist/rules2/src/table/refineLayoutSize2.js.map +1 -1
- package/dist/rules2/src/utils.js.map +1 -1
- package/dist/viewer/src/chart.js +13 -2
- package/dist/viewer/src/chart.js.map +1 -1
- package/dist/viewer/src/legends/FocusLegend.js +1 -1
- package/dist/viewer/src/legends/FocusLegend.js.map +1 -1
- package/package.json +7 -6
- package/src/bridge-d3-react/src/index.js +0 -1
- package/src/rules/src/chart/getAxisOptions.js +33 -21
- package/src/rules/src/chart/getChartOptions.js +2 -2
- package/src/rules/src/constants.js +0 -35
- package/src/rules/src/date.js +6 -12
- package/src/rules/src/dimension-utils.js +25 -23
- package/src/rules/src/factories/choro-series.js +41 -30
- package/src/rules/src/factories/focus.js +17 -0
- package/src/rules/src/factories/getChartSeries.js +8 -0
- package/src/rules/src/factories/sample-focus.js +14 -18
- package/src/rules/src/factories/sample-series.js +20 -20
- package/src/rules/src/factories/scatter-focus.js +22 -36
- package/src/rules/src/factories/scatter-series.js +8 -8
- package/src/rules/src/factories/series.js +45 -0
- package/src/rules/src/factories/stacked-series.js +4 -5
- package/src/rules/src/factories/symbol-series.js +37 -44
- package/src/rules/src/factories/timeline-focus.js +10 -14
- package/src/rules/src/factories/timeline-series.js +35 -39
- package/src/rules/src/get-values-enhanced.js +8 -2
- package/src/rules/src/index.js +7 -384
- package/src/rules/src/layout.js +4 -2
- package/src/rules/src/observation-formater.js +14 -20
- package/src/rules/src/properties/focus.js +50 -2
- package/src/rules/src/properties/getHeaderProps.js +1 -53
- package/src/rules/src/properties/index.js +2 -93
- package/src/rules/src/properties/linear.js +2 -2
- package/src/rules/src/properties/scatter.js +4 -4
- package/src/rules/src/properties/stacked.js +4 -6
- package/src/rules/src/properties/symbol.js +0 -1
- package/src/rules/src/properties/utils.js +11 -22
- package/src/rules/src/sdmx-data/index.js +2 -31
- package/src/rules2/src/combinedValuesDisplay.js +2 -2
- package/src/rules2/src/getAttributes.js +34 -0
- package/src/rules2/src/getDataflowTooltipAttributesIds.js +2 -2
- package/src/rules2/src/getHeaderCombinations.js +1 -1
- package/src/rules2/src/getHeaderSubtitle.js +2 -2
- package/src/rules2/src/getHeaderTitle.js +1 -1
- package/src/rules2/src/getMetadataCoordinates.js +1 -1
- package/src/rules2/src/getNotDisplayedIds.js +1 -1
- package/src/rules2/src/index.js +1 -0
- package/src/rules2/src/parseAttributes.js +2 -2
- package/src/rules2/src/parseHierarchicalCodelist.js +1 -1
- package/src/rules2/src/parseMetadataSeries.js +1 -1
- package/src/rules2/src/prepareData.js +10 -3
- package/src/rules2/src/refineDimensions.js +53 -8
- package/src/rules2/src/refineTimePeriod.js +12 -16
- package/src/rules2/src/table/getCells.js +2 -2
- package/src/rules2/src/table/getLayout.js +2 -2
- package/src/rules2/src/table/getTableLayoutIds.js +9 -9
- package/src/rules2/src/table/getTableProps.js +0 -1
- package/src/rules2/src/table/parseValueHierarchy.js +0 -7
- package/src/rules2/src/table/refineLayoutSize2.js +5 -5
- package/src/rules2/src/utils.js +0 -11
- package/src/viewer/src/app/leg.js +0 -1
- package/src/viewer/src/chart.jsx +23 -1
- package/src/viewer/src/legends/FocusLegend.jsx +1 -1
- package/dist/_virtual/index10.js +0 -8
- package/dist/_virtual/index10.js.map +0 -1
- package/dist/_virtual/index11.js +0 -8
- package/dist/_virtual/index11.js.map +0 -1
- package/dist/_virtual/index12.js +0 -8
- package/dist/_virtual/index12.js.map +0 -1
- package/dist/_virtual/index13.js +0 -8
- package/dist/_virtual/index13.js.map +0 -1
- package/dist/_virtual/index14.js +0 -8
- package/dist/_virtual/index14.js.map +0 -1
- package/dist/_virtual/index15.js +0 -8
- package/dist/_virtual/index15.js.map +0 -1
- package/dist/_virtual/index16.js +0 -8
- package/dist/_virtual/index16.js.map +0 -1
- package/dist/_virtual/index17.js +0 -7
- package/dist/_virtual/index17.js.map +0 -1
- package/dist/_virtual/index18.js +0 -7
- package/dist/_virtual/index18.js.map +0 -1
- package/dist/_virtual/index19.js +0 -8
- package/dist/_virtual/index19.js.map +0 -1
- package/dist/_virtual/index20.js +0 -4
- package/dist/_virtual/index20.js.map +0 -1
- package/dist/_virtual/index21.js +0 -6
- package/dist/_virtual/index21.js.map +0 -1
- package/dist/_virtual/index22.js +0 -4
- package/dist/_virtual/index22.js.map +0 -1
- package/dist/_virtual/index23.js +0 -4
- package/dist/_virtual/index23.js.map +0 -1
- package/dist/_virtual/index8.js +0 -8
- package/dist/_virtual/index8.js.map +0 -1
- package/dist/_virtual/index9.js +0 -8
- package/dist/_virtual/index9.js.map +0 -1
- package/dist/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds/index.js +0 -32
- package/dist/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds/index.js.map +0 -1
- package/dist/node_modules/date-fns/get_iso_week/index.js +0 -49
- package/dist/node_modules/date-fns/get_iso_week/index.js.map +0 -1
- package/dist/node_modules/date-fns/get_iso_year/index.js +0 -59
- package/dist/node_modules/date-fns/get_iso_year/index.js.map +0 -1
- package/dist/node_modules/date-fns/is_date/index.js +0 -32
- package/dist/node_modules/date-fns/is_date/index.js.map +0 -1
- package/dist/node_modules/date-fns/is_friday/index.js +0 -35
- package/dist/node_modules/date-fns/is_friday/index.js.map +0 -1
- package/dist/node_modules/date-fns/is_monday/index.js +0 -35
- package/dist/node_modules/date-fns/is_monday/index.js.map +0 -1
- package/dist/node_modules/date-fns/is_saturday/index.js +0 -35
- package/dist/node_modules/date-fns/is_saturday/index.js.map +0 -1
- package/dist/node_modules/date-fns/is_sunday/index.js +0 -35
- package/dist/node_modules/date-fns/is_sunday/index.js.map +0 -1
- package/dist/node_modules/date-fns/is_thursday/index.js +0 -35
- package/dist/node_modules/date-fns/is_thursday/index.js.map +0 -1
- package/dist/node_modules/date-fns/is_tuesday/index.js +0 -35
- package/dist/node_modules/date-fns/is_tuesday/index.js.map +0 -1
- package/dist/node_modules/date-fns/is_wednesday/index.js +0 -35
- package/dist/node_modules/date-fns/is_wednesday/index.js.map +0 -1
- package/dist/node_modules/date-fns/locale/_lib/build_formatting_tokens_reg_exp/index.js +0 -39
- package/dist/node_modules/date-fns/locale/_lib/build_formatting_tokens_reg_exp/index.js.map +0 -1
- package/dist/node_modules/date-fns/locale/ar/build_distance_in_words_locale/index.js +0 -110
- package/dist/node_modules/date-fns/locale/ar/build_distance_in_words_locale/index.js.map +0 -1
- package/dist/node_modules/date-fns/locale/ar/build_format_locale/index.js +0 -86
- package/dist/node_modules/date-fns/locale/ar/build_format_locale/index.js.map +0 -1
- package/dist/node_modules/date-fns/locale/ar/index.js +0 -26
- package/dist/node_modules/date-fns/locale/ar/index.js.map +0 -1
- package/dist/node_modules/date-fns/locale/de/build_distance_in_words_locale/index.js +0 -196
- package/dist/node_modules/date-fns/locale/de/build_distance_in_words_locale/index.js.map +0 -1
- package/dist/node_modules/date-fns/locale/de/build_format_locale/index.js +0 -90
- package/dist/node_modules/date-fns/locale/de/build_format_locale/index.js.map +0 -1
- package/dist/node_modules/date-fns/locale/de/index.js +0 -27
- package/dist/node_modules/date-fns/locale/de/index.js.map +0 -1
- package/dist/node_modules/date-fns/locale/en/build_distance_in_words_locale/index.js +0 -110
- package/dist/node_modules/date-fns/locale/en/build_distance_in_words_locale/index.js.map +0 -1
- package/dist/node_modules/date-fns/locale/en/build_format_locale/index.js +0 -101
- package/dist/node_modules/date-fns/locale/en/build_format_locale/index.js.map +0 -1
- package/dist/node_modules/date-fns/locale/en/index.js +0 -25
- package/dist/node_modules/date-fns/locale/en/index.js.map +0 -1
- package/dist/node_modules/date-fns/locale/es/build_distance_in_words_locale/index.js +0 -110
- package/dist/node_modules/date-fns/locale/es/build_distance_in_words_locale/index.js.map +0 -1
- package/dist/node_modules/date-fns/locale/es/build_format_locale/index.js +0 -86
- package/dist/node_modules/date-fns/locale/es/build_format_locale/index.js.map +0 -1
- package/dist/node_modules/date-fns/locale/es/index.js +0 -28
- package/dist/node_modules/date-fns/locale/es/index.js.map +0 -1
- package/dist/node_modules/date-fns/locale/fr/build_distance_in_words_locale/index.js +0 -110
- package/dist/node_modules/date-fns/locale/fr/build_distance_in_words_locale/index.js.map +0 -1
- package/dist/node_modules/date-fns/locale/fr/build_format_locale/index.js +0 -135
- package/dist/node_modules/date-fns/locale/fr/build_format_locale/index.js.map +0 -1
- package/dist/node_modules/date-fns/locale/fr/index.js +0 -27
- package/dist/node_modules/date-fns/locale/fr/index.js.map +0 -1
- package/dist/node_modules/date-fns/locale/it/build_distance_in_words_locale/index.js +0 -110
- package/dist/node_modules/date-fns/locale/it/build_distance_in_words_locale/index.js.map +0 -1
- package/dist/node_modules/date-fns/locale/it/build_format_locale/index.js +0 -86
- package/dist/node_modules/date-fns/locale/it/build_format_locale/index.js.map +0 -1
- package/dist/node_modules/date-fns/locale/it/index.js +0 -26
- package/dist/node_modules/date-fns/locale/it/index.js.map +0 -1
- package/dist/node_modules/date-fns/locale/nl/build_distance_in_words_locale/index.js +0 -110
- package/dist/node_modules/date-fns/locale/nl/build_distance_in_words_locale/index.js.map +0 -1
- package/dist/node_modules/date-fns/locale/nl/build_format_locale/index.js +0 -86
- package/dist/node_modules/date-fns/locale/nl/build_format_locale/index.js.map +0 -1
- package/dist/node_modules/date-fns/locale/nl/index.js +0 -27
- package/dist/node_modules/date-fns/locale/nl/index.js.map +0 -1
- package/dist/node_modules/date-fns/locale/th/build_distance_in_words_locale/index.js +0 -114
- package/dist/node_modules/date-fns/locale/th/build_distance_in_words_locale/index.js.map +0 -1
- package/dist/node_modules/date-fns/locale/th/build_format_locale/index.js +0 -74
- package/dist/node_modules/date-fns/locale/th/build_format_locale/index.js.map +0 -1
- package/dist/node_modules/date-fns/locale/th/index.js +0 -26
- package/dist/node_modules/date-fns/locale/th/index.js.map +0 -1
- package/dist/node_modules/date-fns/parse/index.js +0 -346
- package/dist/node_modules/date-fns/parse/index.js.map +0 -1
- package/dist/node_modules/date-fns/start_of_iso_week/index.js +0 -38
- package/dist/node_modules/date-fns/start_of_iso_week/index.js.map +0 -1
- package/dist/node_modules/date-fns/start_of_iso_year/index.js +0 -46
- package/dist/node_modules/date-fns/start_of_iso_year/index.js.map +0 -1
- package/dist/node_modules/date-fns/start_of_week/index.js +0 -51
- package/dist/node_modules/date-fns/start_of_week/index.js.map +0 -1
- package/dist/rules/src/factories/scatter-dimension.js +0 -35
- package/dist/rules/src/factories/scatter-dimension.js.map +0 -1
- package/dist/rules/src/factories/stacked-dimension.js +0 -32
- package/dist/rules/src/factories/stacked-dimension.js.map +0 -1
- package/dist/rules/src/factories/symbol-dimension.js +0 -32
- package/dist/rules/src/factories/symbol-dimension.js.map +0 -1
- package/dist/rules/src/header/getDefaultSubtitle.js +0 -44
- package/dist/rules/src/header/getDefaultSubtitle.js.map +0 -1
- package/dist/rules/src/header/getHeaderUnits.js +0 -21
- package/dist/rules/src/header/getHeaderUnits.js.map +0 -1
- package/dist/rules/src/header/getSubtitleFlags.js +0 -47
- package/dist/rules/src/header/getSubtitleFlags.js.map +0 -1
- package/dist/rules/src/header/getTitleFlags.js +0 -12
- package/dist/rules/src/header/getTitleFlags.js.map +0 -1
- package/dist/rules/src/properties/errors.js +0 -22
- package/dist/rules/src/properties/errors.js.map +0 -1
- package/dist/rules/src/properties/getInformationsStateFromNewProps.js +0 -50
- package/dist/rules/src/properties/getInformationsStateFromNewProps.js.map +0 -1
- package/dist/rules/src/v8-transformer.js +0 -174
- package/dist/rules/src/v8-transformer.js.map +0 -1
- package/src/bridge-d3-react/src/app.js +0 -64
- package/src/bridge-d3-react/src/mock-choro.js +0 -394
- package/src/rules/src/factories/scatter-dimension.js +0 -32
- package/src/rules/src/factories/stacked-dimension.js +0 -29
- package/src/rules/src/factories/symbol-dimension.js +0 -29
- package/src/rules/src/header/getDefaultSubtitle.js +0 -40
- package/src/rules/src/header/getHeaderUnits.js +0 -17
- package/src/rules/src/header/getSubtitleFlags.js +0 -43
- package/src/rules/src/header/getTitleFlags.js +0 -8
- package/src/rules/src/header/index.js +0 -4
- package/src/rules/src/preparators/enhanceObservations.js +0 -152
- package/src/rules/src/properties/errors.js +0 -19
- package/src/rules/src/properties/getInformationsStateFromNewProps.js +0 -47
- package/src/rules/src/properties/information.js +0 -84
- package/src/rules/src/v8-transformer.js +0 -177
- package/src/rules2/src/getAdvAttrSeriesAtCoordinates.js +0 -29
- package/src/rules2/src/getMetadataStructureFromData.js +0 -17
- package/src/rules2/src/refineMetadataCoordinates.js +0 -28
- package/src/rules2/src/table/getCombinationDimensionsData.js +0 -39
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as R from 'ramda';
|
|
2
2
|
import { getTimePeriodDimension } from '@sis-cc/dotstatsuite-sdmxjs';
|
|
3
3
|
import { categoryDisplay, dimensionValueDisplayAt } from '../dimension-utils';
|
|
4
4
|
import { getFormatedObservation } from '../observation-formater';
|
|
5
5
|
|
|
6
6
|
const getDimensionValues = (splitObservationKey, dimensions, dimensionsWithValuesIndexedById, rejectedId, display) => (
|
|
7
|
-
reduce(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
R.addIndex(R.reduce)(
|
|
8
|
+
(acc, dimensionValueIndex, dimensionIndex) => {
|
|
9
|
+
const dimension = R.nth(dimensionIndex, dimensions) || {};
|
|
10
|
+
if (R.has(dimension.id, dimensionsWithValuesIndexedById) && dimension.id !== rejectedId) {
|
|
11
|
+
const dimensionValue = R.pathOr({}, ['values', dimensionValueIndex], dimension);
|
|
12
|
+
return R.set(
|
|
13
|
+
R.lensPath([dimensionValue.id, 'name']),
|
|
14
|
+
dimensionValueDisplayAt(dimension, dimensionValueIndex, display),
|
|
15
|
+
acc
|
|
16
|
+
);
|
|
17
17
|
}
|
|
18
|
-
return
|
|
18
|
+
return acc;
|
|
19
19
|
},
|
|
20
|
-
{}
|
|
20
|
+
{},
|
|
21
|
+
splitObservationKey,
|
|
21
22
|
)
|
|
22
23
|
);
|
|
23
24
|
|
|
@@ -27,24 +28,23 @@ const series = (
|
|
|
27
28
|
timePeriodDimensionIndex,
|
|
28
29
|
display, formaterAttrs
|
|
29
30
|
) => {
|
|
30
|
-
const rawSeries = reduce(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const oDimensionValuesIndexes = split(
|
|
31
|
+
const rawSeries = R.reduce(
|
|
32
|
+
(acc, k) => {
|
|
33
|
+
const o = observations[k];
|
|
34
|
+
const oDimensionValuesIndexes = R.split(':', k);
|
|
34
35
|
|
|
35
|
-
const timePeriodDimension =
|
|
36
|
-
const timePeriodDimensionValueIndex = oDimensionValuesIndexes
|
|
37
|
-
const timePeriod =
|
|
36
|
+
const timePeriodDimension = R.nth(timePeriodDimensionIndex, dimensions);
|
|
37
|
+
const timePeriodDimensionValueIndex = R.nth(timePeriodDimensionIndex, oDimensionValuesIndexes);
|
|
38
|
+
const timePeriod = R.path(['values', timePeriodDimensionValueIndex], timePeriodDimension);
|
|
38
39
|
|
|
39
40
|
const datapoint = {
|
|
40
41
|
x: timePeriod.start,
|
|
41
|
-
y: head(o),
|
|
42
|
+
y: R.head(o),
|
|
42
43
|
timeLabel: timePeriod.name,
|
|
43
44
|
formatedValue: getFormatedObservation(o, formaterAttrs),
|
|
44
45
|
dimensionValues: getDimensionValues(
|
|
45
46
|
oDimensionValuesIndexes, dimensions, dimensionsWithValuesIndexedById, timePeriodDimension.id, display
|
|
46
47
|
),
|
|
47
|
-
//index: Number(timePeriodDimensionValueIndex)
|
|
48
48
|
};
|
|
49
49
|
|
|
50
50
|
const category = categoryDisplay(
|
|
@@ -53,35 +53,31 @@ const series = (
|
|
|
53
53
|
let key = categoryDisplay(
|
|
54
54
|
oDimensionValuesIndexes, dimensions, dimensionsWithValuesIndexedById, timePeriodDimension.id, 'code'
|
|
55
55
|
);
|
|
56
|
-
if (isNil(key) || isEmpty(key)) {
|
|
56
|
+
if (R.isNil(key) || R.isEmpty(key)) {
|
|
57
57
|
key = 'uniq-dp';
|
|
58
58
|
}
|
|
59
|
-
const serieIndex = findIndex(
|
|
59
|
+
const serieIndex = R.findIndex(serie => serie.key === key, acc);
|
|
60
60
|
|
|
61
|
-
if (serieIndex !== -1)
|
|
62
|
-
|
|
61
|
+
if (serieIndex !== -1)
|
|
62
|
+
return R.over(R.lensPath([serieIndex, 'datapoints']), R.append(datapoint), acc);
|
|
63
63
|
|
|
64
|
-
return
|
|
64
|
+
return R.append({ datapoints: [datapoint], category, key }, acc);
|
|
65
65
|
},
|
|
66
|
-
[]
|
|
66
|
+
[],
|
|
67
|
+
R.keys(observations),
|
|
67
68
|
);
|
|
68
|
-
return map(
|
|
69
|
+
return R.map(
|
|
70
|
+
serie => ({ ...serie, datapoints: R.sortBy(R.prop('x'), serie.datapoints) }),
|
|
69
71
|
rawSeries,
|
|
70
|
-
serie => ({
|
|
71
|
-
...serie,
|
|
72
|
-
datapoints: sortBy(
|
|
73
|
-
serie.datapoints,
|
|
74
|
-
datapoint => datapoint.x
|
|
75
|
-
)
|
|
76
|
-
})
|
|
77
72
|
);
|
|
78
73
|
};
|
|
79
74
|
|
|
80
75
|
export default ({ observations, dimensions }, dimensionsWithValuesIndexedById, display, formaterAttrs) => {
|
|
81
76
|
const timePeriodDimension = getTimePeriodDimension({ dimensions });
|
|
82
|
-
const timePeriodDimensionIndex = timePeriodDimension ? timePeriodDimension.
|
|
83
|
-
const timePeriodDimensionHasManyPeriods = !has(
|
|
84
|
-
if ((timePeriodDimensionIndex === -1) || timePeriodDimensionHasManyPeriods)
|
|
77
|
+
const timePeriodDimensionIndex = timePeriodDimension ? timePeriodDimension.__index : -1;
|
|
78
|
+
const timePeriodDimensionHasManyPeriods = !R.has(R.prop('id', timePeriodDimension), dimensionsWithValuesIndexedById);
|
|
79
|
+
if (!timePeriodDimensionIndex || (timePeriodDimensionIndex === -1) || timePeriodDimensionHasManyPeriods)
|
|
80
|
+
return [];
|
|
85
81
|
|
|
86
82
|
return series(
|
|
87
83
|
observations, dimensions,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as R from 'ramda';
|
|
2
|
-
import
|
|
2
|
+
import getTime from 'date-fns/getTime'
|
|
3
3
|
import { getCodeOrder } from '@sis-cc/dotstatsuite-sdmxjs';
|
|
4
4
|
import { getIsHidden } from './sdmx-data';
|
|
5
5
|
import {
|
|
@@ -42,7 +42,9 @@ export const getValuesEnhanced = ({
|
|
|
42
42
|
reportYearStart,
|
|
43
43
|
hiddenIds = {},
|
|
44
44
|
options = {},
|
|
45
|
+
selection = []
|
|
45
46
|
}) => {
|
|
47
|
+
const selectionSet = new Set(selection);
|
|
46
48
|
return R.pipe(
|
|
47
49
|
R.addIndex(R.map)((value, __index) => {
|
|
48
50
|
const id = getId(value, `${parent}-${__index}`);
|
|
@@ -63,12 +65,16 @@ export const getValuesEnhanced = ({
|
|
|
63
65
|
if (isNaN(__indexPosition)) {
|
|
64
66
|
__indexPosition = getCodeOrder({ annotations: valueAnnotations });
|
|
65
67
|
}
|
|
68
|
+
const isSelected = selectionSet.has(value.id) || R.isNil(selection)
|
|
69
|
+
|| R.isEmpty(selection) || R.isEmpty(R.head(selection));
|
|
66
70
|
let res = {
|
|
67
71
|
// names is explicitely skipped because of metadata "standard"
|
|
68
72
|
// not completely aligned with NSI "standard"
|
|
69
73
|
// value is explicitely skipped (non-coded) into id
|
|
70
74
|
...R.omit(['names', 'value'], value),
|
|
71
75
|
id,
|
|
76
|
+
isSelected,
|
|
77
|
+
empty: !isSelected,
|
|
72
78
|
display: !isHidden,
|
|
73
79
|
start: start ? start.toISOString() : null,
|
|
74
80
|
flags: notes,
|
|
@@ -102,7 +108,7 @@ export const getValuesEnhanced = ({
|
|
|
102
108
|
);
|
|
103
109
|
};
|
|
104
110
|
|
|
105
|
-
const getDateForSort = (key) => (val) =>
|
|
111
|
+
const getDateForSort = (key) => (val) => getTime(new Date(R.prop(key, val)));
|
|
106
112
|
const byStartDate = R.ascend(getDateForSort('start'));
|
|
107
113
|
const byEndDate = R.descend(getDateForSort('end'));
|
|
108
114
|
const timeDimensionSorts = [byStartDate, byEndDate];
|
package/src/rules/src/index.js
CHANGED
|
@@ -1,400 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
get, partition, reject, isEmpty, map, compact, size, keyBy, pick, omit, isNil, flatten, reduce,
|
|
3
|
-
filter, find, includes, isArray, findIndex, isEqual
|
|
4
|
-
} from 'lodash';
|
|
5
|
-
import * as R from 'ramda';
|
|
6
|
-
import memoizee from 'memoizee';
|
|
7
|
-
import __sampleSeries from './factories/sample-series';
|
|
8
|
-
import __sampleFocus from './factories/sample-focus';
|
|
9
|
-
import __scatterSeries from './factories/scatter-series';
|
|
10
|
-
import __scatterFocus from './factories/scatter-focus';
|
|
11
|
-
import __scatterDimension from './factories/scatter-dimension';
|
|
12
|
-
import __symbolSeries from './factories/symbol-series';
|
|
13
|
-
import __symbolDimension from './factories/symbol-dimension';
|
|
14
|
-
import __timelineSeries from './factories/timeline-series';
|
|
15
|
-
import __timelineFocus from './factories/timeline-focus';
|
|
16
|
-
import __stackedSeries from './factories/stacked-series';
|
|
17
|
-
import __stackedDimension from './factories/stacked-dimension';
|
|
18
|
-
import __choroSeries from './factories/choro-series';
|
|
19
|
-
import {
|
|
20
|
-
DEFAULT_UPR_IDS, DEFAULT_REJECTED_UPR_VALUES_IDS, DEFAULT_REJECTED_SUBTITLE_IDS,
|
|
21
|
-
FREQ_A, FREQ_Q, FREQ_M
|
|
22
|
-
} from './constants';
|
|
23
|
-
import { dimensionValueDisplay } from './dimension-utils';
|
|
24
|
-
import { getObservationsFormaterAttributes } from './observation-formater';
|
|
25
|
-
|
|
26
|
-
export const freqA = FREQ_A;
|
|
27
|
-
export const freqQ = FREQ_Q;
|
|
28
|
-
export const freqM = FREQ_M;
|
|
29
|
-
|
|
30
|
-
// --------------------------------------------------------------------------------extractSdmxErrors
|
|
31
|
-
const _extractSdmxErrors = (data) => R.compose(
|
|
32
|
-
(errors) => map(errors, (error) => ({ label: error.code, description: error.message })),
|
|
33
|
-
(data) => get(data, 'errors', [])
|
|
34
|
-
);
|
|
35
|
-
export const extractSdmxErrors = memoizee(_extractSdmxErrors);
|
|
36
|
-
|
|
37
|
-
export const extractDataName = (data) => R.pathOr(null, ['structure', 'name'], data);
|
|
38
|
-
|
|
39
|
-
// -----------------------------------------------------------------------------extractSdmxArtefacts
|
|
40
|
-
const _extractSdmxArtefacts = (data) => {
|
|
41
|
-
const parseStructure = (data) => get(data, 'structure', {});
|
|
42
|
-
const parseItem = (item) => parseComponents(get(item, 'observation', []));
|
|
43
|
-
const parseDimensions = (structure) => parseItem(get(structure, 'dimensions', {}));
|
|
44
|
-
const parseAttributes = (structure) => parseItem(get(structure, 'attributes', {}));
|
|
45
|
-
const parseComponents = (components) => map(components, parseComponent);
|
|
46
|
-
const parseComponent = (component, index) => {
|
|
47
|
-
let parsed = { ...pick(component, 'id', 'name', 'values', 'role', 'isHidden'), index };
|
|
48
|
-
if (isEmpty(parsed))
|
|
49
|
-
return parsed;
|
|
50
|
-
if (isNil(parsed.role))
|
|
51
|
-
parsed.role = parsed.id;
|
|
52
|
-
parsed.values = R.sortBy(R.prop('__index'))(parsed.values);
|
|
53
|
-
return parsed;
|
|
54
|
-
};
|
|
55
|
-
const parseDatasetItem = (item) => parseComponents(get(item, 'dataSet', []));
|
|
56
|
-
const parseDatasetAttributes = (structure) => parseDatasetItem(get(structure, 'attributes', {}));
|
|
57
|
-
|
|
58
|
-
return {
|
|
59
|
-
attributes: parseAttributes(parseStructure(data)),
|
|
60
|
-
datasetAttributes: parseDatasetAttributes(parseStructure(data)),
|
|
61
|
-
dimensions: parseDimensions(parseStructure(data)),
|
|
62
|
-
id: get(data, 'header.id', null),
|
|
63
|
-
name: extractDataName(data),
|
|
64
|
-
observations: R.pipe(
|
|
65
|
-
R.pathOr({}, ['dataSets', 0, 'observations']),
|
|
66
|
-
R.mapObjIndexed(obs => R.over(R.lensIndex(0), val => R.isNil(val) ? null : Number(val))(obs)),
|
|
67
|
-
R.reject(R.pipe(R.head, R.anyPass([R.isNil, isNaN]))),
|
|
68
|
-
)(data),
|
|
69
|
-
source: get(data, 'header.links[0].href', null),
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
|
-
export const extractSdmxArtefacts = memoizee(_extractSdmxArtefacts);
|
|
73
|
-
|
|
74
|
-
const _getRelevantsDatasetAttributes = (data) => {
|
|
75
|
-
const { datasetAttributes } = extractSdmxArtefacts(data);
|
|
76
|
-
return filter(datasetAttributes, attr => size(attr.values) === 1);
|
|
77
|
-
};
|
|
78
|
-
export const getRelevantsDatasetAttributes = memoizee(_getRelevantsDatasetAttributes);
|
|
79
|
-
|
|
80
|
-
// -------------------------------------------------------------------------------getDimensionValues
|
|
81
|
-
export const getDimensionValues = (dimension) => get(dimension, 'values', []);
|
|
82
|
-
|
|
83
|
-
// ----------------------------------------------------------------------------------splitDimensions
|
|
84
|
-
const _splitDimensions = (data) => {
|
|
85
|
-
const { dimensions } = extractSdmxArtefacts(data);
|
|
86
|
-
const [value, values] = partition(
|
|
87
|
-
reject(dimensions, R.compose(isEmpty, getDimensionValues)),
|
|
88
|
-
R.compose((values) => size(values) === 1, getDimensionValues)
|
|
89
|
-
);
|
|
90
|
-
return { value, values };
|
|
91
|
-
}
|
|
92
|
-
export const splitDimensions = memoizee(_splitDimensions);
|
|
93
|
-
|
|
94
|
-
// ------------------------------------------------------------------dimensionsWithValuesIndexedById
|
|
95
|
-
const _dimensionsWithValuesIndexedById = (data) => R.compose(
|
|
96
|
-
(dimensionsWithValues) => keyBy(dimensionsWithValues, 'id'),
|
|
97
|
-
(split) => split.values,
|
|
98
|
-
splitDimensions
|
|
99
|
-
)(data);
|
|
100
|
-
export const dimensionsWithValuesIndexedById = memoizee(_dimensionsWithValuesIndexedById);
|
|
101
|
-
|
|
102
|
-
// -------------------------------------------------------------------------------------parseDisplay
|
|
103
|
-
const _parseDisplay = (display) =>
|
|
104
|
-
(isNil(display) || !(includes(['both', 'code'], display)))
|
|
105
|
-
? 'label' : display;
|
|
106
|
-
export const parseDisplay = memoizee(_parseDisplay);
|
|
107
|
-
|
|
108
|
-
// -------------------------------------------------------------------------------------sampleSeries
|
|
109
|
-
const _sampleSeries = (data, type, display, formaterIds) => __sampleSeries(
|
|
110
|
-
type,
|
|
111
|
-
extractSdmxArtefacts(data),
|
|
112
|
-
dimensionsWithValuesIndexedById(data),
|
|
113
|
-
parseDisplay(display),
|
|
114
|
-
getObservationsFormaterAttributes(data, formaterIds)
|
|
115
|
-
);
|
|
116
|
-
export const sampleSeries = memoizee(_sampleSeries);
|
|
117
|
-
|
|
118
|
-
// ---------------------------------------------------------------------------------scatterDimension
|
|
119
|
-
const _scatterDimension = (data, ids) => {
|
|
120
|
-
const { values } = splitDimensions(data);
|
|
121
|
-
return __scatterDimension(values, ids);
|
|
122
|
-
};
|
|
123
|
-
export const scatterDimension = memoizee(_scatterDimension);
|
|
124
|
-
|
|
125
|
-
// ----------------------------------------------------------------------------------symbolDimension
|
|
126
|
-
const _symbolDimension = (data, ids) => {
|
|
127
|
-
const { values } = splitDimensions(data);
|
|
128
|
-
return __symbolDimension(values, ids);
|
|
129
|
-
};
|
|
130
|
-
export const symbolDimension = memoizee(_symbolDimension);
|
|
131
|
-
|
|
132
|
-
const _stackedDimension = (data, singularity) => {
|
|
133
|
-
return __stackedDimension(splitDimensions(data), singularity);
|
|
134
|
-
}
|
|
135
|
-
export const stackedDimension = memoizee(_stackedDimension);
|
|
136
|
-
|
|
137
|
-
// ------------------------------------------------------------------------------------scatterSeries
|
|
138
|
-
const _scatterSeries = (data, ids, display, formaterIds) => __scatterSeries(
|
|
139
|
-
extractSdmxArtefacts(data),
|
|
140
|
-
dimensionsWithValuesIndexedById(data),
|
|
141
|
-
scatterDimension(data, ids),
|
|
142
|
-
parseDisplay(display),
|
|
143
|
-
getObservationsFormaterAttributes(data, formaterIds)
|
|
144
|
-
);
|
|
145
|
-
export const scatterSeries = memoizee(_scatterSeries);
|
|
146
|
-
|
|
147
|
-
// -------------------------------------------------------------------------------------symbolSeries
|
|
148
|
-
const _symbolSeries = (data, type, ids, display, formaterIds) => __symbolSeries(
|
|
149
|
-
extractSdmxArtefacts(data),
|
|
150
|
-
type,
|
|
151
|
-
dimensionsWithValuesIndexedById(data),
|
|
152
|
-
symbolDimension(data, ids),
|
|
153
|
-
parseDisplay(display),
|
|
154
|
-
getObservationsFormaterAttributes(data, formaterIds)
|
|
155
|
-
);
|
|
156
|
-
export const symbolSeries = memoizee(_symbolSeries);
|
|
157
|
-
|
|
158
|
-
// -----------------------------------------------------------------------------------timelineSeries
|
|
159
|
-
const _timelineSeries = (data, display, formaterIds) => __timelineSeries(
|
|
160
|
-
extractSdmxArtefacts(data),
|
|
161
|
-
dimensionsWithValuesIndexedById(data),
|
|
162
|
-
parseDisplay(display),
|
|
163
|
-
getObservationsFormaterAttributes(data, formaterIds)
|
|
164
|
-
);
|
|
165
|
-
export const timelineSeries = memoizee(_timelineSeries);
|
|
166
|
-
|
|
167
|
-
const _stackedSeries = (data, singularity, display, formaterIds, [stackKey, categoryKey]) => __stackedSeries(
|
|
168
|
-
extractSdmxArtefacts(data),
|
|
169
|
-
dimensionsWithValuesIndexedById(data),
|
|
170
|
-
stackedDimension(data, singularity),
|
|
171
|
-
parseDisplay(display),
|
|
172
|
-
getObservationsFormaterAttributes(data, formaterIds),
|
|
173
|
-
[stackKey, categoryKey]
|
|
174
|
-
);
|
|
175
|
-
export const stackedSeries = memoizee(_stackedSeries);
|
|
176
|
-
|
|
177
|
-
// --------------------------------------------------------------------------------------choroSeries
|
|
178
|
-
const _choroSeries = (data, map, display) => __choroSeries(
|
|
179
|
-
extractSdmxArtefacts(data),
|
|
180
|
-
dimensionsWithValuesIndexedById(data),
|
|
181
|
-
map,
|
|
182
|
-
parseDisplay(display)
|
|
183
|
-
);
|
|
184
|
-
export const choroSeries = memoizee(_choroSeries);
|
|
185
|
-
|
|
186
|
-
// -------------------------------------------------------------------------------------------series
|
|
187
|
-
const _series = (data, type, focus, singularity, map, display, formaterIds) => {
|
|
188
|
-
switch(type) {
|
|
189
|
-
case 'RowChart': case 'BarChart':
|
|
190
|
-
return __sampleFocus(sampleSeries(data, type, display, formaterIds), focus);
|
|
191
|
-
case 'ScatterChart':
|
|
192
|
-
return __scatterFocus(scatterSeries(data, singularity, display, formaterIds), focus);
|
|
193
|
-
case 'HorizontalSymbolChart': case 'VerticalSymbolChart':
|
|
194
|
-
return __sampleFocus(symbolSeries(data, type, singularity, display, formaterIds), focus);
|
|
195
|
-
case 'TimelineChart':
|
|
196
|
-
return __timelineFocus(timelineSeries(data, display, formaterIds), focus);
|
|
197
|
-
case 'StackedBarChart':
|
|
198
|
-
return __sampleFocus(stackedSeries(data, singularity, display, formaterIds, ['y', 'x']), focus);
|
|
199
|
-
case 'StackedRowChart':
|
|
200
|
-
return __sampleFocus(stackedSeries(data, singularity, display, formaterIds, ['x', 'y']), focus);
|
|
201
|
-
case 'ChoroplethChart':
|
|
202
|
-
return choroSeries(data, map, display);
|
|
203
|
-
}
|
|
204
|
-
};
|
|
205
|
-
export const series = memoizee(_series);
|
|
206
|
-
|
|
207
|
-
// -------------------------------------------------------------------------------------------source
|
|
208
|
-
const _source = (data, config, meta) => {
|
|
209
|
-
const hasSource = get(meta, 'hasSource', true);
|
|
210
|
-
if (!hasSource)
|
|
211
|
-
return null;
|
|
212
|
-
const source = get(config, 'source', null);
|
|
213
|
-
if (source && !(isEmpty(source)))
|
|
214
|
-
return source;
|
|
215
|
-
const artefacts = extractSdmxArtefacts(data);
|
|
216
|
-
const uri = get(artefacts, 'source');
|
|
217
|
-
if (!uri)
|
|
218
|
-
return get(config, 'defaultSource', null);
|
|
219
|
-
const match = uri.match(/(^http.*)\/SDMX-JSON\/data\/([^\/]+)\//);
|
|
220
|
-
if (size(match) !== 3)
|
|
221
|
-
return null;
|
|
222
|
-
const [m, domain, dataset] = match;
|
|
223
|
-
return `${domain}/Index.aspx?DataSetCode=${dataset}`; //tmp
|
|
224
|
-
};
|
|
225
|
-
export const source = memoizee(_source);
|
|
226
|
-
|
|
227
|
-
// --------------------------------------------------------------------------------------------focus
|
|
228
|
-
const _focus = (data, type, dimension, _display) => {
|
|
229
|
-
const display = parseDisplay(_display);
|
|
230
|
-
switch(type) {
|
|
231
|
-
case 'RowChart': case 'BarChart':
|
|
232
|
-
case 'HorizontalSymbolChart': case 'VerticalSymbolChart':
|
|
233
|
-
case 'StackedBarChart': case 'StackedRowChart':
|
|
234
|
-
return R.compose(
|
|
235
|
-
(datapoints) => map(datapoints, (dp) => ({ label: dp.category, value: dp.key })),
|
|
236
|
-
(series) => series[0].datapoints,
|
|
237
|
-
series
|
|
238
|
-
)(data, type, null, dimension, null, display);
|
|
239
|
-
case 'TimelineChart':
|
|
240
|
-
return R.compose(
|
|
241
|
-
(series) => map(series, (serie) => ({ label: serie.category, value: serie.key })),
|
|
242
|
-
series
|
|
243
|
-
)(data, type, null, dimension, null, display)
|
|
244
|
-
case 'ScatterChart':
|
|
245
|
-
const id = get(dimension, 'id');
|
|
246
|
-
if (isNil(id)) return [];
|
|
247
|
-
const dimensions = R.compose(
|
|
248
|
-
(dimensions) => omit(dimensions, id),
|
|
249
|
-
dimensionsWithValuesIndexedById
|
|
250
|
-
)(data);
|
|
251
|
-
return flatten(map(
|
|
252
|
-
dimensions,
|
|
253
|
-
(dimension) => {
|
|
254
|
-
return map(
|
|
255
|
-
get(dimension, 'values'),
|
|
256
|
-
(value) => ({
|
|
257
|
-
label: `${dimensionValueDisplay(display)(dimension)} - ${dimensionValueDisplay(display)(value)}`,
|
|
258
|
-
options: { dimensionId: dimension.id, dimensionValueId: value.id },
|
|
259
|
-
value: `${dimension.id}-${value.id}`
|
|
260
|
-
})
|
|
261
|
-
)
|
|
262
|
-
}
|
|
263
|
-
));
|
|
264
|
-
}
|
|
265
|
-
};
|
|
266
|
-
export const focus = memoizee(_focus);
|
|
267
|
-
|
|
268
|
-
const _parseFocus = (data, type, dimension, display, { baseline, highlight }) => {
|
|
269
|
-
const options = focus(data, type, dimension, display);
|
|
270
|
-
|
|
271
|
-
const parseSelection = selection => compact(map(selection, ({ value }) => find(options, option => isEqual(option.value, value))));
|
|
272
|
-
return ({ baseline: parseSelection(baseline), highlight: parseSelection(highlight) });
|
|
273
|
-
};
|
|
274
|
-
export const parseFocus = memoizee(_parseFocus);
|
|
275
|
-
|
|
276
|
-
const _defaultSubtitle = (data, display, REJECTED_SUBTITLE_IDS = DEFAULT_REJECTED_SUBTITLE_IDS) => {
|
|
277
|
-
const { value } = splitDimensions(data);
|
|
278
|
-
const values = reduce(
|
|
279
|
-
R.reject(R.prop('isHidden'))(value),
|
|
280
|
-
(memo, d) => {
|
|
281
|
-
const dvId = get(d, 'values[0].id');
|
|
282
|
-
if (!includes(REJECTED_SUBTITLE_IDS, dvId)) {
|
|
283
|
-
memo.push(`${dimensionValueDisplay(display)(d)}: ${dimensionValueDisplay(display)(get(d, 'values[0]'))}`);
|
|
284
|
-
}
|
|
285
|
-
return memo;
|
|
286
|
-
},
|
|
287
|
-
[]
|
|
288
|
-
);
|
|
289
|
-
return values;
|
|
290
|
-
}
|
|
291
|
-
export const defaultSubtitle = memoizee(_defaultSubtitle);
|
|
292
|
-
|
|
293
|
-
const _uprAttributes = (attributes, UPR_IDS = DEFAULT_UPR_IDS) => (
|
|
294
|
-
reduce(
|
|
295
|
-
UPR_IDS,
|
|
296
|
-
(memo, ids, uprKey) => {
|
|
297
|
-
const attr = find(attributes, attribute => includes(ids, get(attribute, 'id')));
|
|
298
|
-
if (attr) {
|
|
299
|
-
memo[uprKey] = attr;
|
|
300
|
-
}
|
|
301
|
-
return memo;
|
|
302
|
-
},
|
|
303
|
-
{}
|
|
304
|
-
)
|
|
305
|
-
);
|
|
306
|
-
export const uprAttributes = memoizee(_uprAttributes);
|
|
307
|
-
|
|
308
|
-
const _uprAttributesWithOneRelevantValue = (uprAttributes, UPR_IDS = DEFAULT_UPR_IDS, REJECTED_UPR_VALUES_IDS = DEFAULT_REJECTED_UPR_VALUES_IDS) => reduce(
|
|
309
|
-
uprAttributes,
|
|
310
|
-
(memo, attr, key) => {
|
|
311
|
-
if (size(get(attr, 'values', [])) === 1 && !(includes(REJECTED_UPR_VALUES_IDS[key], get(attr, 'values[0].id', ''))))
|
|
312
|
-
memo[key] = attr;
|
|
313
|
-
return memo;
|
|
314
|
-
},
|
|
315
|
-
{}
|
|
316
|
-
);
|
|
317
|
-
export const uprAttributesWithOneRelevantValue = memoizee(_uprAttributesWithOneRelevantValue);
|
|
318
|
-
|
|
319
|
-
export const headerUprsLabel = display => uprAttributes => {
|
|
320
|
-
return map(
|
|
321
|
-
uprAttributes,
|
|
322
|
-
attr => dimensionValueDisplay(display)(get(attr, 'values[0]'))
|
|
323
|
-
).join(', ');
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
export const getUprs = (data, display) => R.compose(
|
|
327
|
-
headerUprsLabel(parseDisplay(display)),
|
|
328
|
-
uprAttributesWithOneRelevantValue,
|
|
329
|
-
({ attributes }) => uprAttributes(attributes),
|
|
330
|
-
extractSdmxArtefacts
|
|
331
|
-
)(data);
|
|
332
|
-
|
|
333
|
-
const _header = (data, _title, _subtitle, _display) => {
|
|
334
|
-
const display = parseDisplay(_display);
|
|
335
|
-
const title = (isNil(_title) || isEmpty(_title)) ? get(data, 'structure.name') : _title;
|
|
336
|
-
const subtitle = (isNil(_subtitle) || isEmpty(_subtitle)) ? defaultSubtitle(data, display) : _subtitle;
|
|
337
|
-
return ({
|
|
338
|
-
title,
|
|
339
|
-
subtitle: isArray(subtitle) ? subtitle : [subtitle],
|
|
340
|
-
uprs: R.compose(
|
|
341
|
-
headerUprsLabel(display),
|
|
342
|
-
uprAttributesWithOneRelevantValue,
|
|
343
|
-
({ attributes }) => uprAttributes(attributes),
|
|
344
|
-
extractSdmxArtefacts
|
|
345
|
-
)(data)
|
|
346
|
-
});
|
|
347
|
-
};
|
|
348
|
-
export const header = memoizee(_header);
|
|
349
|
-
|
|
350
|
-
const _sourceLabel = (data, label) => (
|
|
351
|
-
(isNil(label) || isEmpty(label)) ? extractSdmxArtefacts(data).name : label
|
|
352
|
-
);
|
|
353
|
-
export const sourceLabel = memoizee(_sourceLabel);
|
|
354
|
-
|
|
355
|
-
const _getTopologyAreasCollections = (topology) => map(topology.objects, (entry, key) => key);
|
|
356
|
-
export const getTopologyAreasCollections = memoizee(_getTopologyAreasCollections);
|
|
357
|
-
|
|
358
|
-
const _isNonIdealState = (data, type, map) => {
|
|
359
|
-
const defaultSeries = series(data, type, null, null, map);
|
|
360
|
-
if (type === 'ChoroplethChart')
|
|
361
|
-
{
|
|
362
|
-
return findIndex(get(defaultSeries, 'objects.areas.geometries', []), geometry => get(geometry, 'properties.value', null)) === -1;
|
|
363
|
-
}
|
|
364
|
-
return isEmpty(get(defaultSeries, '[0].datapoints', []));
|
|
365
|
-
}
|
|
366
|
-
export const isNonIdealState = memoizee(_isNonIdealState);
|
|
367
|
-
|
|
368
|
-
export { dimensionValueDisplay } from './dimension-utils';
|
|
369
|
-
export { DEFAULT_UPR_IDS, DIMENSION_DISPLAY_PARTS, DEFAULT_MAJOR_ATTRIBUTES, V8_SDMX_JSON,
|
|
370
|
-
TYPES as chartTypes } from './constants';
|
|
1
|
+
export { dimensionValueDisplay, parseDisplay } from './dimension-utils';
|
|
371
2
|
export {
|
|
372
|
-
initialState,
|
|
373
3
|
stateFromNewProps,
|
|
374
|
-
onChangeProperties,
|
|
375
|
-
toChartData,
|
|
376
4
|
toChartOptions,
|
|
377
5
|
toProperties,
|
|
378
|
-
getErrors,
|
|
379
6
|
toSingularity
|
|
380
7
|
} from './properties';
|
|
381
|
-
export {
|
|
382
|
-
export {
|
|
383
|
-
getCellValue,
|
|
384
|
-
} from './table';
|
|
8
|
+
export { parseFocus } from './properties/focus';
|
|
385
9
|
export {
|
|
386
10
|
getFullName,
|
|
387
11
|
} from './sdmx-data';
|
|
388
12
|
export { getTimePeriodLabel } from './date';
|
|
389
|
-
export {
|
|
390
|
-
export { getInformationsStateFromNewProps } from './properties/getInformationsStateFromNewProps';
|
|
391
|
-
export { getObservationsType } from './properties/getObservationsType';
|
|
13
|
+
export { getFooterProps } from './properties/getHeaderProps';
|
|
392
14
|
export { getAvailableChartTypes } from './properties/getAvailableChartTypes';
|
|
393
15
|
export { isSharedLayoutCompatible } from './layout';
|
|
394
16
|
|
|
395
17
|
export { getObservations } from './preparators/getObservations';
|
|
396
18
|
|
|
397
|
-
export const getFlags = R.identity;
|
|
398
|
-
export const prepareData = R.identity;
|
|
399
19
|
|
|
400
|
-
export {
|
|
20
|
+
export { getCellValue } from './table';
|
|
21
|
+
export { getChartOptions } from './chart/getChartOptions';
|
|
22
|
+
export { getReportingYearStart } from './preparators/getReportingYearStart';
|
|
23
|
+
export { getChartSeries } from './factories/getChartSeries';
|
package/src/rules/src/layout.js
CHANGED
|
@@ -11,12 +11,14 @@ import {
|
|
|
11
11
|
refineDimensions,
|
|
12
12
|
parseCombinationDefinition
|
|
13
13
|
} from '../../rules2/src';
|
|
14
|
+
import { getReportingYearStart } from './/preparators/getReportingYearStart';
|
|
14
15
|
|
|
15
16
|
const isTableLayoutCompatible = (data, layout, combinationsDefinitions = [], dataquery = '') => {
|
|
16
17
|
const indexedCombinations = R.indexBy(R.prop('id'), combinationsDefinitions);
|
|
18
|
+
const reportYearStart = getReportingYearStart(data);
|
|
17
19
|
const indexedManyValuesDimensions = R.pipe(
|
|
18
20
|
R.pathOr([], ['structure', 'dimensions', 'observation']),
|
|
19
|
-
dimensions => refineDimensions(dimensions, dataquery),
|
|
21
|
+
dimensions => refineDimensions({ dimensions, options: { dataquery, reportYearStart } }),
|
|
20
22
|
R.reject(d => R.prop('header', d) || !R.length(d.values || [])),
|
|
21
23
|
R.indexBy(R.prop('id'))
|
|
22
24
|
)(data);
|
|
@@ -43,7 +45,7 @@ const isScatterLayoutCompatible = (data, chartDimension) => {
|
|
|
43
45
|
|
|
44
46
|
const dimensions = R.pathOr([], ['structure', 'dimensions', 'observation'], data);
|
|
45
47
|
|
|
46
|
-
const dimension = R.find(R.propEq(
|
|
48
|
+
const dimension = R.find(R.propEq(id, 'id'), dimensions);
|
|
47
49
|
if (R.isNil(dimension)) {
|
|
48
50
|
return false;
|
|
49
51
|
}
|
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
import memoizee from 'memoizee';
|
|
2
1
|
import numeral from 'numeral';
|
|
3
2
|
import * as R from 'ramda';
|
|
4
|
-
import { extractSdmxArtefacts } from './';
|
|
5
3
|
|
|
6
|
-
|
|
4
|
+
const DEFAULT_PREFSCALE_ATTR_IDS = ["PREF_SCALE"];
|
|
7
5
|
|
|
8
|
-
|
|
6
|
+
const DEFAULT_DECIMALS_ATTR_IDS = ["DECIMALS"];
|
|
9
7
|
|
|
10
|
-
|
|
8
|
+
const getFormaterAttribute = (ids, attributes) => R.find(
|
|
11
9
|
(attr) => R.includes(attr.id, ids),
|
|
12
10
|
attributes
|
|
13
11
|
);
|
|
14
12
|
|
|
15
|
-
|
|
13
|
+
const parseAttributeFormaterIds = (ids = {}) => {
|
|
16
14
|
let prefscale = R.prop('prefscale', ids);
|
|
17
15
|
let decimals = R.prop('decimals', ids);
|
|
18
16
|
decimals = R.isNil(decimals) ? DEFAULT_DECIMALS_ATTR_IDS : decimals;
|
|
@@ -23,30 +21,26 @@ export const parseAttributeFormaterIds = (ids = {}) => {
|
|
|
23
21
|
});
|
|
24
22
|
}
|
|
25
23
|
|
|
26
|
-
export const
|
|
27
|
-
|
|
28
|
-
({
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
)(data);
|
|
36
|
-
export const getObservationsFormaterAttributes = memoizee(_getObservationsFormaterAttributes);
|
|
24
|
+
export const getObservationsFormaterAttributes = (attributes = [], ids = {}) => {
|
|
25
|
+
const { decimals, prefscale } = parseAttributeFormaterIds(ids);
|
|
26
|
+
return ({
|
|
27
|
+
decimals: getFormaterAttribute(decimals, attributes),
|
|
28
|
+
prefscale: getFormaterAttribute(prefscale, attributes)
|
|
29
|
+
});
|
|
30
|
+
};
|
|
37
31
|
|
|
38
|
-
|
|
32
|
+
const getObservationFormaterValue = (observation, attribute) => {
|
|
39
33
|
const attributeIndex = R.prop('index', attribute);
|
|
40
34
|
const attributeValueIndex = R.nth(attributeIndex, observation);
|
|
41
35
|
return R.nth(attributeValueIndex, R.propOr([], 'values', attribute));
|
|
42
36
|
}
|
|
43
37
|
|
|
44
|
-
|
|
38
|
+
const getObservationFormaterValues = (formaterAttributes) => (observation) => ({
|
|
45
39
|
decimals: getObservationFormaterValue(observation, R.prop('decimals', formaterAttributes)),
|
|
46
40
|
prefscale: getObservationFormaterValue(observation, R.prop('prefscale', formaterAttributes)),
|
|
47
41
|
});
|
|
48
42
|
|
|
49
|
-
|
|
43
|
+
const makeObservationFormater = (formaterValues) => {
|
|
50
44
|
let prefscale = 0;
|
|
51
45
|
if (!R.isNil(R.prop('prefscale', formaterValues))) {
|
|
52
46
|
prefscale = Number(R.propOr('0', 'id', formaterValues.prefscale));
|