@mathstack/viz 2.0.3 → 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 -300
- 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,109 +0,0 @@
|
|
|
1
|
-
import { Injectable } from '@angular/core';
|
|
2
|
-
import { safeAssign } from '@mathstack/app-kit';
|
|
3
|
-
import { Series, stackOffsetDiverging, stackOrderNone } from 'd3';
|
|
4
|
-
import { VicBarsConfigBuilder } from '../../bars/config/bars-builder';
|
|
5
|
-
import { DataValue } from '../../core/types/values';
|
|
6
|
-
import { StackedBarsConfig } from './stacked-bars-config';
|
|
7
|
-
|
|
8
|
-
const DEFAULT = {
|
|
9
|
-
_stackOrder: stackOrderNone,
|
|
10
|
-
_stackOffset: stackOffsetDiverging,
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Builds a configuration object for a StackedBarsComponent.
|
|
15
|
-
*
|
|
16
|
-
* Must be added to a providers array in or above the component that consumes it if it is injected via the constructor. (e.g. `providers: [VicStackedBarsBuilder]` in the component decorator)
|
|
17
|
-
*
|
|
18
|
-
* The first generic parameter, Datum, is the type of the data that will be used to create the stacked bars.
|
|
19
|
-
*
|
|
20
|
-
* The second generic parameter, TOrdinalValue, is the type of the ordinal data that will be used to position the bars.
|
|
21
|
-
*/
|
|
22
|
-
@Injectable()
|
|
23
|
-
export class VicStackedBarsConfigBuilder<
|
|
24
|
-
Datum,
|
|
25
|
-
TOrdinalValue extends DataValue,
|
|
26
|
-
> extends VicBarsConfigBuilder<Datum, TOrdinalValue> {
|
|
27
|
-
private _stackOffset: (
|
|
28
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
29
|
-
series: Series<any, any>[],
|
|
30
|
-
order: Iterable<number>
|
|
31
|
-
) => void;
|
|
32
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
33
|
-
private _stackOrder: (x: any) => any;
|
|
34
|
-
|
|
35
|
-
constructor() {
|
|
36
|
-
super();
|
|
37
|
-
safeAssign(this, DEFAULT);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
stackOffset(stackOffset: null): this;
|
|
41
|
-
stackOffset(
|
|
42
|
-
stackOffset: (
|
|
43
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
44
|
-
series: Series<any, any>[],
|
|
45
|
-
order: Iterable<number>
|
|
46
|
-
) => void
|
|
47
|
-
): this;
|
|
48
|
-
stackOffset(
|
|
49
|
-
stackOffset:
|
|
50
|
-
| ((
|
|
51
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
52
|
-
series: Series<any, any>[],
|
|
53
|
-
order: Iterable<number>
|
|
54
|
-
) => void)
|
|
55
|
-
| null
|
|
56
|
-
): this {
|
|
57
|
-
if (stackOffset === null) {
|
|
58
|
-
this._stackOffset = DEFAULT._stackOffset;
|
|
59
|
-
return this;
|
|
60
|
-
}
|
|
61
|
-
this._stackOffset = stackOffset;
|
|
62
|
-
return this;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
stackOrder(stackOrder: null): this;
|
|
66
|
-
stackOrder(
|
|
67
|
-
stackOrder:
|
|
68
|
-
| ((series: Series<Datum, TOrdinalValue>) => Iterable<number>)
|
|
69
|
-
| null
|
|
70
|
-
): this;
|
|
71
|
-
stackOrder(
|
|
72
|
-
stackOrder:
|
|
73
|
-
| ((
|
|
74
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
75
|
-
series: Series<any, any>
|
|
76
|
-
) => Iterable<number>)
|
|
77
|
-
| null
|
|
78
|
-
): this {
|
|
79
|
-
if (stackOrder === null) {
|
|
80
|
-
this._stackOrder = DEFAULT._stackOrder;
|
|
81
|
-
return this;
|
|
82
|
-
}
|
|
83
|
-
this._stackOrder = stackOrder;
|
|
84
|
-
return this;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
override getConfig(): StackedBarsConfig<Datum, TOrdinalValue> {
|
|
88
|
-
this.validateBuilder('Stacked Bars');
|
|
89
|
-
return new StackedBarsConfig(this.dimensions, {
|
|
90
|
-
marksClass: 'vic-stacked-bars',
|
|
91
|
-
backgrounds: this.backgroundsBuilder?._build(),
|
|
92
|
-
color: this.colorDimensionBuilder._build('Color'),
|
|
93
|
-
customFills: this._customFills,
|
|
94
|
-
data: this._data,
|
|
95
|
-
datumClass: this._datumClass,
|
|
96
|
-
mixBlendMode: this._mixBlendMode,
|
|
97
|
-
ordinal: this.ordinalDimensionBuilder._build(
|
|
98
|
-
'band',
|
|
99
|
-
this.getOrdinalDimensionName()
|
|
100
|
-
),
|
|
101
|
-
quantitative: this.quantitativeDimensionBuilder._build(
|
|
102
|
-
this.getQuantitativeDimensionName()
|
|
103
|
-
),
|
|
104
|
-
labels: this.labelsBuilder?._build(),
|
|
105
|
-
stackOffset: this._stackOffset,
|
|
106
|
-
stackOrder: this._stackOrder,
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
}
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
import { VicStackedBarsConfigBuilder } from './stacked-bars-builder';
|
|
3
|
-
import { StackedBarsConfig } from './stacked-bars-config';
|
|
4
|
-
|
|
5
|
-
type Datum = { country: string; value: number; category: string };
|
|
6
|
-
const data = [
|
|
7
|
-
{ country: 'Sweden', value: 1, category: 'a' },
|
|
8
|
-
{ country: 'Finland', value: 2, category: 'a' },
|
|
9
|
-
{ country: 'Norway', value: 3, category: 'a' },
|
|
10
|
-
{ country: 'Iceland', value: 4, category: 'b' },
|
|
11
|
-
{ country: 'Denmark', value: 5, category: 'b' },
|
|
12
|
-
{ country: 'Russia', value: 6, category: 'b' },
|
|
13
|
-
];
|
|
14
|
-
|
|
15
|
-
function getNewConfig(): StackedBarsConfig<Datum, string> {
|
|
16
|
-
return new VicStackedBarsConfigBuilder<Datum, string>()
|
|
17
|
-
.data(data)
|
|
18
|
-
.horizontal((bars) =>
|
|
19
|
-
bars
|
|
20
|
-
.x((dimension) => dimension.valueAccessor((d) => d.value))
|
|
21
|
-
.y((dimension) => dimension.valueAccessor((d) => d.country))
|
|
22
|
-
)
|
|
23
|
-
.color((dimension) => dimension.valueAccessor((d) => d.category))
|
|
24
|
-
.getConfig();
|
|
25
|
-
}
|
|
26
|
-
describe('StackedBarsConfig', () => {
|
|
27
|
-
let config: StackedBarsConfig<Datum, string>;
|
|
28
|
-
beforeEach(() => {
|
|
29
|
-
config = undefined;
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
describe('initPropertiesFromData()', () => {
|
|
33
|
-
beforeEach(() => {
|
|
34
|
-
spyOn(
|
|
35
|
-
StackedBarsConfig.prototype as any,
|
|
36
|
-
'setDimensionPropertiesFromData'
|
|
37
|
-
);
|
|
38
|
-
spyOn(StackedBarsConfig.prototype as any, 'setValueIndices');
|
|
39
|
-
spyOn(StackedBarsConfig.prototype as any, 'setHasNegativeValues');
|
|
40
|
-
spyOn(StackedBarsConfig.prototype as any, 'constructStackedData');
|
|
41
|
-
spyOn(
|
|
42
|
-
StackedBarsConfig.prototype as any,
|
|
43
|
-
'initQuantitativeDomainFromStack'
|
|
44
|
-
);
|
|
45
|
-
config = getNewConfig();
|
|
46
|
-
});
|
|
47
|
-
it('calls setDimensionPropertiesFromData once', () => {
|
|
48
|
-
expect(
|
|
49
|
-
(config as any).setDimensionPropertiesFromData
|
|
50
|
-
).toHaveBeenCalledTimes(1);
|
|
51
|
-
});
|
|
52
|
-
it('calls setValueIndices once', () => {
|
|
53
|
-
expect((config as any).setValueIndices).toHaveBeenCalledTimes(1);
|
|
54
|
-
});
|
|
55
|
-
it('calls setHasNegativeValues once', () => {
|
|
56
|
-
expect((config as any).setHasNegativeValues).toHaveBeenCalledTimes(1);
|
|
57
|
-
});
|
|
58
|
-
it('calls constructStackedData once', () => {
|
|
59
|
-
expect((config as any).constructStackedData).toHaveBeenCalledTimes(1);
|
|
60
|
-
});
|
|
61
|
-
it('calls initQuantitativeDomainFromStack once', () => {
|
|
62
|
-
expect(
|
|
63
|
-
(config as any).initQuantitativeDomainFromStack
|
|
64
|
-
).toHaveBeenCalledTimes(1);
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
describe('setValueIndices()', () => {
|
|
69
|
-
it('returns an array of indices when ordinal and categorical domains are not specified by user', () => {
|
|
70
|
-
config = getNewConfig();
|
|
71
|
-
expect(config.valueIndices).toEqual([0, 1, 2, 3, 4, 5]);
|
|
72
|
-
});
|
|
73
|
-
it('returns an array of indices when ordinal domain is limited by user', () => {
|
|
74
|
-
config = new VicStackedBarsConfigBuilder<Datum, string>()
|
|
75
|
-
.data(data)
|
|
76
|
-
.horizontal((bars) =>
|
|
77
|
-
bars
|
|
78
|
-
.x((dimension) => dimension.valueAccessor((d) => d.value))
|
|
79
|
-
.y((dimension) =>
|
|
80
|
-
dimension
|
|
81
|
-
.valueAccessor((d) => d.country)
|
|
82
|
-
.domain(['Sweden', 'Norway', 'Iceland'])
|
|
83
|
-
)
|
|
84
|
-
)
|
|
85
|
-
.color((dimension) => dimension.valueAccessor((d) => d.category))
|
|
86
|
-
.getConfig();
|
|
87
|
-
expect(config.valueIndices).toEqual([0, 2, 3]);
|
|
88
|
-
});
|
|
89
|
-
it('returns an array of indices when categorical domain is limited by user', () => {
|
|
90
|
-
config = new VicStackedBarsConfigBuilder<Datum, string>()
|
|
91
|
-
.data(data)
|
|
92
|
-
.horizontal((bars) =>
|
|
93
|
-
bars
|
|
94
|
-
.x((dimension) => dimension.valueAccessor((d) => d.value))
|
|
95
|
-
.y((dimension) => dimension.valueAccessor((d) => d.country))
|
|
96
|
-
)
|
|
97
|
-
.color((dimension) =>
|
|
98
|
-
dimension.valueAccessor((d) => d.category).domain(['a'])
|
|
99
|
-
)
|
|
100
|
-
.getConfig();
|
|
101
|
-
expect(config.valueIndices).toEqual([0, 1, 2]);
|
|
102
|
-
});
|
|
103
|
-
it('returns an array of indices when both ordinal and categorical domains are limited by user', () => {
|
|
104
|
-
config = new VicStackedBarsConfigBuilder<Datum, string>()
|
|
105
|
-
.data(data)
|
|
106
|
-
.horizontal((bars) =>
|
|
107
|
-
bars
|
|
108
|
-
.x((dimension) => dimension.valueAccessor((d) => d.value))
|
|
109
|
-
.y((dimension) =>
|
|
110
|
-
dimension
|
|
111
|
-
.valueAccessor((d) => d.country)
|
|
112
|
-
.domain(['Sweden', 'Norway', 'Iceland'])
|
|
113
|
-
)
|
|
114
|
-
)
|
|
115
|
-
.color((dimension) =>
|
|
116
|
-
dimension.valueAccessor((d) => d.category).domain(['a'])
|
|
117
|
-
)
|
|
118
|
-
.getConfig();
|
|
119
|
-
expect(config.valueIndices).toEqual([0, 2]);
|
|
120
|
-
});
|
|
121
|
-
});
|
|
122
|
-
});
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { InternMap, Series, extent, range, rollup, stack } from 'd3';
|
|
2
|
-
import { BarsConfig } from '../../bars/config/bars-config';
|
|
3
|
-
import { BarsDimensions } from '../../bars/config/bars-dimensions';
|
|
4
|
-
import { DataValue } from '../../core/types/values';
|
|
5
|
-
import { StackDatum } from '../stacked-bars.component';
|
|
6
|
-
import { StackedBarsOptions } from './stacked-bars-options';
|
|
7
|
-
|
|
8
|
-
export class StackedBarsConfig<Datum, TOrdinalValue extends DataValue>
|
|
9
|
-
extends BarsConfig<Datum, TOrdinalValue>
|
|
10
|
-
implements StackedBarsOptions<Datum, TOrdinalValue>
|
|
11
|
-
{
|
|
12
|
-
stackOffset: (
|
|
13
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14
|
-
series: Series<any, any>[],
|
|
15
|
-
order: Iterable<number>
|
|
16
|
-
) => void;
|
|
17
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
18
|
-
stackOrder: (x: any) => any;
|
|
19
|
-
stackedData: StackDatum[][];
|
|
20
|
-
|
|
21
|
-
constructor(
|
|
22
|
-
dimensions: BarsDimensions,
|
|
23
|
-
options: StackedBarsOptions<Datum, TOrdinalValue>
|
|
24
|
-
) {
|
|
25
|
-
super(dimensions, options);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
override initPropertiesFromData(): void {
|
|
29
|
-
// parent class will call this method during this class's super call
|
|
30
|
-
// if statement ensures that code in this method is only called at the end of this class's constructor
|
|
31
|
-
if (this.stackOffset !== undefined && this.stackOrder !== undefined) {
|
|
32
|
-
this.setDimensionPropertiesFromData();
|
|
33
|
-
this.setValueIndices();
|
|
34
|
-
this.setHasNegativeValues();
|
|
35
|
-
this.constructStackedData();
|
|
36
|
-
this.initQuantitativeDomainFromStack();
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
override setValueIndices(): void {
|
|
41
|
-
this.valueIndices = range(this.ordinal.values.length).filter((i) => {
|
|
42
|
-
return (
|
|
43
|
-
this.ordinal.domainIncludes(this.ordinal.values[i]) &&
|
|
44
|
-
this.color.domainIncludes(this.color.values[i])
|
|
45
|
-
);
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
constructStackedData(): void {
|
|
50
|
-
const stackedData = stack<[unknown, InternMap<string, number>]>()
|
|
51
|
-
.keys(this.color.calculatedDomain)
|
|
52
|
-
.value((d, key) => {
|
|
53
|
-
return this.quantitative.values[d[1].get(key)];
|
|
54
|
-
})
|
|
55
|
-
.order(this.stackOrder)
|
|
56
|
-
.offset(this.stackOffset)(
|
|
57
|
-
rollup(
|
|
58
|
-
this.valueIndices,
|
|
59
|
-
([i]) => i,
|
|
60
|
-
(i) => this.ordinal.values[i],
|
|
61
|
-
(i) => this.color.values[i]
|
|
62
|
-
)
|
|
63
|
-
);
|
|
64
|
-
|
|
65
|
-
this.stackedData = stackedData.map((series) =>
|
|
66
|
-
series.map((d) => {
|
|
67
|
-
Object.assign(d, {
|
|
68
|
-
i: d.data[1].get(series.key),
|
|
69
|
-
});
|
|
70
|
-
return d as unknown as StackDatum;
|
|
71
|
-
})
|
|
72
|
-
);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
initQuantitativeDomainFromStack(): void {
|
|
76
|
-
const extents = extent(this.stackedData.flat(2));
|
|
77
|
-
this.quantitative.setDomain(extents);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Series } from 'd3';
|
|
2
|
-
import { BarsOptions } from '../../bars/config/bars-options';
|
|
3
|
-
import { DataValue } from '../../core/types/values';
|
|
4
|
-
|
|
5
|
-
export interface StackedBarsOptions<
|
|
6
|
-
Datum,
|
|
7
|
-
TOrdinalValue extends DataValue,
|
|
8
|
-
> extends BarsOptions<Datum, TOrdinalValue> {
|
|
9
|
-
stackOffset: (
|
|
10
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11
|
-
series: Series<any, any>[],
|
|
12
|
-
order: Iterable<number>
|
|
13
|
-
) => void;
|
|
14
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15
|
-
stackOrder: (x: any) => any;
|
|
16
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { BarsInteractionOutput } from '../../../bars';
|
|
2
|
-
import { DataValue } from '../../../core/types/values';
|
|
3
|
-
import { EventAction, EventType } from '../../../events';
|
|
4
|
-
import { StackedBarsHost } from '../stacked-bars-events.directive';
|
|
5
|
-
|
|
6
|
-
export class StackedBarsClickEmitTooltipDataPauseOtherActions<
|
|
7
|
-
Datum,
|
|
8
|
-
TOrdinalValue extends DataValue,
|
|
9
|
-
> implements EventAction<
|
|
10
|
-
StackedBarsHost<Datum, TOrdinalValue>,
|
|
11
|
-
BarsInteractionOutput<Datum>
|
|
12
|
-
> {
|
|
13
|
-
onStart(host: StackedBarsHost<Datum, TOrdinalValue>) {
|
|
14
|
-
const outputData = host.getInteractionOutput(EventType.Click);
|
|
15
|
-
host.disableOtherActions(EventType.Click);
|
|
16
|
-
host.emitInteractionOutput(outputData);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
onEnd(host: StackedBarsHost<Datum, TOrdinalValue>) {
|
|
20
|
-
host.resumeOtherActions(EventType.Click);
|
|
21
|
-
host.emitInteractionOutput(null);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { BarsInteractionOutput } from '../../../bars';
|
|
2
|
-
import { DataValue } from '../../../core/types/values';
|
|
3
|
-
import { EventAction, EventType } from '../../../events';
|
|
4
|
-
|
|
5
|
-
import { StackedBarsHost } from '../stacked-bars-events.directive';
|
|
6
|
-
|
|
7
|
-
export class StackedBarsHoverEmitTooltipData<
|
|
8
|
-
Datum,
|
|
9
|
-
TOrdinalValue extends DataValue,
|
|
10
|
-
> implements EventAction<
|
|
11
|
-
StackedBarsHost<Datum, TOrdinalValue>,
|
|
12
|
-
BarsInteractionOutput<Datum>
|
|
13
|
-
> {
|
|
14
|
-
onStart(host: StackedBarsHost<Datum, TOrdinalValue>): void {
|
|
15
|
-
const tooltipData = host.getInteractionOutput(EventType.Hover);
|
|
16
|
-
host.emitInteractionOutput(tooltipData);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
onEnd(host: StackedBarsHost<Datum, TOrdinalValue>): void {
|
|
20
|
-
host.emitInteractionOutput(null);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { BarsInteractionOutput } from '../../../bars';
|
|
2
|
-
import { DataValue } from '../../../core/types/values';
|
|
3
|
-
import { EventType, HoverMoveAction } from '../../../events';
|
|
4
|
-
import { StackedBarsHost } from '../stacked-bars-events.directive';
|
|
5
|
-
|
|
6
|
-
export class StackedBarsHoverMoveEmitTooltipData<
|
|
7
|
-
Datum,
|
|
8
|
-
TOrdinalValue extends DataValue,
|
|
9
|
-
> implements HoverMoveAction<
|
|
10
|
-
StackedBarsHost<Datum, TOrdinalValue>,
|
|
11
|
-
BarsInteractionOutput<Datum>
|
|
12
|
-
> {
|
|
13
|
-
onStart(host: StackedBarsHost<Datum, TOrdinalValue>): void {
|
|
14
|
-
const tooltipData = host.getInteractionOutput(EventType.HoverMove);
|
|
15
|
-
host.emitInteractionOutput(tooltipData);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
onEnd(host: StackedBarsHost<Datum, TOrdinalValue>): void {
|
|
19
|
-
host.emitInteractionOutput(null);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
@@ -1,266 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
import { EventEmitter, Renderer2 } from '@angular/core';
|
|
3
|
-
import { TestBed } from '@angular/core/testing';
|
|
4
|
-
import { selectAll } from 'd3';
|
|
5
|
-
import { of } from 'rxjs';
|
|
6
|
-
import { EventType } from '../../events/events.types';
|
|
7
|
-
import { STACKED_BARS } from '../stacked-bars.component';
|
|
8
|
-
import { StackedBarsEventsDirective } from './stacked-bars-events.directive';
|
|
9
|
-
|
|
10
|
-
describe('StackedBarsEventsDirective', () => {
|
|
11
|
-
let directive: StackedBarsEventsDirective<any, any, any>;
|
|
12
|
-
let stackedBarsStub: any;
|
|
13
|
-
let barElement: any;
|
|
14
|
-
let stackDatum: any;
|
|
15
|
-
|
|
16
|
-
beforeEach(() => {
|
|
17
|
-
stackDatum = { foo: 'bar' };
|
|
18
|
-
barElement = {
|
|
19
|
-
getBoundingClientRect: () => ({ width: 100, height: 50 }),
|
|
20
|
-
getAttribute: (attr: string) =>
|
|
21
|
-
attr === 'x' ? '10' : attr === 'y' ? '20' : '0',
|
|
22
|
-
__data__: stackDatum,
|
|
23
|
-
};
|
|
24
|
-
stackedBarsStub = {
|
|
25
|
-
bars$: of(selectAll([barElement])),
|
|
26
|
-
getSourceDatumFromStackedBarDatum: jasmine
|
|
27
|
-
.createSpy('getSourceDatumFromStackedBarDatum')
|
|
28
|
-
.and.returnValue({ d: 1 }),
|
|
29
|
-
getTooltipData: jasmine
|
|
30
|
-
.createSpy('getTooltipData')
|
|
31
|
-
.and.returnValue({ tooltip: 'data' }),
|
|
32
|
-
};
|
|
33
|
-
TestBed.configureTestingModule({
|
|
34
|
-
providers: [
|
|
35
|
-
{ provide: STACKED_BARS, useValue: stackedBarsStub },
|
|
36
|
-
Renderer2,
|
|
37
|
-
StackedBarsEventsDirective,
|
|
38
|
-
],
|
|
39
|
-
});
|
|
40
|
-
directive = TestBed.inject(StackedBarsEventsDirective);
|
|
41
|
-
directive.interactionOutput = new EventEmitter();
|
|
42
|
-
directive.hoverActions = [
|
|
43
|
-
{
|
|
44
|
-
onStart: jasmine.createSpy('hoverOnStart'),
|
|
45
|
-
onEnd: jasmine.createSpy('hoverOnEnd'),
|
|
46
|
-
},
|
|
47
|
-
];
|
|
48
|
-
directive.hoverMoveActions = [
|
|
49
|
-
{
|
|
50
|
-
onStart: jasmine.createSpy('hoverMoveOnStart'),
|
|
51
|
-
onEnd: jasmine.createSpy('hoverMoveOnEnd'),
|
|
52
|
-
initialize: jasmine.createSpy('hoverMoveInit'),
|
|
53
|
-
},
|
|
54
|
-
];
|
|
55
|
-
directive.clickActions = [
|
|
56
|
-
{
|
|
57
|
-
onStart: jasmine.createSpy('clickOnStart'),
|
|
58
|
-
onEnd: jasmine.createSpy('clickOnEnd'),
|
|
59
|
-
},
|
|
60
|
-
];
|
|
61
|
-
directive.inputEventActions = [
|
|
62
|
-
{
|
|
63
|
-
onStart: jasmine.createSpy('inputOnStart'),
|
|
64
|
-
onEnd: jasmine.createSpy('inputOnEnd'),
|
|
65
|
-
},
|
|
66
|
-
];
|
|
67
|
-
directive.preventAction = {
|
|
68
|
-
hover: false,
|
|
69
|
-
hoverMove: false,
|
|
70
|
-
click: false,
|
|
71
|
-
input: false,
|
|
72
|
-
};
|
|
73
|
-
(directive as any).events = [];
|
|
74
|
-
(directive as any).inputEvent$ = of(true);
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
it('should get elements as observable', (done) => {
|
|
78
|
-
directive.getElements().subscribe((els: any[]) => {
|
|
79
|
-
expect(els[0]).toBe(barElement);
|
|
80
|
-
done();
|
|
81
|
-
});
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
it('should initialize from element', () => {
|
|
85
|
-
directive.initFromElement(barElement);
|
|
86
|
-
expect(directive.origin).toBe(barElement);
|
|
87
|
-
expect(directive.stackDatum).toBe(stackDatum);
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
it('should set positions from element', () => {
|
|
91
|
-
directive.origin = barElement;
|
|
92
|
-
directive.setPositionsFromElement();
|
|
93
|
-
expect(directive.positionX).toBe(50);
|
|
94
|
-
expect(directive.positionY).toBe(25);
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
it('should set positions from pointer', () => {
|
|
98
|
-
directive.origin = barElement;
|
|
99
|
-
(directive as any).setPositionsFromPointer({
|
|
100
|
-
clientX: 15,
|
|
101
|
-
clientY: 25,
|
|
102
|
-
target: barElement,
|
|
103
|
-
pageX: 15,
|
|
104
|
-
pageY: 25,
|
|
105
|
-
});
|
|
106
|
-
expect(directive.positionX).toBe(5);
|
|
107
|
-
expect(directive.positionY).toBe(5);
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
it('should emit interaction output', (done) => {
|
|
111
|
-
const output = {
|
|
112
|
-
origin: barElement,
|
|
113
|
-
positionX: 1,
|
|
114
|
-
positionY: 2,
|
|
115
|
-
type: EventType.Hover,
|
|
116
|
-
stackDatum,
|
|
117
|
-
sourceDatum: { d: 1 },
|
|
118
|
-
tooltip: 'data',
|
|
119
|
-
datum: { foo: 'datum' },
|
|
120
|
-
color: 'red',
|
|
121
|
-
values: { x: 1, y: 2, category: 'foo' },
|
|
122
|
-
};
|
|
123
|
-
directive.interactionOutput.subscribe((val: any) => {
|
|
124
|
-
expect(val).toEqual(output);
|
|
125
|
-
done();
|
|
126
|
-
});
|
|
127
|
-
directive.emitInteractionOutput(output as any);
|
|
128
|
-
});
|
|
129
|
-
|
|
130
|
-
it('should handle onEnter for hover', () => {
|
|
131
|
-
spyOn(directive as any, 'isEventAllowed').and.callFake(
|
|
132
|
-
(type) => type === EventType.Hover
|
|
133
|
-
);
|
|
134
|
-
spyOn(directive as any, 'setPositionsFromElement');
|
|
135
|
-
spyOn(directive as any, 'runActions');
|
|
136
|
-
directive.onEnter({} as any, barElement);
|
|
137
|
-
expect((directive as any).setPositionsFromElement).toHaveBeenCalled();
|
|
138
|
-
expect((directive as any).runActions).toHaveBeenCalledWith(
|
|
139
|
-
directive.hoverActions,
|
|
140
|
-
jasmine.any(Function)
|
|
141
|
-
);
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
it('should handle onEnter for hoverMove', () => {
|
|
145
|
-
spyOn(directive as any, 'isEventAllowed').and.callFake(
|
|
146
|
-
(type) => type === EventType.HoverMove
|
|
147
|
-
);
|
|
148
|
-
spyOn(directive as any, 'runActions');
|
|
149
|
-
directive.onEnter({} as any, barElement);
|
|
150
|
-
expect((directive as any).runActions).toHaveBeenCalledWith(
|
|
151
|
-
directive.hoverMoveActions,
|
|
152
|
-
jasmine.any(Function)
|
|
153
|
-
);
|
|
154
|
-
});
|
|
155
|
-
|
|
156
|
-
it('should handle onMove', () => {
|
|
157
|
-
spyOn(directive as any, 'isEventAllowed').and.returnValue(true);
|
|
158
|
-
spyOn(directive as any, 'setPositionsFromPointer');
|
|
159
|
-
directive.onMove({} as any, barElement);
|
|
160
|
-
expect((directive as any).setPositionsFromPointer).toHaveBeenCalled();
|
|
161
|
-
expect(directive.hoverMoveActions[0].onStart).toHaveBeenCalled();
|
|
162
|
-
});
|
|
163
|
-
|
|
164
|
-
it('should handle onLeave for hover', () => {
|
|
165
|
-
spyOn(directive as any, 'isEventAllowed').and.callFake(
|
|
166
|
-
(type) => type === EventType.Hover
|
|
167
|
-
);
|
|
168
|
-
spyOn(directive as any, 'resetDirective');
|
|
169
|
-
directive.onLeave({} as any, barElement);
|
|
170
|
-
expect(directive.hoverActions[0].onEnd).toHaveBeenCalled();
|
|
171
|
-
expect((directive as any).resetDirective).toHaveBeenCalled();
|
|
172
|
-
});
|
|
173
|
-
|
|
174
|
-
it('should handle onLeave for hoverMove', () => {
|
|
175
|
-
spyOn(directive as any, 'isEventAllowed').and.callFake(
|
|
176
|
-
(type) => type === EventType.HoverMove
|
|
177
|
-
);
|
|
178
|
-
spyOn(directive as any, 'resetDirective');
|
|
179
|
-
directive.onLeave({} as any, barElement);
|
|
180
|
-
expect(directive.hoverMoveActions[0].onEnd).toHaveBeenCalled();
|
|
181
|
-
expect((directive as any).resetDirective).toHaveBeenCalled();
|
|
182
|
-
});
|
|
183
|
-
|
|
184
|
-
it('should handle onClick when click is allowed and hover event exists', () => {
|
|
185
|
-
spyOn(directive as any, 'hasEvent').and.returnValue(true);
|
|
186
|
-
spyOn(directive as any, 'setPositionsFromElement');
|
|
187
|
-
spyOn(directive as any, 'runActions');
|
|
188
|
-
directive.onClick({} as any, barElement);
|
|
189
|
-
expect((directive as any).setPositionsFromElement).toHaveBeenCalled();
|
|
190
|
-
expect((directive as any).runActions).toHaveBeenCalledWith(
|
|
191
|
-
directive.clickActions,
|
|
192
|
-
jasmine.any(Function)
|
|
193
|
-
);
|
|
194
|
-
});
|
|
195
|
-
|
|
196
|
-
it('should handle onClick when click is allowed and hover event does not exist', () => {
|
|
197
|
-
spyOn(directive as any, 'hasEvent').and.returnValue(false);
|
|
198
|
-
spyOn(directive as any, 'setPositionsFromPointer');
|
|
199
|
-
spyOn(directive as any, 'runActions');
|
|
200
|
-
directive.onClick({} as any, barElement);
|
|
201
|
-
expect((directive as any).setPositionsFromPointer).toHaveBeenCalled();
|
|
202
|
-
expect((directive as any).runActions).toHaveBeenCalledWith(
|
|
203
|
-
directive.clickActions,
|
|
204
|
-
jasmine.any(Function)
|
|
205
|
-
);
|
|
206
|
-
});
|
|
207
|
-
|
|
208
|
-
it('should handle onClickRemove', () => {
|
|
209
|
-
spyOn(directive as any, 'runActions');
|
|
210
|
-
spyOn(directive as any, 'resetDirective');
|
|
211
|
-
directive.onClickRemove();
|
|
212
|
-
expect((directive as any).runActions).toHaveBeenCalledWith(
|
|
213
|
-
directive.clickActions,
|
|
214
|
-
jasmine.any(Function)
|
|
215
|
-
);
|
|
216
|
-
expect((directive as any).resetDirective).toHaveBeenCalled();
|
|
217
|
-
});
|
|
218
|
-
|
|
219
|
-
it('should handle onInputEvent with value', () => {
|
|
220
|
-
spyOn(directive as any, 'isEventAllowed').and.returnValue(true);
|
|
221
|
-
directive.onInputEvent('foo');
|
|
222
|
-
expect(directive.inputEventActions[0].onStart).toHaveBeenCalledWith(
|
|
223
|
-
directive,
|
|
224
|
-
'foo'
|
|
225
|
-
);
|
|
226
|
-
});
|
|
227
|
-
|
|
228
|
-
it('should handle onInputEvent with null', () => {
|
|
229
|
-
spyOn(directive as any, 'isEventAllowed').and.returnValue(true);
|
|
230
|
-
directive.onInputEvent(null);
|
|
231
|
-
expect(directive.inputEventActions[0].onEnd).toHaveBeenCalledWith(
|
|
232
|
-
directive,
|
|
233
|
-
null
|
|
234
|
-
);
|
|
235
|
-
});
|
|
236
|
-
|
|
237
|
-
it('should getStackDatum', () => {
|
|
238
|
-
directive.stackDatum = stackDatum;
|
|
239
|
-
expect(directive.getStackDatum()).toBe(stackDatum);
|
|
240
|
-
directive.stackDatum = null;
|
|
241
|
-
expect(directive.getStackDatum()).toBeNull();
|
|
242
|
-
});
|
|
243
|
-
|
|
244
|
-
it('should getInteractionOutput', () => {
|
|
245
|
-
directive.origin = barElement;
|
|
246
|
-
directive.positionX = 1;
|
|
247
|
-
directive.positionY = 2;
|
|
248
|
-
directive.stackDatum = stackDatum;
|
|
249
|
-
const output = directive.getInteractionOutput(EventType.Hover);
|
|
250
|
-
expect(output).toEqual(
|
|
251
|
-
jasmine.objectContaining({
|
|
252
|
-
tooltip: 'data',
|
|
253
|
-
origin: barElement,
|
|
254
|
-
anchor: {
|
|
255
|
-
x: 1,
|
|
256
|
-
y: 2,
|
|
257
|
-
},
|
|
258
|
-
type: EventType.Hover,
|
|
259
|
-
})
|
|
260
|
-
);
|
|
261
|
-
expect(
|
|
262
|
-
stackedBarsStub.getSourceDatumFromStackedBarDatum
|
|
263
|
-
).toHaveBeenCalledWith(stackDatum);
|
|
264
|
-
expect(stackedBarsStub.getTooltipData).toHaveBeenCalled();
|
|
265
|
-
});
|
|
266
|
-
});
|