@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,66 +0,0 @@
|
|
|
1
|
-
import { Injectable } from '@angular/core';
|
|
2
|
-
import { safeAssign } from '@mathstack/app-kit';
|
|
3
|
-
import { VicBarsConfigBuilder } from '../../bars/config/bars-builder';
|
|
4
|
-
import { DataValue } from '../../core/types/values';
|
|
5
|
-
import { GroupedBarsConfig } from './grouped-bars-config';
|
|
6
|
-
|
|
7
|
-
const DEFAULT = {
|
|
8
|
-
_intraGroupPadding: 0.05,
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Builds a configuration object for a GroupedBarsComponent.
|
|
13
|
-
*
|
|
14
|
-
* Must be added to a providers array in or above the component that consumes it if it is injected via the constructor. (e.g. `providers: [VicGroupedBarsBuilder]` in the component decorator)
|
|
15
|
-
*
|
|
16
|
-
* The first generic parameter, Datum, is the type of the data that will be used to create the bars.
|
|
17
|
-
*
|
|
18
|
-
* The second generic parameter, TOrdinalValue, is the type of the ordinal data that will be used to position the bars.
|
|
19
|
-
*/
|
|
20
|
-
@Injectable()
|
|
21
|
-
export class VicGroupedBarsConfigBuilder<
|
|
22
|
-
Datum,
|
|
23
|
-
TOrdinalValue extends DataValue,
|
|
24
|
-
> extends VicBarsConfigBuilder<Datum, TOrdinalValue> {
|
|
25
|
-
private _intraGroupPadding: number;
|
|
26
|
-
|
|
27
|
-
constructor() {
|
|
28
|
-
super();
|
|
29
|
-
safeAssign(this, DEFAULT);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* OPTIONAL. Set the padding between groups of bars. Passed to d3.scaleBand.padding.
|
|
34
|
-
*
|
|
35
|
-
* @default 0.05
|
|
36
|
-
*/
|
|
37
|
-
intraGroupPadding(padding: number): this {
|
|
38
|
-
this._intraGroupPadding = padding;
|
|
39
|
-
return this;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* REQUIRED. Builds the configuration object for a GroupedBarsComponent.
|
|
44
|
-
*/
|
|
45
|
-
override getConfig(): GroupedBarsConfig<Datum, TOrdinalValue> {
|
|
46
|
-
this.validateBuilder('Grouped Bars');
|
|
47
|
-
return new GroupedBarsConfig(this.dimensions, {
|
|
48
|
-
marksClass: 'vic-grouped-bars',
|
|
49
|
-
backgrounds: this.backgroundsBuilder?._build(),
|
|
50
|
-
color: this.colorDimensionBuilder._build('Color'),
|
|
51
|
-
customFills: this._customFills,
|
|
52
|
-
data: this._data,
|
|
53
|
-
datumClass: this._datumClass,
|
|
54
|
-
intraGroupPadding: this._intraGroupPadding,
|
|
55
|
-
labels: this.labelsBuilder?._build(),
|
|
56
|
-
mixBlendMode: this._mixBlendMode,
|
|
57
|
-
ordinal: this.ordinalDimensionBuilder._build(
|
|
58
|
-
'band',
|
|
59
|
-
this.getOrdinalDimensionName()
|
|
60
|
-
),
|
|
61
|
-
quantitative: this.quantitativeDimensionBuilder._build(
|
|
62
|
-
this.getQuantitativeDimensionName()
|
|
63
|
-
),
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { safeAssign } from '@mathstack/app-kit';
|
|
2
|
-
import { range } from 'd3';
|
|
3
|
-
import { BarsConfig } from '../../bars/config/bars-config';
|
|
4
|
-
import { BarsDimensions } from '../../bars/config/bars-dimensions';
|
|
5
|
-
import { DataValue } from '../../core/types/values';
|
|
6
|
-
import { GroupedBarsOptions } from './grouped-bars-options';
|
|
7
|
-
|
|
8
|
-
const DEFAULT = {
|
|
9
|
-
intraGroupPadding: 0.05,
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export class GroupedBarsConfig<Datum, TOrdinalValue extends DataValue>
|
|
13
|
-
extends BarsConfig<Datum, TOrdinalValue>
|
|
14
|
-
implements GroupedBarsOptions<Datum, TOrdinalValue>
|
|
15
|
-
{
|
|
16
|
-
intraGroupPadding: number;
|
|
17
|
-
|
|
18
|
-
constructor(
|
|
19
|
-
dimensions: BarsDimensions,
|
|
20
|
-
options: GroupedBarsOptions<Datum, TOrdinalValue>
|
|
21
|
-
) {
|
|
22
|
-
super(dimensions, options);
|
|
23
|
-
safeAssign(this, DEFAULT);
|
|
24
|
-
safeAssign(this, options);
|
|
25
|
-
this.initPropertiesFromData();
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
override setValueIndices(): void {
|
|
29
|
-
this.valueIndices = range(this.ordinal.values.length).filter((i) => {
|
|
30
|
-
return (
|
|
31
|
-
this.ordinal.domainIncludes(this.ordinal.values[i]) &&
|
|
32
|
-
this.color.domainIncludes(this.color.values[i])
|
|
33
|
-
);
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
override setBarsKeyFunction(): void {
|
|
38
|
-
this.barsKeyFunction = (i: number): string =>
|
|
39
|
-
`${this.color.values[i]}-${this.ordinal.values[i]}`;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { BarsOptions } from '../../bars/config/bars-options';
|
|
2
|
-
import { DataValue } from '../../core/types/values';
|
|
3
|
-
|
|
4
|
-
export interface GroupedBarsOptions<
|
|
5
|
-
Datum,
|
|
6
|
-
TOrdinalValue extends DataValue,
|
|
7
|
-
> extends BarsOptions<Datum, TOrdinalValue> {
|
|
8
|
-
intraGroupPadding: number;
|
|
9
|
-
}
|
|
@@ -1,221 +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 { BarDatum, BARS, BarsHost, BarsInteractionOutput } from '../../bars';
|
|
5
|
-
import { BarsTooltipPositioner } from '../../bars/events/bars-tooltip-positioner';
|
|
6
|
-
import { DataValue } from '../../core';
|
|
7
|
-
import {
|
|
8
|
-
DEFAULT_TOOLTIP_Y_OFFSET,
|
|
9
|
-
EventAction,
|
|
10
|
-
EventsDirective,
|
|
11
|
-
EventType,
|
|
12
|
-
HoverMoveAction,
|
|
13
|
-
InputEventAction,
|
|
14
|
-
UnlistenFunction,
|
|
15
|
-
} from '../../events';
|
|
16
|
-
import { TooltipPosition } from '../../tooltips';
|
|
17
|
-
import { GroupedBarsComponent } from '../grouped-bars.component';
|
|
18
|
-
|
|
19
|
-
@Directive({
|
|
20
|
-
selector: '[vicGroupedBarsEvents]',
|
|
21
|
-
})
|
|
22
|
-
export class GroupedBarsEventsDirective<
|
|
23
|
-
Datum,
|
|
24
|
-
TOrdinalValue extends DataValue,
|
|
25
|
-
TGroupedBarsComponent extends GroupedBarsComponent<Datum, TOrdinalValue> =
|
|
26
|
-
GroupedBarsComponent<Datum, TOrdinalValue>,
|
|
27
|
-
>
|
|
28
|
-
extends EventsDirective<BarsHost<Datum, TOrdinalValue>>
|
|
29
|
-
implements BarsHost<Datum, TOrdinalValue>
|
|
30
|
-
{
|
|
31
|
-
@Input()
|
|
32
|
-
hoverActions:
|
|
33
|
-
| EventAction<
|
|
34
|
-
BarsHost<Datum, TOrdinalValue>,
|
|
35
|
-
BarsInteractionOutput<Datum>
|
|
36
|
-
>[]
|
|
37
|
-
| null;
|
|
38
|
-
@Input()
|
|
39
|
-
hoverMoveActions:
|
|
40
|
-
| HoverMoveAction<
|
|
41
|
-
BarsHost<Datum, TOrdinalValue>,
|
|
42
|
-
BarsInteractionOutput<Datum>
|
|
43
|
-
>[]
|
|
44
|
-
| null;
|
|
45
|
-
@Input()
|
|
46
|
-
clickActions:
|
|
47
|
-
| EventAction<
|
|
48
|
-
BarsHost<Datum, TOrdinalValue>,
|
|
49
|
-
BarsInteractionOutput<Datum>
|
|
50
|
-
>[]
|
|
51
|
-
| null;
|
|
52
|
-
@Input()
|
|
53
|
-
inputEventActions: InputEventAction<
|
|
54
|
-
BarsHost<Datum, TOrdinalValue>,
|
|
55
|
-
BarsInteractionOutput<Datum>
|
|
56
|
-
>[];
|
|
57
|
-
@Output() interactionOutput =
|
|
58
|
-
new EventEmitter<BarsInteractionOutput<Datum> | null>();
|
|
59
|
-
|
|
60
|
-
barDatum: BarDatum<TOrdinalValue>;
|
|
61
|
-
origin: SVGRectElement;
|
|
62
|
-
|
|
63
|
-
public bars = inject<TGroupedBarsComponent>(BARS);
|
|
64
|
-
|
|
65
|
-
get marks(): GroupedBarsComponent<Datum, TOrdinalValue> {
|
|
66
|
-
return this.bars;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
getElements(): Observable<Element[]> {
|
|
70
|
-
return this.bars.bars$.pipe(map((sel) => sel.nodes()));
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
getBarDatum(): BarDatum<TOrdinalValue> | null {
|
|
74
|
-
return this.barDatum ?? null;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
setupListeners(elements: Element[]): UnlistenFunction[] {
|
|
78
|
-
if (this.inputEventActions?.length && this.inputEvent$) {
|
|
79
|
-
this.events.push(EventType.Input);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
return this.bindEventListeners(
|
|
83
|
-
elements,
|
|
84
|
-
this.buildInteractionListeners({
|
|
85
|
-
hover: this.hoverActions?.length && {
|
|
86
|
-
pointerenter: (e, el) => this.onEnter(e, el),
|
|
87
|
-
pointerleave: (e, el) => this.onLeave(e, el),
|
|
88
|
-
},
|
|
89
|
-
hoverMove: this.hoverMoveActions?.length && {
|
|
90
|
-
pointerenter: (e, el) => this.onEnter(e, el),
|
|
91
|
-
pointermove: (e, el) => this.onMove(e, el),
|
|
92
|
-
pointerleave: (e, el) => this.onLeave(e, el),
|
|
93
|
-
},
|
|
94
|
-
click: this.clickActions?.length && {
|
|
95
|
-
click: (e, el) => this.onClick(e, el),
|
|
96
|
-
},
|
|
97
|
-
})
|
|
98
|
-
);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
onEnter(_: PointerEvent, el: Element): void {
|
|
102
|
-
this.initFromElement(el);
|
|
103
|
-
if (this.isEventAllowed(EventType.Hover)) {
|
|
104
|
-
this.setPositionsFromElement();
|
|
105
|
-
this.runActions(this.hoverActions, (a) => a.onStart(this.asHost()));
|
|
106
|
-
} else if (this.isEventAllowed(EventType.HoverMove)) {
|
|
107
|
-
this.runActions(this.hoverMoveActions, (a) => {
|
|
108
|
-
if (a.initialize) {
|
|
109
|
-
a.initialize(this.asHost());
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
116
|
-
onMove(event: PointerEvent, _: Element): void {
|
|
117
|
-
if (this.isEventAllowed(EventType.HoverMove)) {
|
|
118
|
-
this.setPositionsFromPointer(event);
|
|
119
|
-
this.hoverMoveActions.forEach((action) => action.onStart(this.asHost()));
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
124
|
-
onLeave(_: PointerEvent, __: Element): void {
|
|
125
|
-
if (this.isEventAllowed(EventType.Hover)) {
|
|
126
|
-
this.hoverActions.forEach((action) => action.onEnd(this.asHost()));
|
|
127
|
-
} else if (this.isEventAllowed(EventType.HoverMove)) {
|
|
128
|
-
this.hoverMoveActions.forEach((action) => action.onEnd(this.asHost()));
|
|
129
|
-
}
|
|
130
|
-
this.resetDirective();
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
onClick(event: PointerEvent, el: Element): void {
|
|
134
|
-
this.initFromElement(el);
|
|
135
|
-
if (!this.preventAction.click) {
|
|
136
|
-
if (this.hasEvent(EventType.Hover)) {
|
|
137
|
-
this.setPositionsFromElement();
|
|
138
|
-
} else {
|
|
139
|
-
this.setPositionsFromPointer(event);
|
|
140
|
-
}
|
|
141
|
-
this.runActions(this.clickActions, (a) => a.onStart(this.asHost()));
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
onClickRemove(): void {
|
|
146
|
-
if (!this.preventAction.click) {
|
|
147
|
-
this.runActions(this.clickActions, (a) => a.onEnd(this.asHost()));
|
|
148
|
-
this.resetDirective();
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
onInputEvent(inputValue: unknown): void {
|
|
153
|
-
if (this.isEventAllowed(EventType.Input)) {
|
|
154
|
-
if (inputValue === null || inputValue === undefined) {
|
|
155
|
-
this.inputEventActions.forEach((action) =>
|
|
156
|
-
action.onEnd(this, inputValue)
|
|
157
|
-
);
|
|
158
|
-
} else {
|
|
159
|
-
this.inputEventActions.forEach((action) =>
|
|
160
|
-
action.onStart(this, inputValue)
|
|
161
|
-
);
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
initFromElement(el: Element): void {
|
|
167
|
-
this.origin = el as SVGRectElement;
|
|
168
|
-
this.barDatum = select(
|
|
169
|
-
el as SVGRectElement
|
|
170
|
-
).datum() as BarDatum<TOrdinalValue>;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
setPositionsFromElement(): void {
|
|
174
|
-
const barRect = this.origin.getBoundingClientRect();
|
|
175
|
-
this.positionX = barRect.width / 2;
|
|
176
|
-
this.positionY = barRect.height / 2;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
getInteractionOutput(type: EventType): BarsInteractionOutput<Datum> {
|
|
180
|
-
const datum = this.bars.getSourceDatumFromBarDatum(this.barDatum);
|
|
181
|
-
const tooltipData = datum ? this.bars.getTooltipData(datum) : undefined;
|
|
182
|
-
const position = new BarsTooltipPositioner({
|
|
183
|
-
x: this.positionX,
|
|
184
|
-
y: this.positionY,
|
|
185
|
-
});
|
|
186
|
-
|
|
187
|
-
return {
|
|
188
|
-
...tooltipData,
|
|
189
|
-
origin: this.origin,
|
|
190
|
-
anchor: {
|
|
191
|
-
x: this.positionX,
|
|
192
|
-
y: this.positionY,
|
|
193
|
-
},
|
|
194
|
-
defaultPosition: position.fromAnchor({
|
|
195
|
-
x: 0,
|
|
196
|
-
y: DEFAULT_TOOLTIP_Y_OFFSET,
|
|
197
|
-
}),
|
|
198
|
-
fromAnchor: (offset?: Partial<{ x: number; y: number }>) => {
|
|
199
|
-
return position.fromAnchor({
|
|
200
|
-
x: offset?.x ?? 0,
|
|
201
|
-
y: offset?.y ?? DEFAULT_TOOLTIP_Y_OFFSET,
|
|
202
|
-
});
|
|
203
|
-
},
|
|
204
|
-
customPosition: (positions: TooltipPosition[]) => {
|
|
205
|
-
return position.customPosition(positions);
|
|
206
|
-
},
|
|
207
|
-
type,
|
|
208
|
-
};
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
emitInteractionOutput(output: BarsInteractionOutput<Datum> | null): void {
|
|
212
|
-
this.interactionOutput.emit(output);
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
private resetDirective(): void {
|
|
216
|
-
this.barDatum = undefined;
|
|
217
|
-
this.origin = undefined;
|
|
218
|
-
this.positionX = undefined;
|
|
219
|
-
this.positionY = undefined;
|
|
220
|
-
}
|
|
221
|
-
}
|
|
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 { GroupedBarsComponent } from './grouped-bars.component';
|
|
5
|
-
|
|
6
|
-
describe('GroupedBarsComponent', () => {
|
|
7
|
-
let component: GroupedBarsComponent<any, string>;
|
|
8
|
-
let fixture: ComponentFixture<GroupedBarsComponent<any, string>>;
|
|
9
|
-
|
|
10
|
-
beforeEach(async () => {
|
|
11
|
-
await TestBed.configureTestingModule({
|
|
12
|
-
imports: [GroupedBarsComponent],
|
|
13
|
-
providers: [XyChartComponent],
|
|
14
|
-
}).compileComponents();
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
beforeEach(() => {
|
|
18
|
-
fixture = TestBed.createComponent(GroupedBarsComponent<any, string>);
|
|
19
|
-
component = fixture.componentInstance;
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('should create', () => {
|
|
23
|
-
expect(component).toBeTruthy();
|
|
24
|
-
});
|
|
25
|
-
});
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ChangeDetectionStrategy,
|
|
3
|
-
Component,
|
|
4
|
-
Input,
|
|
5
|
-
ViewEncapsulation,
|
|
6
|
-
} from '@angular/core';
|
|
7
|
-
import { scaleBand } from 'd3';
|
|
8
|
-
import { BarDatum, BARS, BarsComponent } from '../bars/bars.component';
|
|
9
|
-
import { ChartComponent, XyChartComponent } from '../charts';
|
|
10
|
-
import { DataValue } from '../core/types/values';
|
|
11
|
-
import { VIC_PRIMARY_MARKS } from '../marks/primary-marks/primary-marks';
|
|
12
|
-
import { GroupedBarsConfig } from './config/grouped-bars-config';
|
|
13
|
-
|
|
14
|
-
@Component({
|
|
15
|
-
// eslint-disable-next-line @angular-eslint/component-selector
|
|
16
|
-
selector: '[vic-primary-grouped-bars]',
|
|
17
|
-
template: '',
|
|
18
|
-
styleUrls: ['./grouped-bars.component.scss'],
|
|
19
|
-
encapsulation: ViewEncapsulation.None,
|
|
20
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
21
|
-
providers: [
|
|
22
|
-
{ provide: VIC_PRIMARY_MARKS, useExisting: GroupedBarsComponent },
|
|
23
|
-
{ provide: BARS, useExisting: GroupedBarsComponent },
|
|
24
|
-
{ provide: ChartComponent, useExisting: XyChartComponent },
|
|
25
|
-
],
|
|
26
|
-
host: {
|
|
27
|
-
'[class]': 'config.marksClass',
|
|
28
|
-
'[style.mixBlendMode]': 'config.mixBlendMode',
|
|
29
|
-
},
|
|
30
|
-
})
|
|
31
|
-
export class GroupedBarsComponent<
|
|
32
|
-
Datum,
|
|
33
|
-
TOrdinalValue extends DataValue,
|
|
34
|
-
> extends BarsComponent<Datum, TOrdinalValue> {
|
|
35
|
-
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
36
|
-
@Input('config') override config: GroupedBarsConfig<Datum, TOrdinalValue>;
|
|
37
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
38
|
-
groupScale: any;
|
|
39
|
-
|
|
40
|
-
override drawMarks(): void {
|
|
41
|
-
this.setGroupScale();
|
|
42
|
-
super.drawMarks();
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
setGroupScale(): void {
|
|
46
|
-
if (this.config.dimensions.ordinal === 'x') {
|
|
47
|
-
this.groupScale = scaleBand(this.config.color.calculatedDomain, [
|
|
48
|
-
0,
|
|
49
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
50
|
-
(this.scales.x as any).bandwidth(),
|
|
51
|
-
]).padding(this.config.intraGroupPadding);
|
|
52
|
-
} else {
|
|
53
|
-
this.groupScale = scaleBand(this.config.color.calculatedDomain, [
|
|
54
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
55
|
-
(this.scales.y as any).bandwidth(),
|
|
56
|
-
0,
|
|
57
|
-
]).padding(this.config.intraGroupPadding);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
override getBarColor(d: BarDatum<TOrdinalValue>): string {
|
|
62
|
-
return this.scales.color(d.color);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
override getBarXOrdinal(d: BarDatum<TOrdinalValue>): number {
|
|
66
|
-
return this.scales.x(d.ordinal) + this.groupScale(d.color);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
override getBarY(d: BarDatum<TOrdinalValue>): number {
|
|
70
|
-
if (this.config.dimensions.ordinal === 'x') {
|
|
71
|
-
return this.getBarYQuantitative(d);
|
|
72
|
-
} else {
|
|
73
|
-
return this.getBarYOrdinal(d);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
override getBarYOrdinal(d: BarDatum<TOrdinalValue>): number {
|
|
78
|
-
return this.scales.y(d.ordinal) + this.groupScale(d.color);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
override getBarYQuantitative(d: BarDatum<TOrdinalValue>): number {
|
|
82
|
-
return this.scales.y(d.quantitative);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
override getBarWidthOrdinal(): number {
|
|
86
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
87
|
-
return (this.groupScale as any).bandwidth();
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
override getBarHeightOrdinal(): number {
|
|
91
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
92
|
-
return (this.groupScale as any).bandwidth();
|
|
93
|
-
}
|
|
94
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { NgModule } from '@angular/core';
|
|
2
|
-
import { GroupedBarsEventsDirective } from './events/grouped-bars-events.directive';
|
|
3
|
-
import { GroupedBarsComponent } from './grouped-bars.component';
|
|
4
|
-
|
|
5
|
-
@NgModule({
|
|
6
|
-
imports: [GroupedBarsComponent, GroupedBarsEventsDirective],
|
|
7
|
-
exports: [GroupedBarsComponent, GroupedBarsEventsDirective],
|
|
8
|
-
})
|
|
9
|
-
export class VicGroupedBarsModule {}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export type {
|
|
2
|
-
BarsHost as GroupedBarsHost,
|
|
3
|
-
BarsInteractionOutput as GroupedBarsInteractionOutput,
|
|
4
|
-
} from '../bars';
|
|
5
|
-
export * from './config/grouped-bars-builder';
|
|
6
|
-
export * from './config/grouped-bars-config';
|
|
7
|
-
export * from './config/grouped-bars-options';
|
|
8
|
-
export * from './events/grouped-bars-events.directive';
|
|
9
|
-
export * from './grouped-bars.component';
|
|
10
|
-
export * from './grouped-bars.module';
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { safeAssign } from '@mathstack/app-kit';
|
|
2
|
-
import { VicImage } from './image-download-enums';
|
|
3
|
-
import { ImageDownloadOptions } from './image-download-options';
|
|
4
|
-
|
|
5
|
-
const DEFAULT = {
|
|
6
|
-
fontEmbedCSS: undefined,
|
|
7
|
-
backgroundColor: '#fff',
|
|
8
|
-
quality: 1,
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export class VicJpegImageConfig implements ImageDownloadOptions {
|
|
12
|
-
backgroundColor: string;
|
|
13
|
-
containerNode: HTMLElement;
|
|
14
|
-
fileName: string;
|
|
15
|
-
filter: (domNode: HTMLElement) => boolean;
|
|
16
|
-
fontEmbedCSS: string;
|
|
17
|
-
imageType: string;
|
|
18
|
-
quality: number;
|
|
19
|
-
|
|
20
|
-
constructor(options?: Partial<ImageDownloadOptions>) {
|
|
21
|
-
safeAssign(this, DEFAULT);
|
|
22
|
-
safeAssign(this, options);
|
|
23
|
-
this.imageType = VicImage.jpeg;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export class VicPngImageConfig implements ImageDownloadOptions {
|
|
28
|
-
backgroundColor: string;
|
|
29
|
-
containerNode: HTMLElement;
|
|
30
|
-
fileName: string;
|
|
31
|
-
filter: (domNode: HTMLElement) => boolean;
|
|
32
|
-
fontEmbedCSS: string;
|
|
33
|
-
imageType: string;
|
|
34
|
-
quality: number;
|
|
35
|
-
|
|
36
|
-
constructor(options?: Partial<ImageDownloadOptions>) {
|
|
37
|
-
safeAssign(this, DEFAULT);
|
|
38
|
-
safeAssign(this, options);
|
|
39
|
-
this.imageType = VicImage.png;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export class VicSvgImageConfig implements ImageDownloadOptions {
|
|
44
|
-
backgroundColor: string;
|
|
45
|
-
containerNode: HTMLElement;
|
|
46
|
-
fileName: string;
|
|
47
|
-
filter: (domNode: HTMLElement) => boolean;
|
|
48
|
-
fontEmbedCSS: string;
|
|
49
|
-
imageType: string;
|
|
50
|
-
quality: number;
|
|
51
|
-
|
|
52
|
-
constructor(options?: Partial<ImageDownloadOptions>) {
|
|
53
|
-
safeAssign(this, DEFAULT);
|
|
54
|
-
safeAssign(this, options);
|
|
55
|
-
this.imageType = VicImage.svg;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export interface ImageDownloadOptions {
|
|
2
|
-
backgroundColor: string;
|
|
3
|
-
containerNode: HTMLElement;
|
|
4
|
-
fileName: string;
|
|
5
|
-
filter: (domNode: HTMLElement) => boolean;
|
|
6
|
-
/**
|
|
7
|
-
* Disables external fonts from being read in
|
|
8
|
-
* Supply with custom css fallback; or set to undefined to read external fonts
|
|
9
|
-
* (will oftentimes get security errors)
|
|
10
|
-
*/
|
|
11
|
-
fontEmbedCSS: string;
|
|
12
|
-
imageType: string;
|
|
13
|
-
quality: number;
|
|
14
|
-
}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { Injectable } from '@angular/core';
|
|
2
|
-
import * as domToImage from 'html-to-image';
|
|
3
|
-
import {
|
|
4
|
-
VicJpegImageConfig,
|
|
5
|
-
VicPngImageConfig,
|
|
6
|
-
VicSvgImageConfig,
|
|
7
|
-
} from './image-download-config';
|
|
8
|
-
import { VicImage } from './image-download-enums';
|
|
9
|
-
|
|
10
|
-
@Injectable({ providedIn: 'root' })
|
|
11
|
-
export class VicImageDownloadService {
|
|
12
|
-
domToImage = domToImage;
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* @param imageConfig
|
|
16
|
-
* @returns fontEmbedCSS -- scans stylesheets for font files and base64 encodes them,
|
|
17
|
-
* reuse this value in imageConfig for subsequent downloads to avoid
|
|
18
|
-
* re-encoding fonts (slight performance boost)
|
|
19
|
-
*/
|
|
20
|
-
async downloadImage(
|
|
21
|
-
imageConfig: VicJpegImageConfig | VicPngImageConfig | VicSvgImageConfig
|
|
22
|
-
): Promise<string | void> {
|
|
23
|
-
let dataUrl;
|
|
24
|
-
if (imageConfig.fontEmbedCSS === undefined) {
|
|
25
|
-
imageConfig.fontEmbedCSS = await domToImage.getFontEmbedCSS(
|
|
26
|
-
imageConfig.containerNode
|
|
27
|
-
);
|
|
28
|
-
}
|
|
29
|
-
const sizedImageConfig = {
|
|
30
|
-
...imageConfig,
|
|
31
|
-
width: imageConfig.containerNode.scrollWidth,
|
|
32
|
-
height: imageConfig.containerNode.scrollHeight,
|
|
33
|
-
};
|
|
34
|
-
switch (imageConfig.imageType) {
|
|
35
|
-
case VicImage.jpeg:
|
|
36
|
-
dataUrl = await this.domToImage.toJpeg(
|
|
37
|
-
imageConfig.containerNode,
|
|
38
|
-
sizedImageConfig
|
|
39
|
-
);
|
|
40
|
-
break;
|
|
41
|
-
case VicImage.png:
|
|
42
|
-
dataUrl = await this.domToImage.toPng(
|
|
43
|
-
imageConfig.containerNode,
|
|
44
|
-
sizedImageConfig
|
|
45
|
-
);
|
|
46
|
-
break;
|
|
47
|
-
case VicImage.svg:
|
|
48
|
-
dataUrl = await this.domToImage.toSvg(
|
|
49
|
-
imageConfig.containerNode,
|
|
50
|
-
sizedImageConfig
|
|
51
|
-
);
|
|
52
|
-
break;
|
|
53
|
-
default:
|
|
54
|
-
break;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
this.createLinkAndClick(
|
|
58
|
-
dataUrl,
|
|
59
|
-
`${imageConfig.fileName}.${imageConfig.imageType}`
|
|
60
|
-
);
|
|
61
|
-
return imageConfig.fontEmbedCSS;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
createLinkAndClick(dataUrl: string, fileName: string) {
|
|
65
|
-
const link = document.createElement('a');
|
|
66
|
-
link.download = fileName;
|
|
67
|
-
link.href = dataUrl;
|
|
68
|
-
link.click();
|
|
69
|
-
}
|
|
70
|
-
}
|