@mathstack/viz 2.1.0 → 2.2.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/fesm2022/mathstack-viz.mjs +11024 -0
- package/fesm2022/mathstack-viz.mjs.map +1 -0
- package/package.json +14 -5
- package/types/mathstack-viz.d.ts +5830 -0
- package/CHANGELOG.md +0 -0
- package/cypress/fixtures/example.json +0 -5
- package/cypress/fixtures/usMap.json +0 -13511
- package/cypress/support/commands.ts +0 -104
- package/cypress/support/component-index.html +0 -12
- package/cypress/support/component.ts +0 -33
- package/cypress.config.ts +0 -9
- package/karma.conf.js +0 -62
- package/ng-package.json +0 -8
- package/project.json +0 -97
- package/src/.eslintrc.json +0 -35
- package/src/.prettierrc +0 -31
- package/src/lib/axes/base/config/xy-axis-builder.ts +0 -68
- package/src/lib/axes/base/config/xy-axis-config.ts +0 -35
- package/src/lib/axes/base/config/xy-axis-options.ts +0 -11
- package/src/lib/axes/base/xy-axis-base.spec.ts +0 -114
- package/src/lib/axes/base/xy-axis-base.ts +0 -305
- package/src/lib/axes/base/xy-axis-domain-lines.cy.ts +0 -511
- package/src/lib/axes/baseline/axis-baseline-builder.ts +0 -77
- package/src/lib/axes/baseline/axis-baseline-options.ts +0 -4
- package/src/lib/axes/baseline/axis-baseline.ts +0 -11
- package/src/lib/axes/grid/grid-builder.ts +0 -74
- package/src/lib/axes/grid/grid-config.ts +0 -13
- package/src/lib/axes/grid/grid-options.ts +0 -7
- package/src/lib/axes/index.ts +0 -40
- package/src/lib/axes/label/axis-label-builder.ts +0 -140
- package/src/lib/axes/label/axis-label-options.ts +0 -12
- package/src/lib/axes/label/axis-label.ts +0 -18
- package/src/lib/axes/label/axis-labels.cy.ts +0 -303
- package/src/lib/axes/ordinal/ordinal-axis-config.ts +0 -31
- package/src/lib/axes/ordinal/ordinal-axis.spec.ts +0 -30
- package/src/lib/axes/ordinal/ordinal-axis.ts +0 -26
- package/src/lib/axes/quantitative/quantitative-axis-config.ts +0 -39
- package/src/lib/axes/quantitative/quantitative-axis-ticks.cy.ts +0 -748
- package/src/lib/axes/quantitative/quantitative-axis.spec.ts +0 -537
- package/src/lib/axes/quantitative/quantitative-axis.ts +0 -191
- package/src/lib/axes/ticks/tick-wrap/tick-wrap-builder.ts +0 -141
- package/src/lib/axes/ticks/tick-wrap/tick-wrap-options.ts +0 -11
- package/src/lib/axes/ticks/tick-wrap/tick-wrap.cy.ts +0 -360
- package/src/lib/axes/ticks/tick-wrap/tick-wrap.ts +0 -21
- package/src/lib/axes/ticks/ticks-builder.ts +0 -370
- package/src/lib/axes/ticks/ticks-options.ts +0 -24
- package/src/lib/axes/ticks/ticks.ts +0 -33
- package/src/lib/axes/x/x-axis-config.ts +0 -48
- package/src/lib/axes/x/x-axis.spec.ts +0 -90
- package/src/lib/axes/x/x-axis.ts +0 -109
- package/src/lib/axes/x-ordinal/x-ordinal-axis-builder.ts +0 -75
- package/src/lib/axes/x-ordinal/x-ordinal-axis-config.ts +0 -27
- package/src/lib/axes/x-ordinal/x-ordinal-axis.component.ts +0 -33
- package/src/lib/axes/x-quantitative/x-quantitative-axis-builder.ts +0 -74
- package/src/lib/axes/x-quantitative/x-quantitative-axis-config.ts +0 -32
- package/src/lib/axes/x-quantitative/x-quantitative-axis.component.ts +0 -40
- package/src/lib/axes/xy-axis.module.ts +0 -20
- package/src/lib/axes/y/y-axis-config.ts +0 -47
- package/src/lib/axes/y/y-axis.spec.ts +0 -92
- package/src/lib/axes/y/y-axis.ts +0 -161
- package/src/lib/axes/y-ordinal/y-ordinal-axis-builder.ts +0 -76
- package/src/lib/axes/y-ordinal/y-ordinal-axis-config.ts +0 -29
- package/src/lib/axes/y-ordinal/y-ordinal-axis.component.ts +0 -33
- package/src/lib/axes/y-quantitative-axis/y-quantitative-axis-builder.ts +0 -74
- package/src/lib/axes/y-quantitative-axis/y-quantitative-axis-config.ts +0 -34
- package/src/lib/axes/y-quantitative-axis/y-quantitative-axis.component.ts +0 -40
- package/src/lib/bars/bars.component.scss +0 -0
- package/src/lib/bars/bars.component.spec.ts +0 -1470
- package/src/lib/bars/bars.component.ts +0 -717
- package/src/lib/bars/bars.cy.ts +0 -829
- package/src/lib/bars/bars.module.ts +0 -9
- package/src/lib/bars/config/backgrounds/bars-backgrounds-builder.ts +0 -51
- package/src/lib/bars/config/backgrounds/bars-backgrounds-options.ts +0 -4
- package/src/lib/bars/config/backgrounds/bars-backgrounds.ts +0 -11
- package/src/lib/bars/config/bars-builder.ts +0 -340
- package/src/lib/bars/config/bars-config.spec.ts +0 -132
- package/src/lib/bars/config/bars-config.ts +0 -70
- package/src/lib/bars/config/bars-dimensions.ts +0 -29
- package/src/lib/bars/config/bars-options.ts +0 -20
- package/src/lib/bars/config/labels/bars-labels-builder.ts +0 -89
- package/src/lib/bars/config/labels/bars-labels-options.ts +0 -6
- package/src/lib/bars/config/labels/bars-labels.cy.ts +0 -781
- package/src/lib/bars/config/labels/bars-labels.ts +0 -13
- package/src/lib/bars/events/actions/bars-click-actions.ts +0 -23
- package/src/lib/bars/events/actions/bars-hover-actions.ts +0 -43
- package/src/lib/bars/events/actions/bars-hover-move-actions.ts +0 -21
- package/src/lib/bars/events/bars-events.directive.spec.ts +0 -186
- package/src/lib/bars/events/bars-events.directive.ts +0 -235
- package/src/lib/bars/events/bars-interaction-output.ts +0 -17
- package/src/lib/bars/events/bars-tooltip-positioner.ts +0 -24
- package/src/lib/bars/index.ts +0 -18
- package/src/lib/charts/chart/chart-scaling.cy.ts +0 -323
- package/src/lib/charts/chart/chart.component.html +0 -45
- package/src/lib/charts/chart/chart.component.scss +0 -37
- package/src/lib/charts/chart/chart.component.ts +0 -243
- package/src/lib/charts/chart/chart.token.ts +0 -4
- package/src/lib/charts/chart/chart.ts +0 -5
- package/src/lib/charts/chart/config/chart-builder.ts +0 -194
- package/src/lib/charts/chart/config/chart-config.ts +0 -21
- package/src/lib/charts/chart/config/chart-options.ts +0 -11
- package/src/lib/charts/chart.module.ts +0 -10
- package/src/lib/charts/index.ts +0 -9
- package/src/lib/charts/map-chart/map-chart.component.scss +0 -0
- package/src/lib/charts/map-chart/map-chart.component.spec.ts +0 -35
- package/src/lib/charts/map-chart/map-chart.component.ts +0 -61
- package/src/lib/charts/xy-chart/xy-chart.component.spec.ts +0 -34
- package/src/lib/charts/xy-chart/xy-chart.component.ts +0 -65
- package/src/lib/core/common-behaviors/constructor.ts +0 -7
- package/src/lib/core/index.ts +0 -11
- package/src/lib/core/pipes/resize-chart-height.pipe.spec.ts +0 -23
- package/src/lib/core/pipes/resize-chart-height.pipe.ts +0 -20
- package/src/lib/core/styles/_spacing.scss +0 -4
- package/src/lib/core/types/layout.ts +0 -28
- package/src/lib/core/types/scale.ts +0 -6
- package/src/lib/core/types/utility.ts +0 -11
- package/src/lib/core/types/values.ts +0 -10
- package/src/lib/core/utilities/colors.spec.ts +0 -57
- package/src/lib/core/utilities/colors.ts +0 -42
- package/src/lib/core/utilities/fill-utilities.spec.ts +0 -25
- package/src/lib/core/utilities/fill-utilities.ts +0 -21
- package/src/lib/core/utilities/type-guards.spec.ts +0 -55
- package/src/lib/core/utilities/type-guards.ts +0 -33
- package/src/lib/core/utilities/value-format.ts +0 -21
- package/src/lib/core/utilities/values.spec.ts +0 -954
- package/src/lib/core/utilities/values.ts +0 -189
- package/src/lib/data-dimensions/continuous-quantitative/date-chart-position/date-chart-position-builder.ts +0 -105
- package/src/lib/data-dimensions/continuous-quantitative/date-chart-position/date-chart-position-options.ts +0 -24
- package/src/lib/data-dimensions/continuous-quantitative/date-chart-position/date-chart-position.spec.ts +0 -66
- package/src/lib/data-dimensions/continuous-quantitative/date-chart-position/date-chart-position.ts +0 -72
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/concrete-domain-padding.ts +0 -10
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/domain-padding.ts +0 -76
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/domain-test-utility.ts +0 -130
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/percent-over/percent-over-options.ts +0 -3
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/percent-over/percent-over.ts +0 -37
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/pixel/pixel-options.ts +0 -3
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/pixel/pixel.ts +0 -73
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/quantitative-domain-padding.cy.ts +0 -978
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/round-to-interval/round-to-interval-options.ts +0 -3
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/round-to-interval/round-to-interval.ts +0 -27
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/round-to-sig-fig/round-to-sig-fig-options.ts +0 -3
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/round-to-sig-fig/round-to-sig-fig.ts +0 -30
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/number-chart-position-builder.ts +0 -183
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/number-chart-position-options.ts +0 -8
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/number-chart-position.spec.ts +0 -28
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/number-chart-position.ts +0 -62
- package/src/lib/data-dimensions/continuous-quantitative/number-dimension/number-dimension-options.ts +0 -15
- package/src/lib/data-dimensions/continuous-quantitative/number-dimension/number-dimension.spec.ts +0 -155
- package/src/lib/data-dimensions/continuous-quantitative/number-dimension/number-dimension.ts +0 -57
- package/src/lib/data-dimensions/continuous-quantitative/number-visual-value/number-visual-value-builder.ts +0 -166
- package/src/lib/data-dimensions/continuous-quantitative/number-visual-value/number-visual-value-options.ts +0 -10
- package/src/lib/data-dimensions/continuous-quantitative/number-visual-value/number-visual-value.spec.ts +0 -34
- package/src/lib/data-dimensions/continuous-quantitative/number-visual-value/number-visual-value.ts +0 -57
- package/src/lib/data-dimensions/dimension-builder.ts +0 -45
- package/src/lib/data-dimensions/dimension-options.ts +0 -12
- package/src/lib/data-dimensions/dimension.ts +0 -30
- package/src/lib/data-dimensions/index.ts +0 -31
- package/src/lib/data-dimensions/ordinal/ordinal-chart-position/ordinal-chart-position-builder.ts +0 -122
- package/src/lib/data-dimensions/ordinal/ordinal-chart-position/ordinal-chart-position-options.ts +0 -12
- package/src/lib/data-dimensions/ordinal/ordinal-chart-position/ordinal-chart-position.spec.ts +0 -83
- package/src/lib/data-dimensions/ordinal/ordinal-chart-position/ordinal-chart-position.ts +0 -101
- package/src/lib/data-dimensions/ordinal/ordinal-visual-value/ordinal-visual-value-builder.ts +0 -108
- package/src/lib/data-dimensions/ordinal/ordinal-visual-value/ordinal-visual-value-options.ts +0 -12
- package/src/lib/data-dimensions/ordinal/ordinal-visual-value/ordinal-visual-value.cy.ts +0 -384
- package/src/lib/data-dimensions/ordinal/ordinal-visual-value/ordinal-visual-value.spec.ts +0 -63
- package/src/lib/data-dimensions/ordinal/ordinal-visual-value/ordinal-visual-value.ts +0 -79
- package/src/lib/data-export/data-export-config.ts +0 -98
- package/src/lib/data-export/data-export.spec.ts +0 -33
- package/src/lib/data-export/data-export.ts +0 -87
- package/src/lib/data-export/index.ts +0 -2
- package/src/lib/dots/config/dots-builder.ts +0 -442
- package/src/lib/dots/config/dots-config.spec.ts +0 -123
- package/src/lib/dots/config/dots-config.ts +0 -81
- package/src/lib/dots/config/dots-options.ts +0 -32
- package/src/lib/dots/dots.component.scss +0 -0
- package/src/lib/dots/dots.component.spec.ts +0 -143
- package/src/lib/dots/dots.component.ts +0 -291
- package/src/lib/dots/dots.cy.ts +0 -594
- package/src/lib/dots/dots.module.ts +0 -9
- package/src/lib/dots/events/actions/dots-hover-actions.ts +0 -19
- package/src/lib/dots/events/actions/dots-hover-move-actions.ts +0 -38
- package/src/lib/dots/events/dots-events.directive.ts +0 -214
- package/src/lib/dots/events/dots-interaction-output.ts +0 -15
- package/src/lib/dots/events/dots-tooltip-positioner.ts +0 -24
- package/src/lib/dots/index.ts +0 -10
- package/src/lib/events/events.directive.ts +0 -184
- package/src/lib/events/events.types.ts +0 -57
- package/src/lib/events/index.ts +0 -4
- package/src/lib/events/interaction-output.ts +0 -34
- package/src/lib/events/tooltip-positioner.ts +0 -15
- package/src/lib/fill-definitions/fill-definitions.ts +0 -4
- package/src/lib/fill-definitions/index.ts +0 -1
- package/src/lib/geographies/config/geographies-builder.ts +0 -224
- package/src/lib/geographies/config/geographies-config.spec.ts +0 -100
- package/src/lib/geographies/config/geographies-config.ts +0 -81
- package/src/lib/geographies/config/geographies-options.ts +0 -37
- package/src/lib/geographies/config/layers/attribute-data-layer/attribute-data-layer-builder.ts +0 -212
- package/src/lib/geographies/config/layers/attribute-data-layer/attribute-data-layer-options.ts +0 -26
- package/src/lib/geographies/config/layers/attribute-data-layer/attribute-data-layer.spec.ts +0 -119
- package/src/lib/geographies/config/layers/attribute-data-layer/attribute-data-layer.ts +0 -148
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/attribute-data/attribute-data-dimension-builder.ts +0 -65
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/attribute-data/attribute-data-dimension-options.ts +0 -15
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/attribute-data/attribute-data-dimension.ts +0 -32
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/attribute-data-bin-enums.ts +0 -10
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/attribute-data-bin-types.ts +0 -15
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/calculated-bins/calculated-bins-builder.ts +0 -18
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/calculated-bins/calculated-bins-options.ts +0 -8
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/calculated-bins/calculated-bins.spec.ts +0 -60
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/calculated-bins/calculated-bins.ts +0 -34
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/categorical-bins/categorical-bins-builder.ts +0 -46
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/categorical-bins/categorical-bins-options.ts +0 -8
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/categorical-bins/categorical-bins.cy.ts +0 -437
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/categorical-bins/categorical-bins.spec.ts +0 -105
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/categorical-bins/categorical-bins.ts +0 -54
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/custom-breaks/custom-breaks-bins-builder.ts +0 -65
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/custom-breaks/custom-breaks-bins-options.ts +0 -9
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/custom-breaks/custom-breaks-bins.spec.ts +0 -82
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/custom-breaks/custom-breaks-bins.ts +0 -81
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/custom-breaks/custom-breaks.cy.ts +0 -378
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/equal-frequencies-bins/equal-frequencies-bins-builder.ts +0 -50
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/equal-frequencies-bins/equal-frequencies-bins-options.ts +0 -8
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/equal-frequencies-bins/equal-frequencies-bins.cy.ts +0 -362
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/equal-frequencies-bins/equal-frequencies-bins.spec.ts +0 -72
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/equal-frequencies-bins/equal-frequencies-bins.ts +0 -56
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/equal-value-ranges-bins/equal-value-ranges-bins-builder.ts +0 -60
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/equal-value-ranges-bins/equal-value-ranges-bins-options.ts +0 -9
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/equal-value-ranges-bins/equal-value-ranges-bins.cy.ts +0 -307
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/equal-value-ranges-bins/equal-value-ranges-bins.spec.ts +0 -104
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/equal-value-ranges-bins/equal-value-ranges-bins.ts +0 -89
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/no-bins/no-bins-builder.ts +0 -62
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/no-bins/no-bins-options.ts +0 -8
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/no-bins/no-bins.cy.ts +0 -265
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/no-bins/no-bins.spec.ts +0 -42
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/no-bins/no-bins.ts +0 -42
- package/src/lib/geographies/config/layers/geographies-layer/geographies-layer-builder.ts +0 -116
- package/src/lib/geographies/config/layers/geographies-layer/geographies-layer-options.ts +0 -20
- package/src/lib/geographies/config/layers/geographies-layer/geographies-layer.ts +0 -104
- package/src/lib/geographies/config/layers/geojson-properties-layer/geojson-properties-layer-builder.ts +0 -111
- package/src/lib/geographies/config/layers/geojson-properties-layer/geojson-properties-layer-options.ts +0 -19
- package/src/lib/geographies/config/layers/geojson-properties-layer/geojson-properties-layer.spec.ts +0 -41
- package/src/lib/geographies/config/layers/geojson-properties-layer/geojson-properties-layer.ts +0 -67
- package/src/lib/geographies/config/layers/labels/geographies-labels-builder.ts +0 -269
- package/src/lib/geographies/config/layers/labels/geographies-labels-options.ts +0 -45
- package/src/lib/geographies/config/layers/labels/geographies-labels.ts +0 -38
- package/src/lib/geographies/events/actions/geographies-click-actions.ts +0 -21
- package/src/lib/geographies/events/actions/geographies-hover-actions.ts +0 -17
- package/src/lib/geographies/events/actions/geographies-hover-move-actions.ts +0 -19
- package/src/lib/geographies/events/geographies-events.directive.spec.ts +0 -225
- package/src/lib/geographies/events/geographies-events.directive.ts +0 -235
- package/src/lib/geographies/events/geographies-interaction-output.ts +0 -17
- package/src/lib/geographies/events/geographies-tooltip-positioner.ts +0 -23
- package/src/lib/geographies/geographies-feature.ts +0 -16
- package/src/lib/geographies/geographies.component.html +0 -1
- package/src/lib/geographies/geographies.component.scss +0 -0
- package/src/lib/geographies/geographies.component.spec.ts +0 -148
- package/src/lib/geographies/geographies.component.ts +0 -318
- package/src/lib/geographies/geographies.cy.ts +0 -640
- package/src/lib/geographies/geographies.module.ts +0 -9
- package/src/lib/geographies/index.ts +0 -32
- package/src/lib/grouped-bars/config/grouped-bars-builder.ts +0 -66
- package/src/lib/grouped-bars/config/grouped-bars-config.ts +0 -41
- package/src/lib/grouped-bars/config/grouped-bars-options.ts +0 -9
- package/src/lib/grouped-bars/events/grouped-bars-events.directive.ts +0 -221
- package/src/lib/grouped-bars/grouped-bars.component.scss +0 -0
- package/src/lib/grouped-bars/grouped-bars.component.spec.ts +0 -25
- package/src/lib/grouped-bars/grouped-bars.component.ts +0 -94
- package/src/lib/grouped-bars/grouped-bars.module.ts +0 -9
- package/src/lib/grouped-bars/index.ts +0 -10
- package/src/lib/image-download/image-download-config.ts +0 -57
- package/src/lib/image-download/image-download-enums.ts +0 -7
- package/src/lib/image-download/image-download-options.ts +0 -14
- package/src/lib/image-download/image-download.service.ts +0 -70
- package/src/lib/image-download/index.ts +0 -4
- package/src/lib/lines/config/area-fills/area-fills-builder.ts +0 -87
- package/src/lib/lines/config/area-fills/area-fills-options.ts +0 -8
- package/src/lib/lines/config/area-fills/area-fills.ts +0 -14
- package/src/lib/lines/config/lines-builder.ts +0 -242
- package/src/lib/lines/config/lines-config.spec.ts +0 -52
- package/src/lib/lines/config/lines-config.ts +0 -96
- package/src/lib/lines/config/lines-options.ts +0 -19
- package/src/lib/lines/config/stroke/lines-stroke-builder.ts +0 -135
- package/src/lib/lines/config/stroke/lines-stroke-options.ts +0 -6
- package/src/lib/lines/config/stroke/lines-stroke.ts +0 -15
- package/src/lib/lines/events/actions/lines-click-actions.ts +0 -17
- package/src/lib/lines/events/actions/lines-hover-move-actions.ts +0 -113
- package/src/lib/lines/events/actions/lines-marker-click-actions.ts +0 -29
- package/src/lib/lines/events/lines-events.directive.spec.ts +0 -152
- package/src/lib/lines/events/lines-events.directive.ts +0 -310
- package/src/lib/lines/events/lines-interaction-output.ts +0 -17
- package/src/lib/lines/events/lines-tooltip-positioner.ts +0 -24
- package/src/lib/lines/index.ts +0 -17
- package/src/lib/lines/lines.component.scss +0 -0
- package/src/lib/lines/lines.component.spec.ts +0 -95
- package/src/lib/lines/lines.component.ts +0 -425
- package/src/lib/lines/lines.cy.ts +0 -738
- package/src/lib/lines/lines.module.ts +0 -9
- package/src/lib/map-legend/continuous-legend/continuous-legend.component.html +0 -28
- package/src/lib/map-legend/continuous-legend/continuous-legend.component.scss +0 -76
- package/src/lib/map-legend/continuous-legend/continuous-legend.component.spec.ts +0 -61
- package/src/lib/map-legend/continuous-legend/continuous-legend.component.ts +0 -82
- package/src/lib/map-legend/discontinuous-legend/discontinuous-legend.component.html +0 -40
- package/src/lib/map-legend/discontinuous-legend/discontinuous-legend.component.scss +0 -141
- package/src/lib/map-legend/discontinuous-legend/discontinuous-legend.component.spec.ts +0 -75
- package/src/lib/map-legend/discontinuous-legend/discontinuous-legend.component.ts +0 -57
- package/src/lib/map-legend/index.ts +0 -2
- package/src/lib/map-legend/map-legend-base.spec.ts +0 -190
- package/src/lib/map-legend/map-legend-base.ts +0 -99
- package/src/lib/map-legend/map-legend.component.html +0 -24
- package/src/lib/map-legend/map-legend.component.scss +0 -0
- package/src/lib/map-legend/map-legend.component.spec.ts +0 -125
- package/src/lib/map-legend/map-legend.component.ts +0 -80
- package/src/lib/map-legend/map-legend.module.ts +0 -8
- package/src/lib/marks/aux-marks/aux-marks.ts +0 -18
- package/src/lib/marks/aux-marks/config/aux-marks-builder.ts +0 -25
- package/src/lib/marks/aux-marks/config/aux-marks-config.ts +0 -6
- package/src/lib/marks/config/marks-config.ts +0 -14
- package/src/lib/marks/config/marks-options.ts +0 -9
- package/src/lib/marks/index.ts +0 -15
- package/src/lib/marks/map-marks/map-aux-marks/map-aux-marks.spec.ts +0 -74
- package/src/lib/marks/map-marks/map-aux-marks/map-aux-marks.ts +0 -40
- package/src/lib/marks/map-marks/map-primary-marks/map-primary-marks.spec.ts +0 -79
- package/src/lib/marks/map-marks/map-primary-marks/map-primary-marks.ts +0 -63
- package/src/lib/marks/marks.ts +0 -39
- package/src/lib/marks/primary-marks/config/primary-marks-builder.ts +0 -75
- package/src/lib/marks/primary-marks/config/primary-marks-config.ts +0 -9
- package/src/lib/marks/primary-marks/primary-marks-base.spec.ts +0 -58
- package/src/lib/marks/primary-marks/primary-marks.ts +0 -43
- package/src/lib/marks/xy-marks/xy-aux-marks/xy-aux-marks.ts +0 -40
- package/src/lib/marks/xy-marks/xy-marks-config.ts +0 -5
- package/src/lib/marks/xy-marks/xy-marks.ts +0 -10
- package/src/lib/marks/xy-marks/xy-primary-marks/xy-primary-marks-config.ts +0 -7
- package/src/lib/marks/xy-marks/xy-primary-marks/xy-primary-marks.spec.ts +0 -186
- package/src/lib/marks/xy-marks/xy-primary-marks/xy-primary-marks.ts +0 -72
- package/src/lib/point-markers/index.ts +0 -3
- package/src/lib/point-markers/point-markers-builder.ts +0 -93
- package/src/lib/point-markers/point-markers-options.ts +0 -6
- package/src/lib/point-markers/point-markers.ts +0 -13
- package/src/lib/quantitative-rules/config/labels/quantitative-rules-labels-builder.ts +0 -162
- package/src/lib/quantitative-rules/config/labels/quantitative-rules-labels-options.ts +0 -17
- package/src/lib/quantitative-rules/config/labels/quantitative-rules-labels.ts +0 -26
- package/src/lib/quantitative-rules/config/quantitative-rules-builder.ts +0 -134
- package/src/lib/quantitative-rules/config/quantitative-rules-config.ts +0 -21
- package/src/lib/quantitative-rules/config/quantitative-rules-dimensions.ts +0 -20
- package/src/lib/quantitative-rules/config/quantitative-rules-options.ts +0 -13
- package/src/lib/quantitative-rules/index.ts +0 -6
- package/src/lib/quantitative-rules/quantitative-rules.component.scss +0 -3
- package/src/lib/quantitative-rules/quantitative-rules.component.spec.ts +0 -50
- package/src/lib/quantitative-rules/quantitative-rules.component.ts +0 -224
- package/src/lib/quantitative-rules/quantitative-rules.cy.ts +0 -549
- package/src/lib/quantitative-rules/quantitative-rules.module.ts +0 -8
- package/src/lib/stacked-area/config/stacked-area-builder.ts +0 -264
- package/src/lib/stacked-area/config/stacked-area-config.spec.ts +0 -107
- package/src/lib/stacked-area/config/stacked-area-config.ts +0 -109
- package/src/lib/stacked-area/config/stacked-area-options.ts +0 -28
- package/src/lib/stacked-area/events/actions/stacked-area-hover-move-actions.ts +0 -17
- package/src/lib/stacked-area/events/stacked-area-events.directive.spec.ts +0 -168
- package/src/lib/stacked-area/events/stacked-area-events.directive.ts +0 -272
- package/src/lib/stacked-area/events/stacked-area-interaction-output.ts +0 -33
- package/src/lib/stacked-area/events/stacked-area-tooltip-positioner.ts +0 -37
- package/src/lib/stacked-area/index.ts +0 -7
- package/src/lib/stacked-area/stacked-area.component.scss +0 -0
- package/src/lib/stacked-area/stacked-area.component.spec.ts +0 -41
- package/src/lib/stacked-area/stacked-area.component.ts +0 -241
- package/src/lib/stacked-area/stacked-area.module.ts +0 -9
- package/src/lib/stacked-bars/config/stacked-bars-builder.ts +0 -109
- package/src/lib/stacked-bars/config/stacked-bars-config.spec.ts +0 -122
- package/src/lib/stacked-bars/config/stacked-bars-config.ts +0 -79
- package/src/lib/stacked-bars/config/stacked-bars-options.ts +0 -16
- package/src/lib/stacked-bars/events/actions/stacked-bars-click-actions.ts +0 -23
- package/src/lib/stacked-bars/events/actions/stacked-bars-hover-actions.ts +0 -22
- package/src/lib/stacked-bars/events/actions/stacked-bars-hover-move-actions.ts +0 -21
- package/src/lib/stacked-bars/events/stacked-bars-events.directive.spec.ts +0 -266
- package/src/lib/stacked-bars/events/stacked-bars-events.directive.ts +0 -240
- package/src/lib/stacked-bars/index.ts +0 -10
- package/src/lib/stacked-bars/stacked-bars.component.scss +0 -0
- package/src/lib/stacked-bars/stacked-bars.component.spec.ts +0 -25
- package/src/lib/stacked-bars/stacked-bars.component.ts +0 -158
- package/src/lib/stacked-bars/stacked-bars.module.ts +0 -9
- package/src/lib/stroke/base/stroke-base-options.ts +0 -7
- package/src/lib/stroke/base/stroke-base.ts +0 -9
- package/src/lib/stroke/index.ts +0 -5
- package/src/lib/stroke/stroke-builder.ts +0 -103
- package/src/lib/stroke/stroke-options.ts +0 -5
- package/src/lib/stroke/stroke.ts +0 -12
- package/src/lib/svg-text-wrap/index.ts +0 -3
- package/src/lib/svg-text-wrap/svg-text-wrap-builder.ts +0 -105
- package/src/lib/svg-text-wrap/svg-text-wrap-options.ts +0 -8
- package/src/lib/svg-text-wrap/svg-text-wrap.ts +0 -137
- package/src/lib/testing/data/continent-population-year-data.ts +0 -126
- package/src/lib/testing/data/country-area-continent.ts +0 -59
- package/src/lib/testing/data/state-population-income-year-data.ts +0 -123
- package/src/lib/testing/stubs/bars.component.stub.ts +0 -12
- package/src/lib/testing/stubs/chart.component.stub.ts +0 -6
- package/src/lib/testing/stubs/click.directive.stub.ts +0 -15
- package/src/lib/testing/stubs/core/destroy-ref.stub.ts +0 -9
- package/src/lib/testing/stubs/core/overlay-ref.stub.ts +0 -13
- package/src/lib/testing/stubs/core/overlay.stub.ts +0 -8
- package/src/lib/testing/stubs/event.directive.stub.ts +0 -10
- package/src/lib/testing/stubs/hover-move.directive.stub.ts +0 -17
- package/src/lib/testing/stubs/hover.directive.stub.ts +0 -14
- package/src/lib/testing/stubs/input-event.directive.stub.ts +0 -9
- package/src/lib/testing/stubs/lines.component.stub.ts +0 -13
- package/src/lib/testing/stubs/map-aux-marks.stub.ts +0 -10
- package/src/lib/testing/stubs/map-chart.component.stub.ts +0 -3
- package/src/lib/testing/stubs/map-legend-content.stub.ts +0 -16
- package/src/lib/testing/stubs/map-legend.component.stub.ts +0 -10
- package/src/lib/testing/stubs/map-primary-marks.stub.ts +0 -16
- package/src/lib/testing/stubs/ordinal-axis.stub.ts +0 -18
- package/src/lib/testing/stubs/primary-marks.stub.ts +0 -18
- package/src/lib/testing/stubs/quantitative-axis.stub.ts +0 -18
- package/src/lib/testing/stubs/services/main.service.stub.ts +0 -5
- package/src/lib/testing/stubs/services/utilities.service.stub.ts +0 -7
- package/src/lib/testing/stubs/stacked-area.component.stub.ts +0 -13
- package/src/lib/testing/stubs/x-axis.stub.ts +0 -10
- package/src/lib/testing/stubs/xy-axis.class.stub.ts +0 -20
- package/src/lib/testing/stubs/xy-axis.stub.ts +0 -44
- package/src/lib/testing/stubs/xy-chart.component.stub.ts +0 -5
- package/src/lib/testing/stubs/xy-data-marks.stub.ts +0 -15
- package/src/lib/testing/stubs/y-axis.stub.ts +0 -15
- package/src/lib/tooltips/config/tooltip.ts +0 -11
- package/src/lib/tooltips/html-tooltip/config/html-tooltip-builder.ts +0 -134
- package/src/lib/tooltips/html-tooltip/config/html-tooltip-config.ts +0 -21
- package/src/lib/tooltips/html-tooltip/config/html-tooltip-options.ts +0 -12
- package/src/lib/tooltips/html-tooltip/config/position/tooltip-position-builder.ts +0 -191
- package/src/lib/tooltips/html-tooltip/config/position/tooltip-position.ts +0 -42
- package/src/lib/tooltips/html-tooltip/config/size/tooltip-size-builder.ts +0 -75
- package/src/lib/tooltips/html-tooltip/config/size/tooltip-size-options.ts +0 -8
- package/src/lib/tooltips/html-tooltip/config/size/tooltip-size.ts +0 -15
- package/src/lib/tooltips/html-tooltip/html-tooltip.directive.spec.ts +0 -537
- package/src/lib/tooltips/html-tooltip/html-tooltip.directive.ts +0 -210
- package/src/lib/tooltips/html-tooltip/html-tooltip.module.ts +0 -16
- package/src/lib/tooltips/html-tooltip/tooltip-triangle/tooltip-triangle.component.html +0 -41
- package/src/lib/tooltips/html-tooltip/tooltip-triangle/tooltip-triangle.component.scss +0 -63
- package/src/lib/tooltips/html-tooltip/tooltip-triangle/tooltip-triangle.component.ts +0 -19
- package/src/lib/tooltips/index.ts +0 -11
- package/src/lib/tooltips/svg-tooltip/config/svg-tooltip.ts +0 -5
- package/src/lib/xy-background/index.ts +0 -2
- package/src/lib/xy-background/xy-background.component.html +0 -10
- package/src/lib/xy-background/xy-background.component.scss +0 -0
- package/src/lib/xy-background/xy-background.component.spec.ts +0 -24
- package/src/lib/xy-background/xy-background.component.ts +0 -19
- package/src/lib/xy-background/xy-background.module.ts +0 -8
- package/src/public-api.ts +0 -26
- package/src/test.ts +0 -15
- package/tsconfig.doc.json +0 -4
- package/tsconfig.json +0 -20
- package/tsconfig.lib.json +0 -23
- package/tsconfig.lib.prod.json +0 -10
- package/tsconfig.spec.json +0 -10
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
import { ValueUtilities } from '../core/utilities/values';
|
|
3
|
-
import { CategoricalBinsAttributeDataDimension } from '../geographies/config/layers/attribute-data-layer/dimensions/categorical-bins/categorical-bins';
|
|
4
|
-
import { CategoricalBinsBuilder } from '../geographies/config/layers/attribute-data-layer/dimensions/categorical-bins/categorical-bins-builder';
|
|
5
|
-
import { CategoricalBinsOptions } from '../geographies/config/layers/attribute-data-layer/dimensions/categorical-bins/categorical-bins-options';
|
|
6
|
-
import { EqualValueRangesBinsBuilder } from '../geographies/config/layers/attribute-data-layer/dimensions/equal-value-ranges-bins/equal-value-ranges-bins-builder';
|
|
7
|
-
import { MapLegendContentStub } from '../testing/stubs/map-legend-content.stub';
|
|
8
|
-
|
|
9
|
-
describe('the MapLegendContent abstract class', () => {
|
|
10
|
-
let directive: MapLegendContentStub<any>;
|
|
11
|
-
|
|
12
|
-
beforeEach(() => {
|
|
13
|
-
directive = new MapLegendContentStub();
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
describe('ngOnChanges', () => {
|
|
17
|
-
beforeEach(() => {
|
|
18
|
-
spyOn(directive, 'setValues');
|
|
19
|
-
spyOn(directive, 'setColors');
|
|
20
|
-
});
|
|
21
|
-
it('calls setValues once', () => {
|
|
22
|
-
directive.ngOnChanges();
|
|
23
|
-
expect(directive.setValues).toHaveBeenCalledTimes(1);
|
|
24
|
-
});
|
|
25
|
-
it('calls setColors once', () => {
|
|
26
|
-
directive.ngOnChanges();
|
|
27
|
-
expect(directive.setColors).toHaveBeenCalledTimes(1);
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
describe('setValues', () => {
|
|
32
|
-
beforeEach(() => {
|
|
33
|
-
spyOn(directive, 'setCategoricalValues');
|
|
34
|
-
spyOn(directive, 'setQuantitativeValues');
|
|
35
|
-
});
|
|
36
|
-
it('calls setCategoricalValues once if binType is categorical', () => {
|
|
37
|
-
directive.config = new CategoricalBinsBuilder<string>()
|
|
38
|
-
.valueAccessor((d) => d)
|
|
39
|
-
._build();
|
|
40
|
-
directive.setValues();
|
|
41
|
-
expect(directive.setCategoricalValues).toHaveBeenCalledTimes(1);
|
|
42
|
-
});
|
|
43
|
-
it('calls setQuantitativeValues once if binType is not categorical', () => {
|
|
44
|
-
directive.config = new EqualValueRangesBinsBuilder<number>()
|
|
45
|
-
.valueAccessor((d) => d)
|
|
46
|
-
._build();
|
|
47
|
-
directive.setValues();
|
|
48
|
-
expect(directive.setQuantitativeValues).toHaveBeenCalledTimes(1);
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
describe('setQuantitativeValues', () => {
|
|
53
|
-
let formatSpy: jasmine.Spy;
|
|
54
|
-
beforeEach(() => {
|
|
55
|
-
spyOn(directive, 'getValuesFromScale').and.returnValue([0.01, 0.02]);
|
|
56
|
-
spyOn(directive, 'setQuantitativeValueSpaces');
|
|
57
|
-
formatSpy = spyOn(ValueUtilities, 'd3Format').and.callThrough();
|
|
58
|
-
directive.orientation = 'horizontal';
|
|
59
|
-
directive.config = new EqualValueRangesBinsBuilder<number>()
|
|
60
|
-
.valueAccessor((d) => d)
|
|
61
|
-
.formatSpecifier('.0%')
|
|
62
|
-
._build();
|
|
63
|
-
});
|
|
64
|
-
it('calls getValuesFromScale once', () => {
|
|
65
|
-
directive.setQuantitativeValues();
|
|
66
|
-
expect(directive.getValuesFromScale).toHaveBeenCalledTimes(1);
|
|
67
|
-
});
|
|
68
|
-
it('calls setQuantitativeValueSpaces once with the correct values if orientation is horizontal', () => {
|
|
69
|
-
directive.setQuantitativeValues();
|
|
70
|
-
expect(directive.setQuantitativeValueSpaces).toHaveBeenCalledWith([
|
|
71
|
-
'1%',
|
|
72
|
-
'2%',
|
|
73
|
-
]);
|
|
74
|
-
});
|
|
75
|
-
it('calls d3Format once with the correct values if orientation is horizontal', () => {
|
|
76
|
-
directive.setQuantitativeValues();
|
|
77
|
-
expect(formatSpy.calls.allArgs()).toEqual([
|
|
78
|
-
[0.01, '.0%'],
|
|
79
|
-
[0.02, '.0%'],
|
|
80
|
-
]);
|
|
81
|
-
});
|
|
82
|
-
it('calls d3Format once with the correct values if orientation is vertical', () => {
|
|
83
|
-
directive.orientation = 'vertical';
|
|
84
|
-
directive.setQuantitativeValues();
|
|
85
|
-
expect(formatSpy.calls.allArgs()).toEqual([
|
|
86
|
-
[0.02, '.0%'],
|
|
87
|
-
[0.01, '.0%'],
|
|
88
|
-
]);
|
|
89
|
-
});
|
|
90
|
-
it('sets values to the correct values - orientation is horizontal', () => {
|
|
91
|
-
directive.setQuantitativeValues();
|
|
92
|
-
expect(directive.values).toEqual(['1%', '2%']);
|
|
93
|
-
});
|
|
94
|
-
it('sets values to the correct values - orientation is vertical', () => {
|
|
95
|
-
directive.orientation = 'vertical';
|
|
96
|
-
directive.setQuantitativeValues();
|
|
97
|
-
expect(directive.values).toEqual(['2%', '1%']);
|
|
98
|
-
});
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
describe('setCategoricalValues', () => {
|
|
102
|
-
beforeEach(() => {
|
|
103
|
-
spyOn(directive, 'getValuesFromScale').and.returnValue(['a', 'b'] as any);
|
|
104
|
-
spyOn(directive, 'setCategoricalValueSpaces');
|
|
105
|
-
directive.orientation = 'horizontal';
|
|
106
|
-
});
|
|
107
|
-
it('calls getValuesFromScale once', () => {
|
|
108
|
-
directive.setCategoricalValues();
|
|
109
|
-
expect(directive.getValuesFromScale).toHaveBeenCalledTimes(1);
|
|
110
|
-
});
|
|
111
|
-
it('calls setCategoricalValueSpaces once', () => {
|
|
112
|
-
directive.setCategoricalValues();
|
|
113
|
-
expect(directive.setCategoricalValueSpaces).toHaveBeenCalledTimes(1);
|
|
114
|
-
});
|
|
115
|
-
it('sets values to the correct values - orientation is horizontal', () => {
|
|
116
|
-
directive.setCategoricalValues();
|
|
117
|
-
expect(directive.values).toEqual(['a', 'b']);
|
|
118
|
-
});
|
|
119
|
-
it('sets values to the correct values - orientation is vertical', () => {
|
|
120
|
-
directive.orientation = 'vertical';
|
|
121
|
-
directive.setCategoricalValues();
|
|
122
|
-
expect(directive.values).toEqual(['b', 'a']);
|
|
123
|
-
});
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
describe('setColors', () => {
|
|
127
|
-
beforeEach(() => {
|
|
128
|
-
directive.config = new CategoricalBinsAttributeDataDimension(
|
|
129
|
-
{} as CategoricalBinsOptions<any>
|
|
130
|
-
);
|
|
131
|
-
(directive.config as any).domain = ['a', 'b'];
|
|
132
|
-
directive.config.range = ['red', 'blue'];
|
|
133
|
-
});
|
|
134
|
-
it('should set colors to scale.range if orientation is not vertical', () => {
|
|
135
|
-
directive.orientation = 'horizontal';
|
|
136
|
-
directive.setColors();
|
|
137
|
-
expect(directive.colors).toEqual(['red', 'blue']);
|
|
138
|
-
});
|
|
139
|
-
|
|
140
|
-
it('should reverse colors if orientation is vertical', () => {
|
|
141
|
-
directive.orientation = 'vertical';
|
|
142
|
-
directive.setColors();
|
|
143
|
-
expect(directive.colors).toEqual(['blue', 'red']);
|
|
144
|
-
});
|
|
145
|
-
});
|
|
146
|
-
|
|
147
|
-
describe('setQuantitativeValueSpaces', () => {
|
|
148
|
-
beforeEach(() => {
|
|
149
|
-
spyOn(directive, 'getLeftOffset').and.returnValue(10);
|
|
150
|
-
directive.setQuantitativeValueSpaces(['101', '2002']);
|
|
151
|
-
});
|
|
152
|
-
it('sets startValueSpace to the correct value', () => {
|
|
153
|
-
expect(directive.startValueSpace).toEqual(12);
|
|
154
|
-
});
|
|
155
|
-
|
|
156
|
-
it('sets endValueSpace to the correct value', () => {
|
|
157
|
-
expect(directive.endValueSpace).toEqual(16);
|
|
158
|
-
});
|
|
159
|
-
|
|
160
|
-
it('sets largerValueSpace to the correct value', () => {
|
|
161
|
-
expect(directive.largerValueSpace).toEqual(16);
|
|
162
|
-
});
|
|
163
|
-
|
|
164
|
-
it('calls leftOffset with the correct value', () => {
|
|
165
|
-
expect(directive.getLeftOffset).toHaveBeenCalledOnceWith(['101', '2002']);
|
|
166
|
-
});
|
|
167
|
-
|
|
168
|
-
it('sets leftOffset to the correct value', () => {
|
|
169
|
-
expect(directive.leftOffset).toEqual(10);
|
|
170
|
-
});
|
|
171
|
-
});
|
|
172
|
-
|
|
173
|
-
describe('setCategoricalValueSpaces', () => {
|
|
174
|
-
beforeEach(() => {
|
|
175
|
-
directive.setCategoricalValueSpaces();
|
|
176
|
-
});
|
|
177
|
-
it('should set startValueSpace to 0', () => {
|
|
178
|
-
expect(directive.startValueSpace).toEqual(0);
|
|
179
|
-
});
|
|
180
|
-
it('should set endValueSpace to 0', () => {
|
|
181
|
-
expect(directive.endValueSpace).toEqual(0);
|
|
182
|
-
});
|
|
183
|
-
it('should set largerValueSpace to 0', () => {
|
|
184
|
-
expect(directive.largerValueSpace).toEqual(0);
|
|
185
|
-
});
|
|
186
|
-
it('should set leftOffset to 0', () => {
|
|
187
|
-
expect(directive.leftOffset).toEqual(0);
|
|
188
|
-
});
|
|
189
|
-
});
|
|
190
|
-
});
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { Directive, Input, OnChanges, OnInit } from '@angular/core';
|
|
2
|
-
import { Orientation, Side } from '../core/types/layout';
|
|
3
|
-
import { ValueUtilities } from '../core/utilities/values';
|
|
4
|
-
import { BinStrategy } from '../geographies/config/layers/attribute-data-layer/dimensions/attribute-data-bin-enums';
|
|
5
|
-
import { VicAttributeDataDimensionConfig } from '../geographies/config/layers/attribute-data-layer/dimensions/attribute-data-bin-types';
|
|
6
|
-
import { CalculatedBinsAttributeDataDimension } from '../geographies/config/layers/attribute-data-layer/dimensions/calculated-bins/calculated-bins';
|
|
7
|
-
|
|
8
|
-
@Directive()
|
|
9
|
-
export abstract class MapLegend<
|
|
10
|
-
Datum,
|
|
11
|
-
AttributeDimensionConfig extends VicAttributeDataDimensionConfig<Datum>,
|
|
12
|
-
>
|
|
13
|
-
implements OnChanges, OnInit
|
|
14
|
-
{
|
|
15
|
-
@Input() width: number;
|
|
16
|
-
@Input() height: number;
|
|
17
|
-
@Input() orientation: keyof typeof Orientation;
|
|
18
|
-
@Input() valuesSide: keyof typeof Side;
|
|
19
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
20
|
-
@Input() scale: any;
|
|
21
|
-
@Input() config: AttributeDimensionConfig;
|
|
22
|
-
@Input() outlineColor: string;
|
|
23
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
24
|
-
values: any[];
|
|
25
|
-
colors: string[];
|
|
26
|
-
startValueSpace: number;
|
|
27
|
-
endValueSpace: number;
|
|
28
|
-
largerValueSpace: number;
|
|
29
|
-
leftOffset: number;
|
|
30
|
-
VicValuesBin: typeof BinStrategy;
|
|
31
|
-
|
|
32
|
-
abstract getValuesFromScale(): string[] | number[];
|
|
33
|
-
abstract getLeftOffset(values?: string[]): number;
|
|
34
|
-
|
|
35
|
-
ngOnChanges(): void {
|
|
36
|
-
this.setValues();
|
|
37
|
-
this.setColors();
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
ngOnInit(): void {
|
|
41
|
-
this.VicValuesBin = BinStrategy;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
setValues(): void {
|
|
45
|
-
if (this.config.binType !== BinStrategy.categorical) {
|
|
46
|
-
this.setQuantitativeValues();
|
|
47
|
-
} else {
|
|
48
|
-
this.setCategoricalValues();
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
setQuantitativeValues(): void {
|
|
53
|
-
let values = this.getValuesFromScale() as number[];
|
|
54
|
-
if (this.orientation === Orientation.vertical) {
|
|
55
|
-
values = values.slice().reverse();
|
|
56
|
-
}
|
|
57
|
-
this.values = values.map((d) =>
|
|
58
|
-
ValueUtilities.d3Format(
|
|
59
|
-
d,
|
|
60
|
-
(this.config as CalculatedBinsAttributeDataDimension<Datum>)
|
|
61
|
-
.formatSpecifier
|
|
62
|
-
)
|
|
63
|
-
);
|
|
64
|
-
this.setQuantitativeValueSpaces(this.values);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
setCategoricalValues(): void {
|
|
68
|
-
let values = this.getValuesFromScale() as string[];
|
|
69
|
-
if (this.orientation === Orientation.vertical) {
|
|
70
|
-
values = values.slice().reverse();
|
|
71
|
-
}
|
|
72
|
-
this.setCategoricalValueSpaces();
|
|
73
|
-
this.values = values;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
setColors(): void {
|
|
77
|
-
this.colors = this.config.range;
|
|
78
|
-
if (this.orientation === Orientation.vertical) {
|
|
79
|
-
this.colors = this.colors.slice().reverse();
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
setQuantitativeValueSpaces(values: string[]): void {
|
|
84
|
-
this.startValueSpace = values[0].length * 4;
|
|
85
|
-
this.endValueSpace = values[values.length - 1].length * 4;
|
|
86
|
-
this.largerValueSpace =
|
|
87
|
-
this.startValueSpace > this.endValueSpace
|
|
88
|
-
? this.startValueSpace
|
|
89
|
-
: this.endValueSpace;
|
|
90
|
-
this.leftOffset = this.getLeftOffset(values);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
setCategoricalValueSpaces(): void {
|
|
94
|
-
this.startValueSpace = 0;
|
|
95
|
-
this.endValueSpace = 0;
|
|
96
|
-
this.largerValueSpace = 0;
|
|
97
|
-
this.leftOffset = 0;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
<ng-content select="[title]"></ng-content>
|
|
2
|
-
@if (chart.attributeProperties$ | async; as attributeProperties) { @if
|
|
3
|
-
(attributeProperties.config) { @if (attributeProperties.config.binType ===
|
|
4
|
-
VicValuesBin.none) {
|
|
5
|
-
<vic-continuous-legend
|
|
6
|
-
[width]="width"
|
|
7
|
-
[height]="height"
|
|
8
|
-
[valuesSide]="valuesSide"
|
|
9
|
-
[scale]="attributeProperties.scale"
|
|
10
|
-
[config]="attributeProperties.config"
|
|
11
|
-
[outlineColor]="outlineColor"
|
|
12
|
-
[orientation]="orientation"
|
|
13
|
-
></vic-continuous-legend>
|
|
14
|
-
} @else {
|
|
15
|
-
<vic-discontinuous-legend
|
|
16
|
-
[width]="width"
|
|
17
|
-
[height]="height"
|
|
18
|
-
[valuesSide]="valuesSide"
|
|
19
|
-
[scale]="attributeProperties.scale"
|
|
20
|
-
[config]="attributeProperties.config"
|
|
21
|
-
[outlineColor]="outlineColor"
|
|
22
|
-
[orientation]="orientation"
|
|
23
|
-
></vic-discontinuous-legend>
|
|
24
|
-
} } }
|
|
File without changes
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
3
|
-
import { MapChartComponent } from '../charts/map-chart/map-chart.component';
|
|
4
|
-
|
|
5
|
-
import { MapLegendComponent } from './map-legend.component';
|
|
6
|
-
|
|
7
|
-
describe('MapLegendComponent', () => {
|
|
8
|
-
let component: MapLegendComponent<any>;
|
|
9
|
-
let fixture: ComponentFixture<MapLegendComponent<any>>;
|
|
10
|
-
|
|
11
|
-
beforeEach(async () => {
|
|
12
|
-
await TestBed.configureTestingModule({
|
|
13
|
-
imports: [MapLegendComponent],
|
|
14
|
-
providers: [MapChartComponent],
|
|
15
|
-
}).compileComponents();
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
beforeEach(() => {
|
|
19
|
-
fixture = TestBed.createComponent(MapLegendComponent);
|
|
20
|
-
component = fixture.componentInstance;
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
describe('ngOnInit', () => {
|
|
24
|
-
beforeEach(() => {
|
|
25
|
-
spyOn(component, 'setOrientation');
|
|
26
|
-
spyOn(component, 'setValuesSide');
|
|
27
|
-
});
|
|
28
|
-
it('calls setOrientation once', () => {
|
|
29
|
-
component.ngOnInit();
|
|
30
|
-
expect(component.setOrientation).toHaveBeenCalledTimes(1);
|
|
31
|
-
});
|
|
32
|
-
it('calls setValuesSide once', () => {
|
|
33
|
-
component.ngOnInit();
|
|
34
|
-
expect(component.setValuesSide).toHaveBeenCalledTimes(1);
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
describe('setOrientation', () => {
|
|
39
|
-
it('sets orientation to horizontal if width is greater than height', () => {
|
|
40
|
-
component.width = 100;
|
|
41
|
-
component.height = 50;
|
|
42
|
-
component.setOrientation();
|
|
43
|
-
expect(component.orientation).toEqual('horizontal');
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
it('sets orientation to vertical if width is not greater than height', () => {
|
|
47
|
-
component.width = 100;
|
|
48
|
-
component.height = 200;
|
|
49
|
-
component.setOrientation();
|
|
50
|
-
expect(component.orientation).toEqual('vertical');
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
describe('setValuesSide', () => {
|
|
55
|
-
beforeEach(() => {
|
|
56
|
-
spyOn(console, 'warn');
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
describe('if orientation is horizontal', () => {
|
|
60
|
-
beforeEach(() => {
|
|
61
|
-
component.orientation = 'horizontal';
|
|
62
|
-
});
|
|
63
|
-
describe('valuesSide is left', () => {
|
|
64
|
-
it('sets valuesSide to bottom', () => {
|
|
65
|
-
component.valuesSide = 'left';
|
|
66
|
-
component.setValuesSide();
|
|
67
|
-
expect(component.valuesSide).toEqual('bottom');
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
it('calls console.warn', () => {
|
|
71
|
-
component.valuesSide = 'left';
|
|
72
|
-
component.setValuesSide();
|
|
73
|
-
expect(console.warn).toHaveBeenCalledTimes(1);
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
describe('valuesSide is right', () => {
|
|
78
|
-
it('sets valuesSide to bottom', () => {
|
|
79
|
-
component.valuesSide = 'left';
|
|
80
|
-
component.setValuesSide();
|
|
81
|
-
expect(component.valuesSide).toEqual('bottom');
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
it('calls console.warn', () => {
|
|
85
|
-
component.valuesSide = 'left';
|
|
86
|
-
component.setValuesSide();
|
|
87
|
-
expect(console.warn).toHaveBeenCalledTimes(1);
|
|
88
|
-
});
|
|
89
|
-
});
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
describe('if orientation is vertical', () => {
|
|
93
|
-
beforeEach(() => {
|
|
94
|
-
component.orientation = 'vertical';
|
|
95
|
-
});
|
|
96
|
-
describe('valuesSide is top', () => {
|
|
97
|
-
it('sets valuesSide to left', () => {
|
|
98
|
-
component.valuesSide = 'top';
|
|
99
|
-
component.setValuesSide();
|
|
100
|
-
expect(component.valuesSide).toEqual('left');
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
it('calls console.warn', () => {
|
|
104
|
-
component.valuesSide = 'top';
|
|
105
|
-
component.setValuesSide();
|
|
106
|
-
expect(console.warn).toHaveBeenCalledTimes(1);
|
|
107
|
-
});
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
describe('valuesSide is bottom', () => {
|
|
111
|
-
it('sets valuesSide to left', () => {
|
|
112
|
-
component.valuesSide = 'bottom';
|
|
113
|
-
component.setValuesSide();
|
|
114
|
-
expect(component.valuesSide).toEqual('left');
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
it('calls console.warn', () => {
|
|
118
|
-
component.valuesSide = 'bottom';
|
|
119
|
-
component.setValuesSide();
|
|
120
|
-
expect(console.warn).toHaveBeenCalledTimes(1);
|
|
121
|
-
});
|
|
122
|
-
});
|
|
123
|
-
});
|
|
124
|
-
});
|
|
125
|
-
});
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { CommonModule } from '@angular/common';
|
|
2
|
-
import {
|
|
3
|
-
Component,
|
|
4
|
-
DestroyRef,
|
|
5
|
-
ElementRef,
|
|
6
|
-
Input,
|
|
7
|
-
OnInit,
|
|
8
|
-
ViewChild,
|
|
9
|
-
inject,
|
|
10
|
-
} from '@angular/core';
|
|
11
|
-
import { MapChartComponent } from '../charts/map-chart/map-chart.component';
|
|
12
|
-
import { Orientation, Side } from '../core/types/layout';
|
|
13
|
-
import { BinStrategy } from '../geographies/config/layers/attribute-data-layer/dimensions/attribute-data-bin-enums';
|
|
14
|
-
import { ContinuousLegendComponent } from './continuous-legend/continuous-legend.component';
|
|
15
|
-
import { DiscontinuousLegendComponent } from './discontinuous-legend/discontinuous-legend.component';
|
|
16
|
-
|
|
17
|
-
export enum VicLegendType {
|
|
18
|
-
categorical = 'categorical',
|
|
19
|
-
ordinal = 'ordinal',
|
|
20
|
-
quantitative = 'quantitative',
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
@Component({
|
|
24
|
-
selector: 'vic-map-legend',
|
|
25
|
-
templateUrl: './map-legend.component.html',
|
|
26
|
-
styleUrls: ['./map-legend.component.scss'],
|
|
27
|
-
imports: [
|
|
28
|
-
CommonModule,
|
|
29
|
-
ContinuousLegendComponent,
|
|
30
|
-
DiscontinuousLegendComponent,
|
|
31
|
-
],
|
|
32
|
-
})
|
|
33
|
-
export class MapLegendComponent<Datum> implements OnInit {
|
|
34
|
-
@Input() width: number;
|
|
35
|
-
@Input() height: number;
|
|
36
|
-
@Input() valuesSide: keyof typeof Side;
|
|
37
|
-
@Input() outlineColor: string;
|
|
38
|
-
@ViewChild('canvas', { static: true })
|
|
39
|
-
VicValuesBin: typeof BinStrategy;
|
|
40
|
-
canvasRef: ElementRef<HTMLCanvasElement>;
|
|
41
|
-
legendType: keyof typeof VicLegendType;
|
|
42
|
-
orientation: keyof typeof Orientation;
|
|
43
|
-
chart = inject(MapChartComponent<Datum>);
|
|
44
|
-
destroyRef = inject(DestroyRef);
|
|
45
|
-
|
|
46
|
-
ngOnInit(): void {
|
|
47
|
-
this.VicValuesBin = BinStrategy; // for some reason this doesn't get assigned if it's assigned in the class properties above
|
|
48
|
-
this.setOrientation();
|
|
49
|
-
this.setValuesSide();
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
setOrientation(): void {
|
|
53
|
-
this.orientation =
|
|
54
|
-
this.width > this.height ? Orientation.horizontal : Orientation.vertical;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
setValuesSide(): void {
|
|
58
|
-
if (this.orientation === Orientation.horizontal) {
|
|
59
|
-
if (this.valuesSide === Side.left || this.valuesSide === Side.right) {
|
|
60
|
-
this.valuesSide = undefined;
|
|
61
|
-
console.warn(
|
|
62
|
-
"valuesSide must be set to 'top' or 'bottom' for a map-legend with a horizontal aspect ratio"
|
|
63
|
-
);
|
|
64
|
-
}
|
|
65
|
-
if (!this.valuesSide) {
|
|
66
|
-
this.valuesSide = Side.bottom;
|
|
67
|
-
}
|
|
68
|
-
} else {
|
|
69
|
-
if (this.valuesSide === Side.top || this.valuesSide === Side.bottom) {
|
|
70
|
-
this.valuesSide = undefined;
|
|
71
|
-
console.warn(
|
|
72
|
-
"valuesSide must be set to 'left' or 'right' for a map-legend with a vertical aspect ratio"
|
|
73
|
-
);
|
|
74
|
-
}
|
|
75
|
-
if (!this.valuesSide) {
|
|
76
|
-
this.valuesSide = Side.left;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Directive, Input, OnChanges } from '@angular/core';
|
|
2
|
-
import { DataMarksConfig, MarksConfig } from '../config/marks-config';
|
|
3
|
-
import { Marks } from '../marks';
|
|
4
|
-
|
|
5
|
-
@Directive()
|
|
6
|
-
export abstract class AuxMarks<
|
|
7
|
-
Datum,
|
|
8
|
-
TMarksConfig extends MarksConfig | DataMarksConfig<Datum>,
|
|
9
|
-
>
|
|
10
|
-
extends Marks
|
|
11
|
-
implements Marks, OnChanges
|
|
12
|
-
{
|
|
13
|
-
@Input() config: TMarksConfig;
|
|
14
|
-
|
|
15
|
-
initFromConfig(): void {
|
|
16
|
-
this.drawMarks();
|
|
17
|
-
}
|
|
18
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { safeAssign } from '@mathstack/app-kit';
|
|
2
|
-
|
|
3
|
-
const DEFAULT = {
|
|
4
|
-
_class: () => '',
|
|
5
|
-
_mixBlendMode: 'normal',
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export abstract class VicAuxMarksBuilder<Datum> {
|
|
9
|
-
protected _mixBlendMode: string;
|
|
10
|
-
protected _class: (d: Datum) => string;
|
|
11
|
-
|
|
12
|
-
constructor() {
|
|
13
|
-
safeAssign(this, DEFAULT);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Sets the mix-blend-mode of the marks.
|
|
18
|
-
*
|
|
19
|
-
* @default 'normal'
|
|
20
|
-
*/
|
|
21
|
-
mixBlendMode(mixBlendMode: string): this {
|
|
22
|
-
this._mixBlendMode = mixBlendMode;
|
|
23
|
-
return this;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { DataMarksOptions, MarksOptions } from './marks-options';
|
|
2
|
-
|
|
3
|
-
export abstract class MarksConfig implements MarksOptions {
|
|
4
|
-
readonly marksClass: string;
|
|
5
|
-
readonly mixBlendMode: string;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export abstract class DataMarksConfig<Datum>
|
|
9
|
-
extends MarksConfig
|
|
10
|
-
implements DataMarksOptions<Datum>
|
|
11
|
-
{
|
|
12
|
-
readonly data: Datum[];
|
|
13
|
-
readonly datumClass: (d: Datum, i: number) => string;
|
|
14
|
-
}
|
package/src/lib/marks/index.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export * from './aux-marks/aux-marks';
|
|
2
|
-
export * from './aux-marks/config/aux-marks-builder';
|
|
3
|
-
export * from './aux-marks/config/aux-marks-config';
|
|
4
|
-
export * from './config/marks-config';
|
|
5
|
-
export * from './config/marks-options';
|
|
6
|
-
export * from './map-marks/map-aux-marks/map-aux-marks';
|
|
7
|
-
export * from './map-marks/map-primary-marks/map-primary-marks';
|
|
8
|
-
export * from './primary-marks/config/primary-marks-builder';
|
|
9
|
-
export * from './primary-marks/config/primary-marks-config';
|
|
10
|
-
export * from './primary-marks/primary-marks';
|
|
11
|
-
export * from './xy-marks/xy-aux-marks/xy-aux-marks';
|
|
12
|
-
export * from './xy-marks/xy-marks';
|
|
13
|
-
export * from './xy-marks/xy-marks-config';
|
|
14
|
-
export * from './xy-marks/xy-primary-marks/xy-primary-marks';
|
|
15
|
-
export * from './xy-marks/xy-primary-marks/xy-primary-marks-config';
|