@mathstack/viz 2.1.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/mathstack-viz.mjs +11024 -0
- package/fesm2022/mathstack-viz.mjs.map +1 -0
- package/package.json +14 -5
- package/types/mathstack-viz.d.ts +5830 -0
- package/CHANGELOG.md +0 -0
- package/cypress/fixtures/example.json +0 -5
- package/cypress/fixtures/usMap.json +0 -13511
- package/cypress/support/commands.ts +0 -104
- package/cypress/support/component-index.html +0 -12
- package/cypress/support/component.ts +0 -33
- package/cypress.config.ts +0 -9
- package/karma.conf.js +0 -62
- package/ng-package.json +0 -8
- package/project.json +0 -97
- package/src/.eslintrc.json +0 -35
- package/src/.prettierrc +0 -31
- package/src/lib/axes/base/config/xy-axis-builder.ts +0 -68
- package/src/lib/axes/base/config/xy-axis-config.ts +0 -35
- package/src/lib/axes/base/config/xy-axis-options.ts +0 -11
- package/src/lib/axes/base/xy-axis-base.spec.ts +0 -114
- package/src/lib/axes/base/xy-axis-base.ts +0 -305
- package/src/lib/axes/base/xy-axis-domain-lines.cy.ts +0 -511
- package/src/lib/axes/baseline/axis-baseline-builder.ts +0 -77
- package/src/lib/axes/baseline/axis-baseline-options.ts +0 -4
- package/src/lib/axes/baseline/axis-baseline.ts +0 -11
- package/src/lib/axes/grid/grid-builder.ts +0 -74
- package/src/lib/axes/grid/grid-config.ts +0 -13
- package/src/lib/axes/grid/grid-options.ts +0 -7
- package/src/lib/axes/index.ts +0 -40
- package/src/lib/axes/label/axis-label-builder.ts +0 -140
- package/src/lib/axes/label/axis-label-options.ts +0 -12
- package/src/lib/axes/label/axis-label.ts +0 -18
- package/src/lib/axes/label/axis-labels.cy.ts +0 -303
- package/src/lib/axes/ordinal/ordinal-axis-config.ts +0 -31
- package/src/lib/axes/ordinal/ordinal-axis.spec.ts +0 -30
- package/src/lib/axes/ordinal/ordinal-axis.ts +0 -26
- package/src/lib/axes/quantitative/quantitative-axis-config.ts +0 -39
- package/src/lib/axes/quantitative/quantitative-axis-ticks.cy.ts +0 -748
- package/src/lib/axes/quantitative/quantitative-axis.spec.ts +0 -537
- package/src/lib/axes/quantitative/quantitative-axis.ts +0 -191
- package/src/lib/axes/ticks/tick-wrap/tick-wrap-builder.ts +0 -141
- package/src/lib/axes/ticks/tick-wrap/tick-wrap-options.ts +0 -11
- package/src/lib/axes/ticks/tick-wrap/tick-wrap.cy.ts +0 -360
- package/src/lib/axes/ticks/tick-wrap/tick-wrap.ts +0 -21
- package/src/lib/axes/ticks/ticks-builder.ts +0 -370
- package/src/lib/axes/ticks/ticks-options.ts +0 -24
- package/src/lib/axes/ticks/ticks.ts +0 -33
- package/src/lib/axes/x/x-axis-config.ts +0 -48
- package/src/lib/axes/x/x-axis.spec.ts +0 -90
- package/src/lib/axes/x/x-axis.ts +0 -109
- package/src/lib/axes/x-ordinal/x-ordinal-axis-builder.ts +0 -75
- package/src/lib/axes/x-ordinal/x-ordinal-axis-config.ts +0 -27
- package/src/lib/axes/x-ordinal/x-ordinal-axis.component.ts +0 -33
- package/src/lib/axes/x-quantitative/x-quantitative-axis-builder.ts +0 -74
- package/src/lib/axes/x-quantitative/x-quantitative-axis-config.ts +0 -32
- package/src/lib/axes/x-quantitative/x-quantitative-axis.component.ts +0 -40
- package/src/lib/axes/xy-axis.module.ts +0 -20
- package/src/lib/axes/y/y-axis-config.ts +0 -47
- package/src/lib/axes/y/y-axis.spec.ts +0 -92
- package/src/lib/axes/y/y-axis.ts +0 -161
- package/src/lib/axes/y-ordinal/y-ordinal-axis-builder.ts +0 -76
- package/src/lib/axes/y-ordinal/y-ordinal-axis-config.ts +0 -29
- package/src/lib/axes/y-ordinal/y-ordinal-axis.component.ts +0 -33
- package/src/lib/axes/y-quantitative-axis/y-quantitative-axis-builder.ts +0 -74
- package/src/lib/axes/y-quantitative-axis/y-quantitative-axis-config.ts +0 -34
- package/src/lib/axes/y-quantitative-axis/y-quantitative-axis.component.ts +0 -40
- package/src/lib/bars/bars.component.scss +0 -0
- package/src/lib/bars/bars.component.spec.ts +0 -1470
- package/src/lib/bars/bars.component.ts +0 -717
- package/src/lib/bars/bars.cy.ts +0 -829
- package/src/lib/bars/bars.module.ts +0 -9
- package/src/lib/bars/config/backgrounds/bars-backgrounds-builder.ts +0 -51
- package/src/lib/bars/config/backgrounds/bars-backgrounds-options.ts +0 -4
- package/src/lib/bars/config/backgrounds/bars-backgrounds.ts +0 -11
- package/src/lib/bars/config/bars-builder.ts +0 -340
- package/src/lib/bars/config/bars-config.spec.ts +0 -132
- package/src/lib/bars/config/bars-config.ts +0 -70
- package/src/lib/bars/config/bars-dimensions.ts +0 -29
- package/src/lib/bars/config/bars-options.ts +0 -20
- package/src/lib/bars/config/labels/bars-labels-builder.ts +0 -89
- package/src/lib/bars/config/labels/bars-labels-options.ts +0 -6
- package/src/lib/bars/config/labels/bars-labels.cy.ts +0 -781
- package/src/lib/bars/config/labels/bars-labels.ts +0 -13
- package/src/lib/bars/events/actions/bars-click-actions.ts +0 -23
- package/src/lib/bars/events/actions/bars-hover-actions.ts +0 -43
- package/src/lib/bars/events/actions/bars-hover-move-actions.ts +0 -21
- package/src/lib/bars/events/bars-events.directive.spec.ts +0 -186
- package/src/lib/bars/events/bars-events.directive.ts +0 -235
- package/src/lib/bars/events/bars-interaction-output.ts +0 -17
- package/src/lib/bars/events/bars-tooltip-positioner.ts +0 -24
- package/src/lib/bars/index.ts +0 -18
- package/src/lib/charts/chart/chart-scaling.cy.ts +0 -323
- package/src/lib/charts/chart/chart.component.html +0 -45
- package/src/lib/charts/chart/chart.component.scss +0 -37
- package/src/lib/charts/chart/chart.component.ts +0 -243
- package/src/lib/charts/chart/chart.token.ts +0 -4
- package/src/lib/charts/chart/chart.ts +0 -5
- package/src/lib/charts/chart/config/chart-builder.ts +0 -194
- package/src/lib/charts/chart/config/chart-config.ts +0 -21
- package/src/lib/charts/chart/config/chart-options.ts +0 -11
- package/src/lib/charts/chart.module.ts +0 -10
- package/src/lib/charts/index.ts +0 -9
- package/src/lib/charts/map-chart/map-chart.component.scss +0 -0
- package/src/lib/charts/map-chart/map-chart.component.spec.ts +0 -35
- package/src/lib/charts/map-chart/map-chart.component.ts +0 -61
- package/src/lib/charts/xy-chart/xy-chart.component.spec.ts +0 -34
- package/src/lib/charts/xy-chart/xy-chart.component.ts +0 -65
- package/src/lib/core/common-behaviors/constructor.ts +0 -7
- package/src/lib/core/index.ts +0 -11
- package/src/lib/core/pipes/resize-chart-height.pipe.spec.ts +0 -23
- package/src/lib/core/pipes/resize-chart-height.pipe.ts +0 -20
- package/src/lib/core/styles/_spacing.scss +0 -4
- package/src/lib/core/types/layout.ts +0 -28
- package/src/lib/core/types/scale.ts +0 -6
- package/src/lib/core/types/utility.ts +0 -11
- package/src/lib/core/types/values.ts +0 -10
- package/src/lib/core/utilities/colors.spec.ts +0 -57
- package/src/lib/core/utilities/colors.ts +0 -42
- package/src/lib/core/utilities/fill-utilities.spec.ts +0 -25
- package/src/lib/core/utilities/fill-utilities.ts +0 -21
- package/src/lib/core/utilities/type-guards.spec.ts +0 -55
- package/src/lib/core/utilities/type-guards.ts +0 -33
- package/src/lib/core/utilities/value-format.ts +0 -21
- package/src/lib/core/utilities/values.spec.ts +0 -954
- package/src/lib/core/utilities/values.ts +0 -189
- package/src/lib/data-dimensions/continuous-quantitative/date-chart-position/date-chart-position-builder.ts +0 -105
- package/src/lib/data-dimensions/continuous-quantitative/date-chart-position/date-chart-position-options.ts +0 -24
- package/src/lib/data-dimensions/continuous-quantitative/date-chart-position/date-chart-position.spec.ts +0 -66
- package/src/lib/data-dimensions/continuous-quantitative/date-chart-position/date-chart-position.ts +0 -72
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/concrete-domain-padding.ts +0 -10
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/domain-padding.ts +0 -76
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/domain-test-utility.ts +0 -130
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/percent-over/percent-over-options.ts +0 -3
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/percent-over/percent-over.ts +0 -37
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/pixel/pixel-options.ts +0 -3
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/pixel/pixel.ts +0 -73
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/quantitative-domain-padding.cy.ts +0 -978
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/round-to-interval/round-to-interval-options.ts +0 -3
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/round-to-interval/round-to-interval.ts +0 -27
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/round-to-sig-fig/round-to-sig-fig-options.ts +0 -3
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/round-to-sig-fig/round-to-sig-fig.ts +0 -30
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/number-chart-position-builder.ts +0 -183
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/number-chart-position-options.ts +0 -8
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/number-chart-position.spec.ts +0 -28
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/number-chart-position.ts +0 -62
- package/src/lib/data-dimensions/continuous-quantitative/number-dimension/number-dimension-options.ts +0 -15
- package/src/lib/data-dimensions/continuous-quantitative/number-dimension/number-dimension.spec.ts +0 -155
- package/src/lib/data-dimensions/continuous-quantitative/number-dimension/number-dimension.ts +0 -57
- package/src/lib/data-dimensions/continuous-quantitative/number-visual-value/number-visual-value-builder.ts +0 -166
- package/src/lib/data-dimensions/continuous-quantitative/number-visual-value/number-visual-value-options.ts +0 -10
- package/src/lib/data-dimensions/continuous-quantitative/number-visual-value/number-visual-value.spec.ts +0 -34
- package/src/lib/data-dimensions/continuous-quantitative/number-visual-value/number-visual-value.ts +0 -57
- package/src/lib/data-dimensions/dimension-builder.ts +0 -45
- package/src/lib/data-dimensions/dimension-options.ts +0 -12
- package/src/lib/data-dimensions/dimension.ts +0 -30
- package/src/lib/data-dimensions/index.ts +0 -31
- package/src/lib/data-dimensions/ordinal/ordinal-chart-position/ordinal-chart-position-builder.ts +0 -122
- package/src/lib/data-dimensions/ordinal/ordinal-chart-position/ordinal-chart-position-options.ts +0 -12
- package/src/lib/data-dimensions/ordinal/ordinal-chart-position/ordinal-chart-position.spec.ts +0 -83
- package/src/lib/data-dimensions/ordinal/ordinal-chart-position/ordinal-chart-position.ts +0 -101
- package/src/lib/data-dimensions/ordinal/ordinal-visual-value/ordinal-visual-value-builder.ts +0 -108
- package/src/lib/data-dimensions/ordinal/ordinal-visual-value/ordinal-visual-value-options.ts +0 -12
- package/src/lib/data-dimensions/ordinal/ordinal-visual-value/ordinal-visual-value.cy.ts +0 -384
- package/src/lib/data-dimensions/ordinal/ordinal-visual-value/ordinal-visual-value.spec.ts +0 -63
- package/src/lib/data-dimensions/ordinal/ordinal-visual-value/ordinal-visual-value.ts +0 -79
- package/src/lib/data-export/data-export-config.ts +0 -98
- package/src/lib/data-export/data-export.spec.ts +0 -33
- package/src/lib/data-export/data-export.ts +0 -87
- package/src/lib/data-export/index.ts +0 -2
- package/src/lib/dots/config/dots-builder.ts +0 -442
- package/src/lib/dots/config/dots-config.spec.ts +0 -123
- package/src/lib/dots/config/dots-config.ts +0 -81
- package/src/lib/dots/config/dots-options.ts +0 -32
- package/src/lib/dots/dots.component.scss +0 -0
- package/src/lib/dots/dots.component.spec.ts +0 -143
- package/src/lib/dots/dots.component.ts +0 -291
- package/src/lib/dots/dots.cy.ts +0 -594
- package/src/lib/dots/dots.module.ts +0 -9
- package/src/lib/dots/events/actions/dots-hover-actions.ts +0 -19
- package/src/lib/dots/events/actions/dots-hover-move-actions.ts +0 -38
- package/src/lib/dots/events/dots-events.directive.ts +0 -214
- package/src/lib/dots/events/dots-interaction-output.ts +0 -15
- package/src/lib/dots/events/dots-tooltip-positioner.ts +0 -24
- package/src/lib/dots/index.ts +0 -10
- package/src/lib/events/events.directive.ts +0 -184
- package/src/lib/events/events.types.ts +0 -57
- package/src/lib/events/index.ts +0 -4
- package/src/lib/events/interaction-output.ts +0 -34
- package/src/lib/events/tooltip-positioner.ts +0 -15
- package/src/lib/fill-definitions/fill-definitions.ts +0 -4
- package/src/lib/fill-definitions/index.ts +0 -1
- package/src/lib/geographies/config/geographies-builder.ts +0 -224
- package/src/lib/geographies/config/geographies-config.spec.ts +0 -100
- package/src/lib/geographies/config/geographies-config.ts +0 -81
- package/src/lib/geographies/config/geographies-options.ts +0 -37
- package/src/lib/geographies/config/layers/attribute-data-layer/attribute-data-layer-builder.ts +0 -212
- package/src/lib/geographies/config/layers/attribute-data-layer/attribute-data-layer-options.ts +0 -26
- package/src/lib/geographies/config/layers/attribute-data-layer/attribute-data-layer.spec.ts +0 -119
- package/src/lib/geographies/config/layers/attribute-data-layer/attribute-data-layer.ts +0 -148
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/attribute-data/attribute-data-dimension-builder.ts +0 -65
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/attribute-data/attribute-data-dimension-options.ts +0 -15
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/attribute-data/attribute-data-dimension.ts +0 -32
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/attribute-data-bin-enums.ts +0 -10
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/attribute-data-bin-types.ts +0 -15
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/calculated-bins/calculated-bins-builder.ts +0 -18
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/calculated-bins/calculated-bins-options.ts +0 -8
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/calculated-bins/calculated-bins.spec.ts +0 -60
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/calculated-bins/calculated-bins.ts +0 -34
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/categorical-bins/categorical-bins-builder.ts +0 -46
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/categorical-bins/categorical-bins-options.ts +0 -8
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/categorical-bins/categorical-bins.cy.ts +0 -437
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/categorical-bins/categorical-bins.spec.ts +0 -105
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/categorical-bins/categorical-bins.ts +0 -54
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/custom-breaks/custom-breaks-bins-builder.ts +0 -65
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/custom-breaks/custom-breaks-bins-options.ts +0 -9
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/custom-breaks/custom-breaks-bins.spec.ts +0 -82
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/custom-breaks/custom-breaks-bins.ts +0 -81
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/custom-breaks/custom-breaks.cy.ts +0 -378
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/equal-frequencies-bins/equal-frequencies-bins-builder.ts +0 -50
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/equal-frequencies-bins/equal-frequencies-bins-options.ts +0 -8
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/equal-frequencies-bins/equal-frequencies-bins.cy.ts +0 -362
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/equal-frequencies-bins/equal-frequencies-bins.spec.ts +0 -72
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/equal-frequencies-bins/equal-frequencies-bins.ts +0 -56
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/equal-value-ranges-bins/equal-value-ranges-bins-builder.ts +0 -60
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/equal-value-ranges-bins/equal-value-ranges-bins-options.ts +0 -9
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/equal-value-ranges-bins/equal-value-ranges-bins.cy.ts +0 -307
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/equal-value-ranges-bins/equal-value-ranges-bins.spec.ts +0 -104
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/equal-value-ranges-bins/equal-value-ranges-bins.ts +0 -89
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/no-bins/no-bins-builder.ts +0 -62
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/no-bins/no-bins-options.ts +0 -8
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/no-bins/no-bins.cy.ts +0 -265
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/no-bins/no-bins.spec.ts +0 -42
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/no-bins/no-bins.ts +0 -42
- package/src/lib/geographies/config/layers/geographies-layer/geographies-layer-builder.ts +0 -116
- package/src/lib/geographies/config/layers/geographies-layer/geographies-layer-options.ts +0 -20
- package/src/lib/geographies/config/layers/geographies-layer/geographies-layer.ts +0 -104
- package/src/lib/geographies/config/layers/geojson-properties-layer/geojson-properties-layer-builder.ts +0 -111
- package/src/lib/geographies/config/layers/geojson-properties-layer/geojson-properties-layer-options.ts +0 -19
- package/src/lib/geographies/config/layers/geojson-properties-layer/geojson-properties-layer.spec.ts +0 -41
- package/src/lib/geographies/config/layers/geojson-properties-layer/geojson-properties-layer.ts +0 -67
- package/src/lib/geographies/config/layers/labels/geographies-labels-builder.ts +0 -269
- package/src/lib/geographies/config/layers/labels/geographies-labels-options.ts +0 -45
- package/src/lib/geographies/config/layers/labels/geographies-labels.ts +0 -38
- package/src/lib/geographies/events/actions/geographies-click-actions.ts +0 -21
- package/src/lib/geographies/events/actions/geographies-hover-actions.ts +0 -17
- package/src/lib/geographies/events/actions/geographies-hover-move-actions.ts +0 -19
- package/src/lib/geographies/events/geographies-events.directive.spec.ts +0 -225
- package/src/lib/geographies/events/geographies-events.directive.ts +0 -235
- package/src/lib/geographies/events/geographies-interaction-output.ts +0 -17
- package/src/lib/geographies/events/geographies-tooltip-positioner.ts +0 -23
- package/src/lib/geographies/geographies-feature.ts +0 -16
- package/src/lib/geographies/geographies.component.html +0 -1
- package/src/lib/geographies/geographies.component.scss +0 -0
- package/src/lib/geographies/geographies.component.spec.ts +0 -148
- package/src/lib/geographies/geographies.component.ts +0 -318
- package/src/lib/geographies/geographies.cy.ts +0 -640
- package/src/lib/geographies/geographies.module.ts +0 -9
- package/src/lib/geographies/index.ts +0 -32
- package/src/lib/grouped-bars/config/grouped-bars-builder.ts +0 -66
- package/src/lib/grouped-bars/config/grouped-bars-config.ts +0 -41
- package/src/lib/grouped-bars/config/grouped-bars-options.ts +0 -9
- package/src/lib/grouped-bars/events/grouped-bars-events.directive.ts +0 -221
- package/src/lib/grouped-bars/grouped-bars.component.scss +0 -0
- package/src/lib/grouped-bars/grouped-bars.component.spec.ts +0 -25
- package/src/lib/grouped-bars/grouped-bars.component.ts +0 -94
- package/src/lib/grouped-bars/grouped-bars.module.ts +0 -9
- package/src/lib/grouped-bars/index.ts +0 -10
- package/src/lib/image-download/image-download-config.ts +0 -57
- package/src/lib/image-download/image-download-enums.ts +0 -7
- package/src/lib/image-download/image-download-options.ts +0 -14
- package/src/lib/image-download/image-download.service.ts +0 -70
- package/src/lib/image-download/index.ts +0 -4
- package/src/lib/lines/config/area-fills/area-fills-builder.ts +0 -87
- package/src/lib/lines/config/area-fills/area-fills-options.ts +0 -8
- package/src/lib/lines/config/area-fills/area-fills.ts +0 -14
- package/src/lib/lines/config/lines-builder.ts +0 -242
- package/src/lib/lines/config/lines-config.spec.ts +0 -52
- package/src/lib/lines/config/lines-config.ts +0 -96
- package/src/lib/lines/config/lines-options.ts +0 -19
- package/src/lib/lines/config/stroke/lines-stroke-builder.ts +0 -135
- package/src/lib/lines/config/stroke/lines-stroke-options.ts +0 -6
- package/src/lib/lines/config/stroke/lines-stroke.ts +0 -15
- package/src/lib/lines/events/actions/lines-click-actions.ts +0 -17
- package/src/lib/lines/events/actions/lines-hover-move-actions.ts +0 -113
- package/src/lib/lines/events/actions/lines-marker-click-actions.ts +0 -29
- package/src/lib/lines/events/lines-events.directive.spec.ts +0 -152
- package/src/lib/lines/events/lines-events.directive.ts +0 -310
- package/src/lib/lines/events/lines-interaction-output.ts +0 -17
- package/src/lib/lines/events/lines-tooltip-positioner.ts +0 -24
- package/src/lib/lines/index.ts +0 -17
- package/src/lib/lines/lines.component.scss +0 -0
- package/src/lib/lines/lines.component.spec.ts +0 -95
- package/src/lib/lines/lines.component.ts +0 -425
- package/src/lib/lines/lines.cy.ts +0 -738
- package/src/lib/lines/lines.module.ts +0 -9
- package/src/lib/map-legend/continuous-legend/continuous-legend.component.html +0 -28
- package/src/lib/map-legend/continuous-legend/continuous-legend.component.scss +0 -76
- package/src/lib/map-legend/continuous-legend/continuous-legend.component.spec.ts +0 -61
- package/src/lib/map-legend/continuous-legend/continuous-legend.component.ts +0 -82
- package/src/lib/map-legend/discontinuous-legend/discontinuous-legend.component.html +0 -40
- package/src/lib/map-legend/discontinuous-legend/discontinuous-legend.component.scss +0 -141
- package/src/lib/map-legend/discontinuous-legend/discontinuous-legend.component.spec.ts +0 -75
- package/src/lib/map-legend/discontinuous-legend/discontinuous-legend.component.ts +0 -57
- package/src/lib/map-legend/index.ts +0 -2
- package/src/lib/map-legend/map-legend-base.spec.ts +0 -190
- package/src/lib/map-legend/map-legend-base.ts +0 -99
- package/src/lib/map-legend/map-legend.component.html +0 -24
- package/src/lib/map-legend/map-legend.component.scss +0 -0
- package/src/lib/map-legend/map-legend.component.spec.ts +0 -125
- package/src/lib/map-legend/map-legend.component.ts +0 -80
- package/src/lib/map-legend/map-legend.module.ts +0 -8
- package/src/lib/marks/aux-marks/aux-marks.ts +0 -18
- package/src/lib/marks/aux-marks/config/aux-marks-builder.ts +0 -25
- package/src/lib/marks/aux-marks/config/aux-marks-config.ts +0 -6
- package/src/lib/marks/config/marks-config.ts +0 -14
- package/src/lib/marks/config/marks-options.ts +0 -9
- package/src/lib/marks/index.ts +0 -15
- package/src/lib/marks/map-marks/map-aux-marks/map-aux-marks.spec.ts +0 -74
- package/src/lib/marks/map-marks/map-aux-marks/map-aux-marks.ts +0 -40
- package/src/lib/marks/map-marks/map-primary-marks/map-primary-marks.spec.ts +0 -79
- package/src/lib/marks/map-marks/map-primary-marks/map-primary-marks.ts +0 -63
- package/src/lib/marks/marks.ts +0 -39
- package/src/lib/marks/primary-marks/config/primary-marks-builder.ts +0 -75
- package/src/lib/marks/primary-marks/config/primary-marks-config.ts +0 -9
- package/src/lib/marks/primary-marks/primary-marks-base.spec.ts +0 -58
- package/src/lib/marks/primary-marks/primary-marks.ts +0 -43
- package/src/lib/marks/xy-marks/xy-aux-marks/xy-aux-marks.ts +0 -40
- package/src/lib/marks/xy-marks/xy-marks-config.ts +0 -5
- package/src/lib/marks/xy-marks/xy-marks.ts +0 -10
- package/src/lib/marks/xy-marks/xy-primary-marks/xy-primary-marks-config.ts +0 -7
- package/src/lib/marks/xy-marks/xy-primary-marks/xy-primary-marks.spec.ts +0 -186
- package/src/lib/marks/xy-marks/xy-primary-marks/xy-primary-marks.ts +0 -72
- package/src/lib/point-markers/index.ts +0 -3
- package/src/lib/point-markers/point-markers-builder.ts +0 -93
- package/src/lib/point-markers/point-markers-options.ts +0 -6
- package/src/lib/point-markers/point-markers.ts +0 -13
- package/src/lib/quantitative-rules/config/labels/quantitative-rules-labels-builder.ts +0 -162
- package/src/lib/quantitative-rules/config/labels/quantitative-rules-labels-options.ts +0 -17
- package/src/lib/quantitative-rules/config/labels/quantitative-rules-labels.ts +0 -26
- package/src/lib/quantitative-rules/config/quantitative-rules-builder.ts +0 -134
- package/src/lib/quantitative-rules/config/quantitative-rules-config.ts +0 -21
- package/src/lib/quantitative-rules/config/quantitative-rules-dimensions.ts +0 -20
- package/src/lib/quantitative-rules/config/quantitative-rules-options.ts +0 -13
- package/src/lib/quantitative-rules/index.ts +0 -6
- package/src/lib/quantitative-rules/quantitative-rules.component.scss +0 -3
- package/src/lib/quantitative-rules/quantitative-rules.component.spec.ts +0 -50
- package/src/lib/quantitative-rules/quantitative-rules.component.ts +0 -224
- package/src/lib/quantitative-rules/quantitative-rules.cy.ts +0 -549
- package/src/lib/quantitative-rules/quantitative-rules.module.ts +0 -8
- package/src/lib/stacked-area/config/stacked-area-builder.ts +0 -264
- package/src/lib/stacked-area/config/stacked-area-config.spec.ts +0 -107
- package/src/lib/stacked-area/config/stacked-area-config.ts +0 -109
- package/src/lib/stacked-area/config/stacked-area-options.ts +0 -28
- package/src/lib/stacked-area/events/actions/stacked-area-hover-move-actions.ts +0 -17
- package/src/lib/stacked-area/events/stacked-area-events.directive.spec.ts +0 -168
- package/src/lib/stacked-area/events/stacked-area-events.directive.ts +0 -272
- package/src/lib/stacked-area/events/stacked-area-interaction-output.ts +0 -33
- package/src/lib/stacked-area/events/stacked-area-tooltip-positioner.ts +0 -37
- package/src/lib/stacked-area/index.ts +0 -7
- package/src/lib/stacked-area/stacked-area.component.scss +0 -0
- package/src/lib/stacked-area/stacked-area.component.spec.ts +0 -41
- package/src/lib/stacked-area/stacked-area.component.ts +0 -241
- package/src/lib/stacked-area/stacked-area.module.ts +0 -9
- package/src/lib/stacked-bars/config/stacked-bars-builder.ts +0 -109
- package/src/lib/stacked-bars/config/stacked-bars-config.spec.ts +0 -122
- package/src/lib/stacked-bars/config/stacked-bars-config.ts +0 -79
- package/src/lib/stacked-bars/config/stacked-bars-options.ts +0 -16
- package/src/lib/stacked-bars/events/actions/stacked-bars-click-actions.ts +0 -23
- package/src/lib/stacked-bars/events/actions/stacked-bars-hover-actions.ts +0 -22
- package/src/lib/stacked-bars/events/actions/stacked-bars-hover-move-actions.ts +0 -21
- package/src/lib/stacked-bars/events/stacked-bars-events.directive.spec.ts +0 -266
- package/src/lib/stacked-bars/events/stacked-bars-events.directive.ts +0 -240
- package/src/lib/stacked-bars/index.ts +0 -10
- package/src/lib/stacked-bars/stacked-bars.component.scss +0 -0
- package/src/lib/stacked-bars/stacked-bars.component.spec.ts +0 -25
- package/src/lib/stacked-bars/stacked-bars.component.ts +0 -158
- package/src/lib/stacked-bars/stacked-bars.module.ts +0 -9
- package/src/lib/stroke/base/stroke-base-options.ts +0 -7
- package/src/lib/stroke/base/stroke-base.ts +0 -9
- package/src/lib/stroke/index.ts +0 -5
- package/src/lib/stroke/stroke-builder.ts +0 -103
- package/src/lib/stroke/stroke-options.ts +0 -5
- package/src/lib/stroke/stroke.ts +0 -12
- package/src/lib/svg-text-wrap/index.ts +0 -3
- package/src/lib/svg-text-wrap/svg-text-wrap-builder.ts +0 -105
- package/src/lib/svg-text-wrap/svg-text-wrap-options.ts +0 -8
- package/src/lib/svg-text-wrap/svg-text-wrap.ts +0 -137
- package/src/lib/testing/data/continent-population-year-data.ts +0 -126
- package/src/lib/testing/data/country-area-continent.ts +0 -59
- package/src/lib/testing/data/state-population-income-year-data.ts +0 -123
- package/src/lib/testing/stubs/bars.component.stub.ts +0 -12
- package/src/lib/testing/stubs/chart.component.stub.ts +0 -6
- package/src/lib/testing/stubs/click.directive.stub.ts +0 -15
- package/src/lib/testing/stubs/core/destroy-ref.stub.ts +0 -9
- package/src/lib/testing/stubs/core/overlay-ref.stub.ts +0 -13
- package/src/lib/testing/stubs/core/overlay.stub.ts +0 -8
- package/src/lib/testing/stubs/event.directive.stub.ts +0 -10
- package/src/lib/testing/stubs/hover-move.directive.stub.ts +0 -17
- package/src/lib/testing/stubs/hover.directive.stub.ts +0 -14
- package/src/lib/testing/stubs/input-event.directive.stub.ts +0 -9
- package/src/lib/testing/stubs/lines.component.stub.ts +0 -13
- package/src/lib/testing/stubs/map-aux-marks.stub.ts +0 -10
- package/src/lib/testing/stubs/map-chart.component.stub.ts +0 -3
- package/src/lib/testing/stubs/map-legend-content.stub.ts +0 -16
- package/src/lib/testing/stubs/map-legend.component.stub.ts +0 -10
- package/src/lib/testing/stubs/map-primary-marks.stub.ts +0 -16
- package/src/lib/testing/stubs/ordinal-axis.stub.ts +0 -18
- package/src/lib/testing/stubs/primary-marks.stub.ts +0 -18
- package/src/lib/testing/stubs/quantitative-axis.stub.ts +0 -18
- package/src/lib/testing/stubs/services/main.service.stub.ts +0 -5
- package/src/lib/testing/stubs/services/utilities.service.stub.ts +0 -7
- package/src/lib/testing/stubs/stacked-area.component.stub.ts +0 -13
- package/src/lib/testing/stubs/x-axis.stub.ts +0 -10
- package/src/lib/testing/stubs/xy-axis.class.stub.ts +0 -20
- package/src/lib/testing/stubs/xy-axis.stub.ts +0 -44
- package/src/lib/testing/stubs/xy-chart.component.stub.ts +0 -5
- package/src/lib/testing/stubs/xy-data-marks.stub.ts +0 -15
- package/src/lib/testing/stubs/y-axis.stub.ts +0 -15
- package/src/lib/tooltips/config/tooltip.ts +0 -11
- package/src/lib/tooltips/html-tooltip/config/html-tooltip-builder.ts +0 -134
- package/src/lib/tooltips/html-tooltip/config/html-tooltip-config.ts +0 -21
- package/src/lib/tooltips/html-tooltip/config/html-tooltip-options.ts +0 -12
- package/src/lib/tooltips/html-tooltip/config/position/tooltip-position-builder.ts +0 -191
- package/src/lib/tooltips/html-tooltip/config/position/tooltip-position.ts +0 -42
- package/src/lib/tooltips/html-tooltip/config/size/tooltip-size-builder.ts +0 -75
- package/src/lib/tooltips/html-tooltip/config/size/tooltip-size-options.ts +0 -8
- package/src/lib/tooltips/html-tooltip/config/size/tooltip-size.ts +0 -15
- package/src/lib/tooltips/html-tooltip/html-tooltip.directive.spec.ts +0 -537
- package/src/lib/tooltips/html-tooltip/html-tooltip.directive.ts +0 -210
- package/src/lib/tooltips/html-tooltip/html-tooltip.module.ts +0 -16
- package/src/lib/tooltips/html-tooltip/tooltip-triangle/tooltip-triangle.component.html +0 -41
- package/src/lib/tooltips/html-tooltip/tooltip-triangle/tooltip-triangle.component.scss +0 -63
- package/src/lib/tooltips/html-tooltip/tooltip-triangle/tooltip-triangle.component.ts +0 -19
- package/src/lib/tooltips/index.ts +0 -11
- package/src/lib/tooltips/svg-tooltip/config/svg-tooltip.ts +0 -5
- package/src/lib/xy-background/index.ts +0 -2
- package/src/lib/xy-background/xy-background.component.html +0 -10
- package/src/lib/xy-background/xy-background.component.scss +0 -0
- package/src/lib/xy-background/xy-background.component.spec.ts +0 -24
- package/src/lib/xy-background/xy-background.component.ts +0 -19
- package/src/lib/xy-background/xy-background.module.ts +0 -8
- package/src/public-api.ts +0 -26
- package/src/test.ts +0 -15
- package/tsconfig.doc.json +0 -4
- package/tsconfig.json +0 -20
- package/tsconfig.lib.json +0 -23
- package/tsconfig.lib.prod.json +0 -10
- package/tsconfig.spec.json +0 -10
|
@@ -1,214 +0,0 @@
|
|
|
1
|
-
import { Directive, EventEmitter, inject, Input, Output } from '@angular/core';
|
|
2
|
-
import { select } from 'd3';
|
|
3
|
-
import { map, Observable } from 'rxjs';
|
|
4
|
-
import {
|
|
5
|
-
DEFAULT_TOOLTIP_Y_OFFSET,
|
|
6
|
-
EventAction,
|
|
7
|
-
EventsDirective,
|
|
8
|
-
EventType,
|
|
9
|
-
HoverMoveAction,
|
|
10
|
-
InputEventAction,
|
|
11
|
-
MarksHost,
|
|
12
|
-
UnlistenFunction,
|
|
13
|
-
} from '../../events';
|
|
14
|
-
import { TooltipPosition } from '../../tooltips';
|
|
15
|
-
import { DotDatum, DOTS, DotsComponent } from '../dots.component';
|
|
16
|
-
import { DotsInteractionOutput } from './dots-interaction-output';
|
|
17
|
-
import { DotsTooltipPositioner } from './dots-tooltip-positioner';
|
|
18
|
-
|
|
19
|
-
export interface DotsHost<
|
|
20
|
-
Datum,
|
|
21
|
-
TDotsComponent extends DotsComponent<Datum> = DotsComponent<Datum>,
|
|
22
|
-
> extends MarksHost<DotsInteractionOutput<Datum>, TDotsComponent> {
|
|
23
|
-
getDotDatum(): DotDatum | null;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
@Directive({
|
|
27
|
-
selector: '[vicDotsEvents]',
|
|
28
|
-
})
|
|
29
|
-
export class DotsEventsDirective<
|
|
30
|
-
Datum,
|
|
31
|
-
TDotsComponent extends DotsComponent<Datum> = DotsComponent<Datum>,
|
|
32
|
-
> extends EventsDirective<DotsHost<Datum>> {
|
|
33
|
-
@Input()
|
|
34
|
-
hoverActions:
|
|
35
|
-
| EventAction<DotsHost<Datum>, DotsInteractionOutput<Datum>>[]
|
|
36
|
-
| null;
|
|
37
|
-
@Input()
|
|
38
|
-
hoverMoveActions:
|
|
39
|
-
| HoverMoveAction<DotsHost<Datum>, DotsInteractionOutput<Datum>>[]
|
|
40
|
-
| null;
|
|
41
|
-
@Input()
|
|
42
|
-
clickActions:
|
|
43
|
-
| EventAction<DotsHost<Datum>, DotsInteractionOutput<Datum>>[]
|
|
44
|
-
| null;
|
|
45
|
-
@Input()
|
|
46
|
-
inputEventActions: InputEventAction<
|
|
47
|
-
DotsHost<Datum>,
|
|
48
|
-
DotsInteractionOutput<Datum>
|
|
49
|
-
>[];
|
|
50
|
-
@Output() interactionOutput = new EventEmitter<
|
|
51
|
-
DotsInteractionOutput<Datum>
|
|
52
|
-
>();
|
|
53
|
-
|
|
54
|
-
dotDatum: DotDatum;
|
|
55
|
-
origin: SVGCircleElement;
|
|
56
|
-
|
|
57
|
-
public dots = inject<TDotsComponent>(DOTS);
|
|
58
|
-
|
|
59
|
-
get marks(): DotsComponent<Datum> {
|
|
60
|
-
return this.dots;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
getElements(): Observable<Element[]> {
|
|
64
|
-
return this.dots.dots$.pipe(map((sel) => sel.nodes()));
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
getDotDatum(): DotDatum | null {
|
|
68
|
-
return this.dotDatum;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
setupListeners(elements: Element[]): UnlistenFunction[] {
|
|
72
|
-
if (this.inputEventActions?.length && this.inputEvent$) {
|
|
73
|
-
this.events.push(EventType.Input);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
return this.bindEventListeners(
|
|
77
|
-
elements,
|
|
78
|
-
this.buildInteractionListeners({
|
|
79
|
-
hover: this.hoverActions?.length && {
|
|
80
|
-
pointerenter: (e, el) => this.onEnter(e, el),
|
|
81
|
-
pointerleave: (e, el) => this.onLeave(e, el),
|
|
82
|
-
},
|
|
83
|
-
hoverMove: this.hoverMoveActions?.length && {
|
|
84
|
-
pointerenter: (e, el) => this.onEnter(e, el),
|
|
85
|
-
pointermove: (e, el) => this.onMove(e, el),
|
|
86
|
-
pointerleave: (e, el) => this.onLeave(e, el),
|
|
87
|
-
},
|
|
88
|
-
click: this.clickActions?.length && {
|
|
89
|
-
click: (e, el) => this.onClick(e, el),
|
|
90
|
-
},
|
|
91
|
-
})
|
|
92
|
-
);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
onEnter(_: PointerEvent, el: Element): void {
|
|
96
|
-
this.initFromElement(el);
|
|
97
|
-
if (this.isEventAllowed(EventType.Hover)) {
|
|
98
|
-
this.setPositionsFromElement();
|
|
99
|
-
this.runActions(this.hoverActions, (a) => a.onStart(this));
|
|
100
|
-
} else if (this.isEventAllowed(EventType.HoverMove)) {
|
|
101
|
-
this.runActions(this.hoverMoveActions, (a) => {
|
|
102
|
-
if (a.initialize) {
|
|
103
|
-
a.initialize(this);
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
110
|
-
onMove(event: PointerEvent, _: Element): void {
|
|
111
|
-
if (this.isEventAllowed(EventType.HoverMove)) {
|
|
112
|
-
this.setPositionsFromPointer(event);
|
|
113
|
-
this.hoverMoveActions.forEach((action) => action.onStart(this));
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
118
|
-
onLeave(_: PointerEvent, __: Element): void {
|
|
119
|
-
if (this.isEventAllowed(EventType.Hover)) {
|
|
120
|
-
this.hoverActions.forEach((action) => action.onEnd(this));
|
|
121
|
-
} else if (this.isEventAllowed(EventType.HoverMove)) {
|
|
122
|
-
this.hoverMoveActions.forEach((action) => action.onEnd(this));
|
|
123
|
-
}
|
|
124
|
-
this.resetDirective();
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
onClick(event: PointerEvent, el: Element): void {
|
|
128
|
-
this.initFromElement(el);
|
|
129
|
-
if (!this.preventAction.click) {
|
|
130
|
-
if (this.hasEvent(EventType.Hover)) {
|
|
131
|
-
this.setPositionsFromElement();
|
|
132
|
-
} else {
|
|
133
|
-
this.setPositionsFromPointer(event);
|
|
134
|
-
}
|
|
135
|
-
this.runActions(this.clickActions, (a) => a.onStart(this));
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
onClickRemove(): void {
|
|
140
|
-
if (!this.preventAction.click) {
|
|
141
|
-
this.runActions(this.clickActions, (a) => a.onEnd(this));
|
|
142
|
-
this.resetDirective();
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
onInputEvent(inputValue: unknown): void {
|
|
147
|
-
if (this.isEventAllowed(EventType.Input)) {
|
|
148
|
-
if (inputValue === null || inputValue === undefined) {
|
|
149
|
-
this.inputEventActions.forEach((action) =>
|
|
150
|
-
action.onEnd(this, inputValue)
|
|
151
|
-
);
|
|
152
|
-
} else {
|
|
153
|
-
this.inputEventActions.forEach((action) =>
|
|
154
|
-
action.onStart(this, inputValue)
|
|
155
|
-
);
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
initFromElement(el: Element): void {
|
|
161
|
-
this.origin = el as SVGCircleElement;
|
|
162
|
-
this.dotDatum = select(el as SVGCircleElement).datum() as DotDatum;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
setPositionsFromElement(): void {
|
|
166
|
-
const dotRect = this.origin.getBoundingClientRect();
|
|
167
|
-
this.positionX = dotRect.width / 2;
|
|
168
|
-
this.positionY = dotRect.height / 2;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
getInteractionOutput(type: EventType): DotsInteractionOutput<Datum> {
|
|
172
|
-
const tooltipData = this.dotDatum
|
|
173
|
-
? this.dots.getTooltipData(this.dotDatum)
|
|
174
|
-
: undefined;
|
|
175
|
-
const position = new DotsTooltipPositioner({
|
|
176
|
-
x: this.positionX,
|
|
177
|
-
y: this.positionY,
|
|
178
|
-
});
|
|
179
|
-
|
|
180
|
-
return {
|
|
181
|
-
...tooltipData,
|
|
182
|
-
origin: this.origin,
|
|
183
|
-
anchor: {
|
|
184
|
-
x: this.positionX,
|
|
185
|
-
y: this.positionY,
|
|
186
|
-
},
|
|
187
|
-
defaultPosition: position.fromAnchor({
|
|
188
|
-
x: 0,
|
|
189
|
-
y: DEFAULT_TOOLTIP_Y_OFFSET,
|
|
190
|
-
}),
|
|
191
|
-
fromAnchor: (offset?: Partial<{ x: number; y: number }>) => {
|
|
192
|
-
return position.fromAnchor({
|
|
193
|
-
x: offset?.x ?? 0,
|
|
194
|
-
y: offset?.y ?? DEFAULT_TOOLTIP_Y_OFFSET,
|
|
195
|
-
});
|
|
196
|
-
},
|
|
197
|
-
customPosition: (positions: TooltipPosition[]) => {
|
|
198
|
-
return position.customPosition(positions);
|
|
199
|
-
},
|
|
200
|
-
type,
|
|
201
|
-
};
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
emitInteractionOutput(output: DotsInteractionOutput<Datum>): void {
|
|
205
|
-
this.interactionOutput.emit(output);
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
private resetDirective(): void {
|
|
209
|
-
this.dotDatum = undefined;
|
|
210
|
-
this.origin = undefined;
|
|
211
|
-
this.positionX = undefined;
|
|
212
|
-
this.positionY = undefined;
|
|
213
|
-
}
|
|
214
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { InteractionOutput } from '../../events/interaction-output';
|
|
2
|
-
import { HtmlTooltipCdkManagedPosition } from '../../tooltips';
|
|
3
|
-
import { DotsTooltipDatum } from '../dots.component';
|
|
4
|
-
|
|
5
|
-
export interface DotsInteractionOutput<Datum>
|
|
6
|
-
extends DotsTooltipDatum<Datum>, InteractionOutput {
|
|
7
|
-
/**
|
|
8
|
-
* A method that returns a position for the tooltip above the pointer for HoverMove or Click actions or above the center of the dot for Hover actions.
|
|
9
|
-
*
|
|
10
|
-
* @param yOffset - Optional offset from the pointer's y position.
|
|
11
|
-
*/
|
|
12
|
-
fromAnchor: (
|
|
13
|
-
offset?: Partial<{ x: number; y: number }>
|
|
14
|
-
) => HtmlTooltipCdkManagedPosition;
|
|
15
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { TooltipPositioner } from '../../events/tooltip-positioner';
|
|
2
|
-
import { HtmlTooltipCdkManagedPosition } from '../../tooltips';
|
|
3
|
-
import { TooltipPositionBuilder } from '../../tooltips/html-tooltip/config/position/tooltip-position-builder';
|
|
4
|
-
|
|
5
|
-
const DEFAULT_POSITIONS = [
|
|
6
|
-
new TooltipPositionBuilder().fromCenter().attachBottomCenter().getPosition(),
|
|
7
|
-
new TooltipPositionBuilder().fromCenter().attachBottomLeft().getPosition(),
|
|
8
|
-
new TooltipPositionBuilder().fromCenter().attachBottomRight().getPosition(),
|
|
9
|
-
];
|
|
10
|
-
|
|
11
|
-
export class DotsTooltipPositioner extends TooltipPositioner {
|
|
12
|
-
constructor(private anchor: { x: number; y: number }) {
|
|
13
|
-
super();
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
fromAnchor(offset: { x: number; y: number }): HtmlTooltipCdkManagedPosition {
|
|
17
|
-
const positionsWithOffsets = new TooltipPositionBuilder().applyOffsets(
|
|
18
|
-
DEFAULT_POSITIONS,
|
|
19
|
-
this.anchor.x + offset.x,
|
|
20
|
-
this.anchor.y - offset.y
|
|
21
|
-
);
|
|
22
|
-
return new HtmlTooltipCdkManagedPosition(positionsWithOffsets);
|
|
23
|
-
}
|
|
24
|
-
}
|
package/src/lib/dots/index.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export * from './config/dots-builder';
|
|
2
|
-
export * from './config/dots-config';
|
|
3
|
-
export * from './config/dots-options';
|
|
4
|
-
export * from './dots.component';
|
|
5
|
-
export * from './dots.module';
|
|
6
|
-
export * from './events/actions/dots-hover-actions';
|
|
7
|
-
export * from './events/actions/dots-hover-move-actions';
|
|
8
|
-
export * from './events/dots-events.directive';
|
|
9
|
-
export * from './events/dots-interaction-output';
|
|
10
|
-
export * from './events/dots-tooltip-positioner';
|
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AfterViewInit,
|
|
3
|
-
DestroyRef,
|
|
4
|
-
Directive,
|
|
5
|
-
inject,
|
|
6
|
-
Input,
|
|
7
|
-
OnDestroy,
|
|
8
|
-
Renderer2,
|
|
9
|
-
} from '@angular/core';
|
|
10
|
-
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
11
|
-
import { pointer } from 'd3';
|
|
12
|
-
import { Observable } from 'rxjs';
|
|
13
|
-
import {
|
|
14
|
-
ActionHost,
|
|
15
|
-
EventAction,
|
|
16
|
-
EventType,
|
|
17
|
-
UnlistenFunction,
|
|
18
|
-
} from './events.types';
|
|
19
|
-
|
|
20
|
-
@Directive()
|
|
21
|
-
export abstract class EventsDirective<
|
|
22
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
23
|
-
Host extends ActionHost<unknown> = any,
|
|
24
|
-
>
|
|
25
|
-
implements AfterViewInit, OnDestroy
|
|
26
|
-
{
|
|
27
|
-
@Input() clickRemoveEvent$: Observable<void>;
|
|
28
|
-
@Input() inputEvent$: Observable<unknown>;
|
|
29
|
-
protected destroyRef = inject(DestroyRef);
|
|
30
|
-
protected renderer = inject(Renderer2);
|
|
31
|
-
|
|
32
|
-
protected abstract getElements(): Observable<Element[]>;
|
|
33
|
-
protected abstract onClickRemove(): void;
|
|
34
|
-
protected abstract onInputEvent(inputValue: unknown): void;
|
|
35
|
-
protected abstract setPositionsFromElement(): void;
|
|
36
|
-
protected abstract setupListeners(elements: Element[]): UnlistenFunction[];
|
|
37
|
-
|
|
38
|
-
protected unlistenFns: UnlistenFunction[] = [];
|
|
39
|
-
protected events: EventType[] = [];
|
|
40
|
-
preventAction: Record<EventType, boolean> = {
|
|
41
|
-
click: false,
|
|
42
|
-
hover: false,
|
|
43
|
-
hoverMove: false,
|
|
44
|
-
input: false,
|
|
45
|
-
};
|
|
46
|
-
positionX: number;
|
|
47
|
-
positionY: number;
|
|
48
|
-
|
|
49
|
-
ngAfterViewInit(): void {
|
|
50
|
-
this.getElements()
|
|
51
|
-
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
52
|
-
.subscribe((els) => {
|
|
53
|
-
this.unlistenFns.forEach((fn) => fn());
|
|
54
|
-
this.unlistenFns = this.setupListeners(els);
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
if (this.clickRemoveEvent$) {
|
|
58
|
-
this.clickRemoveEvent$
|
|
59
|
-
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
60
|
-
.subscribe(() => this.onClickRemove());
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
if (this.inputEvent$) {
|
|
64
|
-
this.inputEvent$
|
|
65
|
-
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
66
|
-
.subscribe((event) => this.onInputEvent(event));
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
ngOnDestroy(): void {
|
|
71
|
-
this.unlistenFns.forEach((fn) => fn());
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
protected buildInteractionListeners(
|
|
75
|
-
handlers: Partial<
|
|
76
|
-
Record<
|
|
77
|
-
EventType,
|
|
78
|
-
Partial<{
|
|
79
|
-
pointerenter: (e: PointerEvent, el: Element) => void;
|
|
80
|
-
pointermove: (e: PointerEvent, el: Element) => void;
|
|
81
|
-
pointerleave: (e: PointerEvent, el: Element) => void;
|
|
82
|
-
click: (e: PointerEvent, el: Element) => void;
|
|
83
|
-
}>
|
|
84
|
-
>
|
|
85
|
-
>
|
|
86
|
-
): Record<string, (e: PointerEvent, el: Element) => void> {
|
|
87
|
-
const listeners: Record<string, (e: PointerEvent, el: Element) => void> =
|
|
88
|
-
{};
|
|
89
|
-
|
|
90
|
-
for (const eventType of Object.keys(handlers) as EventType[]) {
|
|
91
|
-
const handler = handlers[eventType];
|
|
92
|
-
if (!handler) continue;
|
|
93
|
-
|
|
94
|
-
this.events.push(eventType);
|
|
95
|
-
|
|
96
|
-
for (const [domEvent, fn] of Object.entries(handler)) {
|
|
97
|
-
listeners[domEvent] = fn;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
return listeners;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
protected bindEventListeners(
|
|
105
|
-
elements: Element[],
|
|
106
|
-
handlers: Partial<{
|
|
107
|
-
pointerenter: (event: PointerEvent, el: Element) => void;
|
|
108
|
-
pointermove: (event: PointerEvent, el: Element) => void;
|
|
109
|
-
pointerleave: (event: PointerEvent, el: Element) => void;
|
|
110
|
-
click: (event: PointerEvent, el: Element) => void;
|
|
111
|
-
}>
|
|
112
|
-
): UnlistenFunction[] {
|
|
113
|
-
return elements.map((el) => {
|
|
114
|
-
const unlistenFns: UnlistenFunction[] = [];
|
|
115
|
-
|
|
116
|
-
if (handlers.pointerenter)
|
|
117
|
-
unlistenFns.push(
|
|
118
|
-
this.renderer.listen(el, 'pointerenter', (e) =>
|
|
119
|
-
handlers.pointerenter(e, el)
|
|
120
|
-
)
|
|
121
|
-
);
|
|
122
|
-
if (handlers.pointermove)
|
|
123
|
-
unlistenFns.push(
|
|
124
|
-
this.renderer.listen(el, 'pointermove', (e) =>
|
|
125
|
-
handlers.pointermove(e, el)
|
|
126
|
-
)
|
|
127
|
-
);
|
|
128
|
-
if (handlers.pointerleave)
|
|
129
|
-
unlistenFns.push(
|
|
130
|
-
this.renderer.listen(el, 'pointerleave', (e) =>
|
|
131
|
-
handlers.pointerleave(e, el)
|
|
132
|
-
)
|
|
133
|
-
);
|
|
134
|
-
if (handlers.click)
|
|
135
|
-
unlistenFns.push(
|
|
136
|
-
this.renderer.listen(el, 'click', (e) => handlers.click(e, el))
|
|
137
|
-
);
|
|
138
|
-
|
|
139
|
-
return () => unlistenFns.forEach((fn) => fn());
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
disableOtherActions(eventType: EventType): void {
|
|
144
|
-
Object.keys(this.preventAction).forEach((key) => {
|
|
145
|
-
if (key !== eventType) {
|
|
146
|
-
this.preventAction[key as EventType] = true;
|
|
147
|
-
}
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
resumeOtherActions(eventType: EventType, cancelCurrentActions = true): void {
|
|
152
|
-
Object.keys(this.preventAction).forEach((key) => {
|
|
153
|
-
const isCurrent = key === eventType;
|
|
154
|
-
const shouldResume = !isCurrent || cancelCurrentActions;
|
|
155
|
-
if (shouldResume) {
|
|
156
|
-
this.preventAction[key as EventType] = false;
|
|
157
|
-
}
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
setPositionsFromPointer(event: PointerEvent): void {
|
|
162
|
-
[this.positionX, this.positionY] = pointer(event);
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
protected runActions<T extends EventAction<Host>>(
|
|
166
|
-
actions: T[] | null | undefined,
|
|
167
|
-
fn: (action: T) => void
|
|
168
|
-
): void {
|
|
169
|
-
if (!actions?.length) return;
|
|
170
|
-
actions.forEach(fn);
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
protected hasEvent(event: EventType): boolean {
|
|
174
|
-
return this.events.includes(event);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
protected isEventAllowed(event: EventType): boolean {
|
|
178
|
-
return this.hasEvent(event) && !this.preventAction[event];
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
protected asHost(): Host {
|
|
182
|
-
return this as unknown as Host;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { Renderer2 } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
export type UnlistenFunction = () => void;
|
|
4
|
-
export type ListenElement = HTMLElement | SVGElement;
|
|
5
|
-
|
|
6
|
-
export enum EventType {
|
|
7
|
-
Click = 'click',
|
|
8
|
-
Hover = 'hover',
|
|
9
|
-
HoverMove = 'hoverMove',
|
|
10
|
-
Input = 'input',
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface EventAction<
|
|
14
|
-
Host extends ActionHost<Output>,
|
|
15
|
-
Output = unknown,
|
|
16
|
-
> {
|
|
17
|
-
onStart: (host: Host) => void;
|
|
18
|
-
onEnd: (host: Host) => void;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export interface HoverMoveAction<
|
|
22
|
-
Host extends ActionHost<Output>,
|
|
23
|
-
Output = unknown,
|
|
24
|
-
> extends EventAction<Host> {
|
|
25
|
-
initialize?: (host: Host) => void;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export interface InputEventAction<
|
|
29
|
-
Host extends ActionHost<Output>,
|
|
30
|
-
Output = unknown,
|
|
31
|
-
> {
|
|
32
|
-
onStart: (host: Host, ...args) => void;
|
|
33
|
-
onEnd: (host: Host, ...args) => void;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export interface ActionHost<Output> {
|
|
37
|
-
getInteractionOutput(type: EventType): Output;
|
|
38
|
-
setPositionsFromElement(): void;
|
|
39
|
-
setPositionsFromPointer(event: PointerEvent): void;
|
|
40
|
-
disableOtherActions(eventType: EventType): void;
|
|
41
|
-
resumeOtherActions(
|
|
42
|
-
eventType: EventType,
|
|
43
|
-
cancelCurrentActions?: boolean
|
|
44
|
-
): void;
|
|
45
|
-
emitInteractionOutput(output: Output): void;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export interface MarksHost<
|
|
49
|
-
Output,
|
|
50
|
-
MarksComponent = unknown,
|
|
51
|
-
> extends ActionHost<Output> {
|
|
52
|
-
marks: MarksComponent;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export interface EventStrategy {
|
|
56
|
-
bindTo(elements: Element[], renderer: Renderer2): UnlistenFunction[];
|
|
57
|
-
}
|
package/src/lib/events/index.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { EventType } from '../events';
|
|
2
|
-
import { HtmlTooltipCdkManagedPosition, TooltipPosition } from '../tooltips';
|
|
3
|
-
|
|
4
|
-
export interface InteractionOutput<Anchor = { x: number; y: number }> {
|
|
5
|
-
/**
|
|
6
|
-
* If used with Hover actions, the coordinates of the center of the origin element relative to the top left corner of the origin.
|
|
7
|
-
*
|
|
8
|
-
* If used with HoverMove actions, the position of the pointer relative to the top left corner of the origin element.
|
|
9
|
-
*/
|
|
10
|
-
anchor: Anchor;
|
|
11
|
-
/**
|
|
12
|
-
* The origin element of the tooltip.
|
|
13
|
-
*/
|
|
14
|
-
origin: SVGGraphicsElement;
|
|
15
|
-
/**
|
|
16
|
-
* The type of the event that triggered the interaction.
|
|
17
|
-
*/
|
|
18
|
-
type: EventType;
|
|
19
|
-
/**
|
|
20
|
-
* The default position of the tooltip.
|
|
21
|
-
*/
|
|
22
|
-
defaultPosition: HtmlTooltipCdkManagedPosition;
|
|
23
|
-
/**
|
|
24
|
-
* A method that positions the tooltip with a user specified offset from the tooltip's anchor point.
|
|
25
|
-
*/
|
|
26
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
27
|
-
fromAnchor: (...args: any[]) => HtmlTooltipCdkManagedPosition;
|
|
28
|
-
/**
|
|
29
|
-
* A method that allows a user to provide custom positions for the tooltip.
|
|
30
|
-
*/
|
|
31
|
-
customPosition: (
|
|
32
|
-
positions: TooltipPosition[]
|
|
33
|
-
) => HtmlTooltipCdkManagedPosition;
|
|
34
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
HtmlTooltipCdkManagedPosition,
|
|
3
|
-
TooltipPosition,
|
|
4
|
-
} from '../tooltips/html-tooltip/config/position/tooltip-position';
|
|
5
|
-
|
|
6
|
-
export const DEFAULT_TOOLTIP_Y_OFFSET = 2;
|
|
7
|
-
|
|
8
|
-
export abstract class TooltipPositioner {
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10
|
-
abstract fromAnchor(...args: any): HtmlTooltipCdkManagedPosition;
|
|
11
|
-
|
|
12
|
-
customPosition(positions: TooltipPosition[]): HtmlTooltipCdkManagedPosition {
|
|
13
|
-
return new HtmlTooltipCdkManagedPosition(positions);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './fill-definitions';
|