@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,240 +0,0 @@
|
|
|
1
|
-
import { Directive, EventEmitter, inject, Input, Output } from '@angular/core';
|
|
2
|
-
import { pointer, select } from 'd3';
|
|
3
|
-
import { map, Observable } from 'rxjs';
|
|
4
|
-
import { BarsInteractionOutput } from '../../bars';
|
|
5
|
-
import { BarsTooltipPositioner } from '../../bars/events/bars-tooltip-positioner';
|
|
6
|
-
import { DataValue } from '../../core/types/values';
|
|
7
|
-
import {
|
|
8
|
-
DEFAULT_TOOLTIP_Y_OFFSET,
|
|
9
|
-
EventAction,
|
|
10
|
-
EventsDirective,
|
|
11
|
-
EventType,
|
|
12
|
-
HoverMoveAction,
|
|
13
|
-
InputEventAction,
|
|
14
|
-
MarksHost,
|
|
15
|
-
UnlistenFunction,
|
|
16
|
-
} from '../../events';
|
|
17
|
-
import { TooltipPosition } from '../../tooltips';
|
|
18
|
-
import {
|
|
19
|
-
StackDatum,
|
|
20
|
-
STACKED_BARS,
|
|
21
|
-
StackedBarsComponent,
|
|
22
|
-
} from '../stacked-bars.component';
|
|
23
|
-
|
|
24
|
-
export interface StackedBarsHost<
|
|
25
|
-
Datum,
|
|
26
|
-
TOrdinalValue extends DataValue,
|
|
27
|
-
TStackedBarsComponent extends StackedBarsComponent<Datum, TOrdinalValue> =
|
|
28
|
-
StackedBarsComponent<Datum, TOrdinalValue>,
|
|
29
|
-
> extends MarksHost<BarsInteractionOutput<Datum>, TStackedBarsComponent> {
|
|
30
|
-
getStackDatum(): StackDatum | null;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
@Directive({
|
|
34
|
-
selector: '[vicStackedBarsEvents]',
|
|
35
|
-
})
|
|
36
|
-
export class StackedBarsEventsDirective<
|
|
37
|
-
Datum,
|
|
38
|
-
TOrdinalValue extends DataValue,
|
|
39
|
-
TStackedBarsComponent extends StackedBarsComponent<Datum, TOrdinalValue> =
|
|
40
|
-
StackedBarsComponent<Datum, TOrdinalValue>,
|
|
41
|
-
> extends EventsDirective<StackedBarsHost<Datum, TOrdinalValue>> {
|
|
42
|
-
@Input()
|
|
43
|
-
hoverActions:
|
|
44
|
-
| EventAction<
|
|
45
|
-
StackedBarsHost<Datum, TOrdinalValue>,
|
|
46
|
-
BarsInteractionOutput<Datum>
|
|
47
|
-
>[]
|
|
48
|
-
| null;
|
|
49
|
-
@Input()
|
|
50
|
-
hoverMoveActions:
|
|
51
|
-
| HoverMoveAction<
|
|
52
|
-
StackedBarsHost<Datum, TOrdinalValue>,
|
|
53
|
-
BarsInteractionOutput<Datum>
|
|
54
|
-
>[]
|
|
55
|
-
| null;
|
|
56
|
-
@Input()
|
|
57
|
-
clickActions:
|
|
58
|
-
| EventAction<
|
|
59
|
-
StackedBarsHost<Datum, TOrdinalValue>,
|
|
60
|
-
BarsInteractionOutput<Datum>
|
|
61
|
-
>[]
|
|
62
|
-
| null;
|
|
63
|
-
@Input()
|
|
64
|
-
inputEventActions: InputEventAction<
|
|
65
|
-
StackedBarsHost<Datum, TOrdinalValue>,
|
|
66
|
-
BarsInteractionOutput<Datum>
|
|
67
|
-
>[];
|
|
68
|
-
@Output() interactionOutput =
|
|
69
|
-
new EventEmitter<BarsInteractionOutput<Datum> | null>();
|
|
70
|
-
|
|
71
|
-
stackDatum: StackDatum | null = null;
|
|
72
|
-
origin: SVGRectElement;
|
|
73
|
-
|
|
74
|
-
public stackedBars = inject<TStackedBarsComponent>(STACKED_BARS);
|
|
75
|
-
|
|
76
|
-
get marks(): TStackedBarsComponent {
|
|
77
|
-
return this.stackedBars;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
getElements(): Observable<Element[]> {
|
|
81
|
-
return this.stackedBars.bars$.pipe(map((sel) => sel.nodes()));
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
getStackDatum(): StackDatum | null {
|
|
85
|
-
return this.stackDatum ?? null;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
setupListeners(elements: Element[]): UnlistenFunction[] {
|
|
89
|
-
if (this.inputEventActions?.length && this.inputEvent$) {
|
|
90
|
-
this.events.push(EventType.Input);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
return this.bindEventListeners(
|
|
94
|
-
elements,
|
|
95
|
-
this.buildInteractionListeners({
|
|
96
|
-
hover: this.hoverActions?.length && {
|
|
97
|
-
pointerenter: (e, el) => this.onEnter(e, el),
|
|
98
|
-
pointerleave: (e, el) => this.onLeave(e, el),
|
|
99
|
-
},
|
|
100
|
-
hoverMove: this.hoverMoveActions?.length && {
|
|
101
|
-
pointerenter: (e, el) => this.onEnter(e, el),
|
|
102
|
-
pointermove: (e, el) => this.onMove(e, el),
|
|
103
|
-
pointerleave: (e, el) => this.onLeave(e, el),
|
|
104
|
-
},
|
|
105
|
-
click: this.clickActions?.length && {
|
|
106
|
-
click: (e, el) => this.onClick(e, el),
|
|
107
|
-
},
|
|
108
|
-
})
|
|
109
|
-
);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
onEnter(_: PointerEvent, el: Element): void {
|
|
113
|
-
this.initFromElement(el);
|
|
114
|
-
if (this.isEventAllowed(EventType.Hover)) {
|
|
115
|
-
this.setPositionsFromElement();
|
|
116
|
-
this.runActions(this.hoverActions, (a) => a.onStart(this.asHost()));
|
|
117
|
-
} else if (this.isEventAllowed(EventType.HoverMove)) {
|
|
118
|
-
this.runActions(this.hoverMoveActions, (a) => {
|
|
119
|
-
if (a.initialize) {
|
|
120
|
-
a.initialize(this.asHost());
|
|
121
|
-
}
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
127
|
-
onMove(event: PointerEvent, _: Element): void {
|
|
128
|
-
if (this.isEventAllowed(EventType.HoverMove)) {
|
|
129
|
-
this.setPositionsFromPointer(event);
|
|
130
|
-
this.hoverMoveActions.forEach((action) => action.onStart(this.asHost()));
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
135
|
-
onLeave(_: PointerEvent, __: Element): void {
|
|
136
|
-
if (this.isEventAllowed(EventType.Hover)) {
|
|
137
|
-
this.hoverActions.forEach((action) => action.onEnd(this.asHost()));
|
|
138
|
-
} else if (this.isEventAllowed(EventType.HoverMove)) {
|
|
139
|
-
this.hoverMoveActions.forEach((action) => action.onEnd(this.asHost()));
|
|
140
|
-
}
|
|
141
|
-
this.resetDirective();
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
onClick(event: PointerEvent, el: Element): void {
|
|
145
|
-
this.initFromElement(el);
|
|
146
|
-
if (!this.preventAction.click) {
|
|
147
|
-
if (this.hasEvent(EventType.Hover)) {
|
|
148
|
-
this.setPositionsFromElement();
|
|
149
|
-
} else {
|
|
150
|
-
this.setPositionsFromPointer(event);
|
|
151
|
-
}
|
|
152
|
-
this.runActions(this.clickActions, (a) => a.onStart(this.asHost()));
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
onClickRemove(): void {
|
|
157
|
-
if (!this.preventAction.click) {
|
|
158
|
-
this.runActions(this.clickActions, (a) => a.onEnd(this.asHost()));
|
|
159
|
-
this.resetDirective();
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
onInputEvent(inputValue: unknown): void {
|
|
164
|
-
if (this.isEventAllowed(EventType.Input)) {
|
|
165
|
-
if (inputValue === null || inputValue === undefined) {
|
|
166
|
-
this.inputEventActions.forEach((action) =>
|
|
167
|
-
action.onEnd(this, inputValue)
|
|
168
|
-
);
|
|
169
|
-
} else {
|
|
170
|
-
this.inputEventActions.forEach((action) =>
|
|
171
|
-
action.onStart(this, inputValue)
|
|
172
|
-
);
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
initFromElement(el: Element): void {
|
|
178
|
-
this.origin = el as SVGRectElement;
|
|
179
|
-
this.stackDatum = select(el as SVGRectElement).datum() as StackDatum;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
setPositionsFromElement(): void {
|
|
183
|
-
const barRect = this.origin.getBoundingClientRect();
|
|
184
|
-
this.positionX = barRect.width / 2;
|
|
185
|
-
this.positionY = barRect.height / 2;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
override setPositionsFromPointer(event: PointerEvent): void {
|
|
189
|
-
const [positionX, positionY] = pointer(event);
|
|
190
|
-
this.positionX =
|
|
191
|
-
positionX - parseFloat(this.origin.getAttribute('x') || '0');
|
|
192
|
-
this.positionY =
|
|
193
|
-
positionY - parseFloat(this.origin.getAttribute('y') || '0');
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
getInteractionOutput(type: EventType): BarsInteractionOutput<Datum> {
|
|
197
|
-
const datum = this.stackedBars.getSourceDatumFromStackedBarDatum(
|
|
198
|
-
this.stackDatum
|
|
199
|
-
);
|
|
200
|
-
const tooltipData = this.stackedBars.getTooltipData(datum);
|
|
201
|
-
const position = new BarsTooltipPositioner({
|
|
202
|
-
x: this.positionX,
|
|
203
|
-
y: this.positionY,
|
|
204
|
-
});
|
|
205
|
-
|
|
206
|
-
return {
|
|
207
|
-
...tooltipData,
|
|
208
|
-
origin: this.origin,
|
|
209
|
-
anchor: {
|
|
210
|
-
x: this.positionX,
|
|
211
|
-
y: this.positionY,
|
|
212
|
-
},
|
|
213
|
-
defaultPosition: position.fromAnchor({
|
|
214
|
-
x: 0,
|
|
215
|
-
y: DEFAULT_TOOLTIP_Y_OFFSET,
|
|
216
|
-
}),
|
|
217
|
-
fromAnchor: (offset?: Partial<{ x: number; y: number }>) => {
|
|
218
|
-
return position.fromAnchor({
|
|
219
|
-
x: offset?.x ?? 0,
|
|
220
|
-
y: offset?.y ?? DEFAULT_TOOLTIP_Y_OFFSET,
|
|
221
|
-
});
|
|
222
|
-
},
|
|
223
|
-
customPosition: (positions: TooltipPosition[]) => {
|
|
224
|
-
return position.customPosition(positions);
|
|
225
|
-
},
|
|
226
|
-
type,
|
|
227
|
-
};
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
emitInteractionOutput(output: BarsInteractionOutput<Datum> | null): void {
|
|
231
|
-
this.interactionOutput.emit(output);
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
private resetDirective(): void {
|
|
235
|
-
this.stackDatum = undefined;
|
|
236
|
-
this.origin = undefined;
|
|
237
|
-
this.positionX = undefined;
|
|
238
|
-
this.positionY = undefined;
|
|
239
|
-
}
|
|
240
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export type { BarsInteractionOutput as StackedBarsInteractionOutput } from '../bars';
|
|
2
|
-
export * from './config/stacked-bars-builder';
|
|
3
|
-
export * from './config/stacked-bars-config';
|
|
4
|
-
export * from './config/stacked-bars-options';
|
|
5
|
-
export * from './events/actions/stacked-bars-click-actions';
|
|
6
|
-
export * from './events/actions/stacked-bars-hover-actions';
|
|
7
|
-
export * from './events/actions/stacked-bars-hover-move-actions';
|
|
8
|
-
export * from './events/stacked-bars-events.directive';
|
|
9
|
-
export * from './stacked-bars.component';
|
|
10
|
-
export * from './stacked-bars.module';
|
|
File without changes
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
3
|
-
import { XyChartComponent } from '../charts/xy-chart/xy-chart.component';
|
|
4
|
-
import { StackedBarsComponent } from './stacked-bars.component';
|
|
5
|
-
|
|
6
|
-
describe('StackedBarsComponent', () => {
|
|
7
|
-
let component: StackedBarsComponent<any, string>;
|
|
8
|
-
let fixture: ComponentFixture<StackedBarsComponent<any, string>>;
|
|
9
|
-
|
|
10
|
-
beforeEach(async () => {
|
|
11
|
-
await TestBed.configureTestingModule({
|
|
12
|
-
imports: [StackedBarsComponent],
|
|
13
|
-
providers: [XyChartComponent],
|
|
14
|
-
}).compileComponents();
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
beforeEach(() => {
|
|
18
|
-
fixture = TestBed.createComponent(StackedBarsComponent<any, string>);
|
|
19
|
-
component = fixture.componentInstance;
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('should create', () => {
|
|
23
|
-
expect(component).toBeTruthy();
|
|
24
|
-
});
|
|
25
|
-
});
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ChangeDetectionStrategy,
|
|
3
|
-
Component,
|
|
4
|
-
InjectionToken,
|
|
5
|
-
Input,
|
|
6
|
-
ViewEncapsulation,
|
|
7
|
-
} from '@angular/core';
|
|
8
|
-
import { BaseType, SeriesPoint, Transition, select } from 'd3';
|
|
9
|
-
import { Selection } from 'd3-selection';
|
|
10
|
-
import { BarsComponent } from '../bars/bars.component';
|
|
11
|
-
import { ChartComponent, XyChartComponent } from '../charts';
|
|
12
|
-
import { DataValue } from '../core/types/values';
|
|
13
|
-
import { VIC_PRIMARY_MARKS } from '../marks/primary-marks/primary-marks';
|
|
14
|
-
import { StackedBarsConfig } from './config/stacked-bars-config';
|
|
15
|
-
|
|
16
|
-
export type StackDatum = SeriesPoint<{ [key: string]: number }> & {
|
|
17
|
-
i: number;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export type StackedBarGroupSelection = Selection<
|
|
21
|
-
BaseType | SVGRectElement,
|
|
22
|
-
StackDatum,
|
|
23
|
-
SVGGElement | BaseType,
|
|
24
|
-
StackDatum[]
|
|
25
|
-
>;
|
|
26
|
-
|
|
27
|
-
// Ideally we would be able to use generic T with the component, but Angular doesn't yet support this, so we use "unknown"
|
|
28
|
-
// https://github.com/angular/angular/issues/46815, https://github.com/angular/angular/pull/47461
|
|
29
|
-
export const STACKED_BARS = new InjectionToken<
|
|
30
|
-
StackedBarsComponent<unknown, DataValue>
|
|
31
|
-
>('StackedBarsComponent');
|
|
32
|
-
|
|
33
|
-
@Component({
|
|
34
|
-
// eslint-disable-next-line @angular-eslint/component-selector
|
|
35
|
-
selector: '[vic-primary-marks-stacked-bars]',
|
|
36
|
-
template: '',
|
|
37
|
-
styleUrls: ['./stacked-bars.component.scss'],
|
|
38
|
-
encapsulation: ViewEncapsulation.None,
|
|
39
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
40
|
-
providers: [
|
|
41
|
-
{ provide: VIC_PRIMARY_MARKS, useExisting: StackedBarsComponent },
|
|
42
|
-
{ provide: STACKED_BARS, useExisting: StackedBarsComponent },
|
|
43
|
-
{ provide: ChartComponent, useExisting: XyChartComponent },
|
|
44
|
-
],
|
|
45
|
-
host: {
|
|
46
|
-
'[class]': 'config.marksClass',
|
|
47
|
-
'[style.mixBlendMode]': 'config.mixBlendMode',
|
|
48
|
-
},
|
|
49
|
-
})
|
|
50
|
-
export class StackedBarsComponent<
|
|
51
|
-
Datum,
|
|
52
|
-
TOrdinalValue extends DataValue,
|
|
53
|
-
> extends BarsComponent<Datum, TOrdinalValue> {
|
|
54
|
-
@Input() override config: StackedBarsConfig<Datum, TOrdinalValue>;
|
|
55
|
-
stackedBarGroups: StackedBarGroupSelection;
|
|
56
|
-
|
|
57
|
-
override drawBars(transitionDuration: number): void {
|
|
58
|
-
const t = select(this.chart.svgRef.nativeElement)
|
|
59
|
-
.transition()
|
|
60
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
61
|
-
.duration(transitionDuration) as Transition<SVGSVGElement, any, any, any>;
|
|
62
|
-
|
|
63
|
-
this.stackedBarGroups = select(this.elRef.nativeElement)
|
|
64
|
-
.selectAll<SVGGElement, StackDatum[]>(
|
|
65
|
-
`.${this.config.marksClass}-category-group`
|
|
66
|
-
)
|
|
67
|
-
.data<StackDatum[]>(this.config.stackedData)
|
|
68
|
-
.join('g')
|
|
69
|
-
.attr('class', `${this.config.marksClass}-category-group`.trim())
|
|
70
|
-
.attr('fill', ([{ i }]: StackDatum[]) =>
|
|
71
|
-
this.scales.color(this.config.color.values[i])
|
|
72
|
-
)
|
|
73
|
-
.selectAll(`.${this.class.g}`)
|
|
74
|
-
.data((d) => d)
|
|
75
|
-
.join((enter) =>
|
|
76
|
-
enter
|
|
77
|
-
.append('g')
|
|
78
|
-
.attr('class', (d) =>
|
|
79
|
-
`${this.class.g} ${this.config.datumClass(this.config.data[d.i], d.i)}`.trim()
|
|
80
|
-
)
|
|
81
|
-
);
|
|
82
|
-
|
|
83
|
-
this.stackedBarGroups
|
|
84
|
-
.selectAll(`.${this.class.bar}`)
|
|
85
|
-
.data((d) => [d])
|
|
86
|
-
.join(
|
|
87
|
-
(enter) =>
|
|
88
|
-
enter
|
|
89
|
-
.append('rect')
|
|
90
|
-
.attr('class', () => this.class.bar)
|
|
91
|
-
.attr('x', (d) => this.getStackElementX(d))
|
|
92
|
-
.attr('y', (d) => this.getStackElementY(d))
|
|
93
|
-
.attr('width', (d) => this.getStackElementWidth(d))
|
|
94
|
-
.attr('height', (d) => this.getStackElementHeight(d)),
|
|
95
|
-
(update) =>
|
|
96
|
-
update.call((update) =>
|
|
97
|
-
update
|
|
98
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
99
|
-
.transition(t as any)
|
|
100
|
-
.attr('x', (d) => this.getStackElementX(d))
|
|
101
|
-
.attr('y', (d) => this.getStackElementY(d))
|
|
102
|
-
.attr('width', (d) => this.getStackElementWidth(d))
|
|
103
|
-
.attr('height', (d) => this.getStackElementHeight(d))
|
|
104
|
-
),
|
|
105
|
-
(exit) =>
|
|
106
|
-
exit // fancy exit needs to be tested with actual/any data
|
|
107
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
108
|
-
.transition(t as any)
|
|
109
|
-
.delay((_, i) => i * 20)
|
|
110
|
-
.attr('y', this.scales.y(0))
|
|
111
|
-
.attr('height', 0)
|
|
112
|
-
.remove()
|
|
113
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
114
|
-
);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
getStackElementX(datum: StackDatum): number {
|
|
118
|
-
if (this.config.dimensions.ordinal === 'x') {
|
|
119
|
-
return this.scales.x(
|
|
120
|
-
this.config[this.config.dimensions.x].values[datum.i]
|
|
121
|
-
);
|
|
122
|
-
} else {
|
|
123
|
-
return Math.min(this.scales.x(datum[0]), this.scales.x(datum[1]));
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
getStackElementY(datum: StackDatum): number {
|
|
128
|
-
if (this.config.dimensions.ordinal === 'x') {
|
|
129
|
-
return Math.min(this.scales.y(datum[0]), this.scales.y(datum[1]));
|
|
130
|
-
} else {
|
|
131
|
-
return this.scales.y(
|
|
132
|
-
this.config[this.config.dimensions.y].values[datum.i]
|
|
133
|
-
);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
getStackElementWidth(datum: StackDatum): number {
|
|
138
|
-
if (this.config.dimensions.ordinal === 'x') {
|
|
139
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
140
|
-
return (this.scales.x as any).bandwidth();
|
|
141
|
-
} else {
|
|
142
|
-
return Math.abs(this.scales.x(datum[0]) - this.scales.x(datum[1]));
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
getStackElementHeight(datum: StackDatum): number {
|
|
147
|
-
if (this.config.dimensions.ordinal === 'x') {
|
|
148
|
-
return Math.abs(this.scales.y(datum[0]) - this.scales.y(datum[1]));
|
|
149
|
-
} else {
|
|
150
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
151
|
-
return (this.scales.y as any).bandwidth();
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
getSourceDatumFromStackedBarDatum(datum: StackDatum): Datum {
|
|
156
|
-
return this.config.data[datum.i];
|
|
157
|
-
}
|
|
158
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { NgModule } from '@angular/core';
|
|
2
|
-
import { StackedBarsEventsDirective } from './events/stacked-bars-events.directive';
|
|
3
|
-
import { StackedBarsComponent } from './stacked-bars.component';
|
|
4
|
-
|
|
5
|
-
@NgModule({
|
|
6
|
-
imports: [StackedBarsComponent, StackedBarsEventsDirective],
|
|
7
|
-
exports: [StackedBarsComponent, StackedBarsEventsDirective],
|
|
8
|
-
})
|
|
9
|
-
export class VicStackedBarsModule {}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { StrokeBaseOptions } from './stroke-base-options';
|
|
2
|
-
|
|
3
|
-
export abstract class StrokeBase implements StrokeBaseOptions {
|
|
4
|
-
readonly linecap: string;
|
|
5
|
-
readonly linejoin: string;
|
|
6
|
-
readonly opacity: number;
|
|
7
|
-
readonly width: number;
|
|
8
|
-
readonly dasharray: string;
|
|
9
|
-
}
|
package/src/lib/stroke/index.ts
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { safeAssign } from '@mathstack/app-kit';
|
|
2
|
-
import { Stroke } from './stroke';
|
|
3
|
-
|
|
4
|
-
const DEFAULT = {
|
|
5
|
-
_dasharray: 'none',
|
|
6
|
-
_linecap: 'round',
|
|
7
|
-
_linejoin: 'round',
|
|
8
|
-
_opacity: 1,
|
|
9
|
-
_width: 2,
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export class StrokeBuilder {
|
|
13
|
-
private _color: string;
|
|
14
|
-
private _dasharray: string;
|
|
15
|
-
private _linecap: string;
|
|
16
|
-
private _linejoin: string;
|
|
17
|
-
private _opacity: number;
|
|
18
|
-
private _width: number;
|
|
19
|
-
|
|
20
|
-
constructor() {
|
|
21
|
-
safeAssign(this, DEFAULT);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* OPTIONAL. A value for the line's [stroke]{@link https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke}
|
|
26
|
-
* attribute.
|
|
27
|
-
*
|
|
28
|
-
* @default '#000'
|
|
29
|
-
*/
|
|
30
|
-
color(color: string): this {
|
|
31
|
-
this._color = color;
|
|
32
|
-
return this;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* OPTIONAL. A value for the line's [stroke-dasharray]{@link https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray}
|
|
37
|
-
* attribute.
|
|
38
|
-
*
|
|
39
|
-
* @default 'round'
|
|
40
|
-
*/
|
|
41
|
-
dasharray(dasharray: string): this {
|
|
42
|
-
this._dasharray = dasharray;
|
|
43
|
-
return this;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* OPTIONAL. A value for the line's [stroke-linecap]{@link https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-linecap}
|
|
48
|
-
* attribute.
|
|
49
|
-
*
|
|
50
|
-
* @default 'round'
|
|
51
|
-
*/
|
|
52
|
-
linecap(linecap: string): this {
|
|
53
|
-
this._linecap = linecap;
|
|
54
|
-
return this;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* OPTIONAL. A value for the line's [stroke-linejoin]{@link https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-linejoin}
|
|
59
|
-
* attribute.
|
|
60
|
-
*
|
|
61
|
-
* @default 'round'
|
|
62
|
-
*/
|
|
63
|
-
linejoin(linejoin: string): this {
|
|
64
|
-
this._linejoin = linejoin;
|
|
65
|
-
return this;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* OPTIONAL. A value for the line's [stroke-opacity]{@link https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-opacity}
|
|
70
|
-
* attribute.
|
|
71
|
-
*
|
|
72
|
-
* @default 1
|
|
73
|
-
*/
|
|
74
|
-
opacity(opacity: number): this {
|
|
75
|
-
this._opacity = opacity;
|
|
76
|
-
return this;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* OPTIONAL. A value for the line's [stroke-width]{@link https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-width}
|
|
81
|
-
* attribute, in px.
|
|
82
|
-
*
|
|
83
|
-
* @default 2
|
|
84
|
-
*/
|
|
85
|
-
width(width: number): this {
|
|
86
|
-
this._width = width;
|
|
87
|
-
return this;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* @internal This function is for internal use only and should never be called by the user.
|
|
92
|
-
*/
|
|
93
|
-
_build(): Stroke {
|
|
94
|
-
return new Stroke({
|
|
95
|
-
color: this._color,
|
|
96
|
-
dasharray: this._dasharray,
|
|
97
|
-
linecap: this._linecap,
|
|
98
|
-
linejoin: this._linejoin,
|
|
99
|
-
opacity: this._opacity,
|
|
100
|
-
width: this._width,
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
}
|
package/src/lib/stroke/stroke.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { safeAssign } from '@mathstack/app-kit';
|
|
2
|
-
import { StrokeBase } from './base/stroke-base';
|
|
3
|
-
import { StrokeOptions } from './stroke-options';
|
|
4
|
-
|
|
5
|
-
export class Stroke extends StrokeBase implements StrokeOptions {
|
|
6
|
-
readonly color: string;
|
|
7
|
-
|
|
8
|
-
constructor(options: Partial<StrokeOptions>) {
|
|
9
|
-
super();
|
|
10
|
-
safeAssign(this, options);
|
|
11
|
-
}
|
|
12
|
-
}
|