@mathstack/viz 2.0.3 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/mathstack-viz.mjs +11024 -0
- package/fesm2022/mathstack-viz.mjs.map +1 -0
- package/package.json +14 -5
- package/types/mathstack-viz.d.ts +5830 -0
- package/CHANGELOG.md +0 -0
- package/cypress/fixtures/example.json +0 -5
- package/cypress/fixtures/usMap.json +0 -13511
- package/cypress/support/commands.ts +0 -104
- package/cypress/support/component-index.html +0 -12
- package/cypress/support/component.ts +0 -33
- package/cypress.config.ts +0 -9
- package/karma.conf.js +0 -62
- package/ng-package.json +0 -8
- package/project.json +0 -97
- package/src/.eslintrc.json +0 -35
- package/src/.prettierrc +0 -31
- package/src/lib/axes/base/config/xy-axis-builder.ts +0 -68
- package/src/lib/axes/base/config/xy-axis-config.ts +0 -35
- package/src/lib/axes/base/config/xy-axis-options.ts +0 -11
- package/src/lib/axes/base/xy-axis-base.spec.ts +0 -114
- package/src/lib/axes/base/xy-axis-base.ts +0 -300
- package/src/lib/axes/base/xy-axis-domain-lines.cy.ts +0 -511
- package/src/lib/axes/baseline/axis-baseline-builder.ts +0 -77
- package/src/lib/axes/baseline/axis-baseline-options.ts +0 -4
- package/src/lib/axes/baseline/axis-baseline.ts +0 -11
- package/src/lib/axes/grid/grid-builder.ts +0 -74
- package/src/lib/axes/grid/grid-config.ts +0 -13
- package/src/lib/axes/grid/grid-options.ts +0 -7
- package/src/lib/axes/index.ts +0 -40
- package/src/lib/axes/label/axis-label-builder.ts +0 -140
- package/src/lib/axes/label/axis-label-options.ts +0 -12
- package/src/lib/axes/label/axis-label.ts +0 -18
- package/src/lib/axes/label/axis-labels.cy.ts +0 -303
- package/src/lib/axes/ordinal/ordinal-axis-config.ts +0 -31
- package/src/lib/axes/ordinal/ordinal-axis.spec.ts +0 -30
- package/src/lib/axes/ordinal/ordinal-axis.ts +0 -26
- package/src/lib/axes/quantitative/quantitative-axis-config.ts +0 -39
- package/src/lib/axes/quantitative/quantitative-axis-ticks.cy.ts +0 -748
- package/src/lib/axes/quantitative/quantitative-axis.spec.ts +0 -537
- package/src/lib/axes/quantitative/quantitative-axis.ts +0 -191
- package/src/lib/axes/ticks/tick-wrap/tick-wrap-builder.ts +0 -141
- package/src/lib/axes/ticks/tick-wrap/tick-wrap-options.ts +0 -11
- package/src/lib/axes/ticks/tick-wrap/tick-wrap.cy.ts +0 -360
- package/src/lib/axes/ticks/tick-wrap/tick-wrap.ts +0 -21
- package/src/lib/axes/ticks/ticks-builder.ts +0 -370
- package/src/lib/axes/ticks/ticks-options.ts +0 -24
- package/src/lib/axes/ticks/ticks.ts +0 -33
- package/src/lib/axes/x/x-axis-config.ts +0 -48
- package/src/lib/axes/x/x-axis.spec.ts +0 -90
- package/src/lib/axes/x/x-axis.ts +0 -109
- package/src/lib/axes/x-ordinal/x-ordinal-axis-builder.ts +0 -75
- package/src/lib/axes/x-ordinal/x-ordinal-axis-config.ts +0 -27
- package/src/lib/axes/x-ordinal/x-ordinal-axis.component.ts +0 -33
- package/src/lib/axes/x-quantitative/x-quantitative-axis-builder.ts +0 -74
- package/src/lib/axes/x-quantitative/x-quantitative-axis-config.ts +0 -32
- package/src/lib/axes/x-quantitative/x-quantitative-axis.component.ts +0 -40
- package/src/lib/axes/xy-axis.module.ts +0 -20
- package/src/lib/axes/y/y-axis-config.ts +0 -47
- package/src/lib/axes/y/y-axis.spec.ts +0 -92
- package/src/lib/axes/y/y-axis.ts +0 -161
- package/src/lib/axes/y-ordinal/y-ordinal-axis-builder.ts +0 -76
- package/src/lib/axes/y-ordinal/y-ordinal-axis-config.ts +0 -29
- package/src/lib/axes/y-ordinal/y-ordinal-axis.component.ts +0 -33
- package/src/lib/axes/y-quantitative-axis/y-quantitative-axis-builder.ts +0 -74
- package/src/lib/axes/y-quantitative-axis/y-quantitative-axis-config.ts +0 -34
- package/src/lib/axes/y-quantitative-axis/y-quantitative-axis.component.ts +0 -40
- package/src/lib/bars/bars.component.scss +0 -0
- package/src/lib/bars/bars.component.spec.ts +0 -1470
- package/src/lib/bars/bars.component.ts +0 -717
- package/src/lib/bars/bars.cy.ts +0 -829
- package/src/lib/bars/bars.module.ts +0 -9
- package/src/lib/bars/config/backgrounds/bars-backgrounds-builder.ts +0 -51
- package/src/lib/bars/config/backgrounds/bars-backgrounds-options.ts +0 -4
- package/src/lib/bars/config/backgrounds/bars-backgrounds.ts +0 -11
- package/src/lib/bars/config/bars-builder.ts +0 -340
- package/src/lib/bars/config/bars-config.spec.ts +0 -132
- package/src/lib/bars/config/bars-config.ts +0 -70
- package/src/lib/bars/config/bars-dimensions.ts +0 -29
- package/src/lib/bars/config/bars-options.ts +0 -20
- package/src/lib/bars/config/labels/bars-labels-builder.ts +0 -89
- package/src/lib/bars/config/labels/bars-labels-options.ts +0 -6
- package/src/lib/bars/config/labels/bars-labels.cy.ts +0 -781
- package/src/lib/bars/config/labels/bars-labels.ts +0 -13
- package/src/lib/bars/events/actions/bars-click-actions.ts +0 -23
- package/src/lib/bars/events/actions/bars-hover-actions.ts +0 -43
- package/src/lib/bars/events/actions/bars-hover-move-actions.ts +0 -21
- package/src/lib/bars/events/bars-events.directive.spec.ts +0 -186
- package/src/lib/bars/events/bars-events.directive.ts +0 -235
- package/src/lib/bars/events/bars-interaction-output.ts +0 -17
- package/src/lib/bars/events/bars-tooltip-positioner.ts +0 -24
- package/src/lib/bars/index.ts +0 -18
- package/src/lib/charts/chart/chart-scaling.cy.ts +0 -323
- package/src/lib/charts/chart/chart.component.html +0 -45
- package/src/lib/charts/chart/chart.component.scss +0 -37
- package/src/lib/charts/chart/chart.component.ts +0 -243
- package/src/lib/charts/chart/chart.token.ts +0 -4
- package/src/lib/charts/chart/chart.ts +0 -5
- package/src/lib/charts/chart/config/chart-builder.ts +0 -194
- package/src/lib/charts/chart/config/chart-config.ts +0 -21
- package/src/lib/charts/chart/config/chart-options.ts +0 -11
- package/src/lib/charts/chart.module.ts +0 -10
- package/src/lib/charts/index.ts +0 -9
- package/src/lib/charts/map-chart/map-chart.component.scss +0 -0
- package/src/lib/charts/map-chart/map-chart.component.spec.ts +0 -35
- package/src/lib/charts/map-chart/map-chart.component.ts +0 -61
- package/src/lib/charts/xy-chart/xy-chart.component.spec.ts +0 -34
- package/src/lib/charts/xy-chart/xy-chart.component.ts +0 -65
- package/src/lib/core/common-behaviors/constructor.ts +0 -7
- package/src/lib/core/index.ts +0 -11
- package/src/lib/core/pipes/resize-chart-height.pipe.spec.ts +0 -23
- package/src/lib/core/pipes/resize-chart-height.pipe.ts +0 -20
- package/src/lib/core/styles/_spacing.scss +0 -4
- package/src/lib/core/types/layout.ts +0 -28
- package/src/lib/core/types/scale.ts +0 -6
- package/src/lib/core/types/utility.ts +0 -11
- package/src/lib/core/types/values.ts +0 -10
- package/src/lib/core/utilities/colors.spec.ts +0 -57
- package/src/lib/core/utilities/colors.ts +0 -42
- package/src/lib/core/utilities/fill-utilities.spec.ts +0 -25
- package/src/lib/core/utilities/fill-utilities.ts +0 -21
- package/src/lib/core/utilities/type-guards.spec.ts +0 -55
- package/src/lib/core/utilities/type-guards.ts +0 -33
- package/src/lib/core/utilities/value-format.ts +0 -21
- package/src/lib/core/utilities/values.spec.ts +0 -954
- package/src/lib/core/utilities/values.ts +0 -189
- package/src/lib/data-dimensions/continuous-quantitative/date-chart-position/date-chart-position-builder.ts +0 -105
- package/src/lib/data-dimensions/continuous-quantitative/date-chart-position/date-chart-position-options.ts +0 -24
- package/src/lib/data-dimensions/continuous-quantitative/date-chart-position/date-chart-position.spec.ts +0 -66
- package/src/lib/data-dimensions/continuous-quantitative/date-chart-position/date-chart-position.ts +0 -72
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/concrete-domain-padding.ts +0 -10
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/domain-padding.ts +0 -76
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/domain-test-utility.ts +0 -130
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/percent-over/percent-over-options.ts +0 -3
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/percent-over/percent-over.ts +0 -37
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/pixel/pixel-options.ts +0 -3
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/pixel/pixel.ts +0 -73
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/quantitative-domain-padding.cy.ts +0 -978
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/round-to-interval/round-to-interval-options.ts +0 -3
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/round-to-interval/round-to-interval.ts +0 -27
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/round-to-sig-fig/round-to-sig-fig-options.ts +0 -3
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/round-to-sig-fig/round-to-sig-fig.ts +0 -30
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/number-chart-position-builder.ts +0 -183
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/number-chart-position-options.ts +0 -8
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/number-chart-position.spec.ts +0 -28
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/number-chart-position.ts +0 -62
- package/src/lib/data-dimensions/continuous-quantitative/number-dimension/number-dimension-options.ts +0 -15
- package/src/lib/data-dimensions/continuous-quantitative/number-dimension/number-dimension.spec.ts +0 -155
- package/src/lib/data-dimensions/continuous-quantitative/number-dimension/number-dimension.ts +0 -57
- package/src/lib/data-dimensions/continuous-quantitative/number-visual-value/number-visual-value-builder.ts +0 -166
- package/src/lib/data-dimensions/continuous-quantitative/number-visual-value/number-visual-value-options.ts +0 -10
- package/src/lib/data-dimensions/continuous-quantitative/number-visual-value/number-visual-value.spec.ts +0 -34
- package/src/lib/data-dimensions/continuous-quantitative/number-visual-value/number-visual-value.ts +0 -57
- package/src/lib/data-dimensions/dimension-builder.ts +0 -45
- package/src/lib/data-dimensions/dimension-options.ts +0 -12
- package/src/lib/data-dimensions/dimension.ts +0 -30
- package/src/lib/data-dimensions/index.ts +0 -31
- package/src/lib/data-dimensions/ordinal/ordinal-chart-position/ordinal-chart-position-builder.ts +0 -122
- package/src/lib/data-dimensions/ordinal/ordinal-chart-position/ordinal-chart-position-options.ts +0 -12
- package/src/lib/data-dimensions/ordinal/ordinal-chart-position/ordinal-chart-position.spec.ts +0 -83
- package/src/lib/data-dimensions/ordinal/ordinal-chart-position/ordinal-chart-position.ts +0 -101
- package/src/lib/data-dimensions/ordinal/ordinal-visual-value/ordinal-visual-value-builder.ts +0 -108
- package/src/lib/data-dimensions/ordinal/ordinal-visual-value/ordinal-visual-value-options.ts +0 -12
- package/src/lib/data-dimensions/ordinal/ordinal-visual-value/ordinal-visual-value.cy.ts +0 -384
- package/src/lib/data-dimensions/ordinal/ordinal-visual-value/ordinal-visual-value.spec.ts +0 -63
- package/src/lib/data-dimensions/ordinal/ordinal-visual-value/ordinal-visual-value.ts +0 -79
- package/src/lib/data-export/data-export-config.ts +0 -98
- package/src/lib/data-export/data-export.spec.ts +0 -33
- package/src/lib/data-export/data-export.ts +0 -87
- package/src/lib/data-export/index.ts +0 -2
- package/src/lib/dots/config/dots-builder.ts +0 -442
- package/src/lib/dots/config/dots-config.spec.ts +0 -123
- package/src/lib/dots/config/dots-config.ts +0 -81
- package/src/lib/dots/config/dots-options.ts +0 -32
- package/src/lib/dots/dots.component.scss +0 -0
- package/src/lib/dots/dots.component.spec.ts +0 -143
- package/src/lib/dots/dots.component.ts +0 -291
- package/src/lib/dots/dots.cy.ts +0 -594
- package/src/lib/dots/dots.module.ts +0 -9
- package/src/lib/dots/events/actions/dots-hover-actions.ts +0 -19
- package/src/lib/dots/events/actions/dots-hover-move-actions.ts +0 -38
- package/src/lib/dots/events/dots-events.directive.ts +0 -214
- package/src/lib/dots/events/dots-interaction-output.ts +0 -15
- package/src/lib/dots/events/dots-tooltip-positioner.ts +0 -24
- package/src/lib/dots/index.ts +0 -10
- package/src/lib/events/events.directive.ts +0 -184
- package/src/lib/events/events.types.ts +0 -57
- package/src/lib/events/index.ts +0 -4
- package/src/lib/events/interaction-output.ts +0 -34
- package/src/lib/events/tooltip-positioner.ts +0 -15
- package/src/lib/fill-definitions/fill-definitions.ts +0 -4
- package/src/lib/fill-definitions/index.ts +0 -1
- package/src/lib/geographies/config/geographies-builder.ts +0 -224
- package/src/lib/geographies/config/geographies-config.spec.ts +0 -100
- package/src/lib/geographies/config/geographies-config.ts +0 -81
- package/src/lib/geographies/config/geographies-options.ts +0 -37
- package/src/lib/geographies/config/layers/attribute-data-layer/attribute-data-layer-builder.ts +0 -212
- package/src/lib/geographies/config/layers/attribute-data-layer/attribute-data-layer-options.ts +0 -26
- package/src/lib/geographies/config/layers/attribute-data-layer/attribute-data-layer.spec.ts +0 -119
- package/src/lib/geographies/config/layers/attribute-data-layer/attribute-data-layer.ts +0 -148
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/attribute-data/attribute-data-dimension-builder.ts +0 -65
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/attribute-data/attribute-data-dimension-options.ts +0 -15
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/attribute-data/attribute-data-dimension.ts +0 -32
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/attribute-data-bin-enums.ts +0 -10
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/attribute-data-bin-types.ts +0 -15
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/calculated-bins/calculated-bins-builder.ts +0 -18
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/calculated-bins/calculated-bins-options.ts +0 -8
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/calculated-bins/calculated-bins.spec.ts +0 -60
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/calculated-bins/calculated-bins.ts +0 -34
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/categorical-bins/categorical-bins-builder.ts +0 -46
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/categorical-bins/categorical-bins-options.ts +0 -8
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/categorical-bins/categorical-bins.cy.ts +0 -437
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/categorical-bins/categorical-bins.spec.ts +0 -105
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/categorical-bins/categorical-bins.ts +0 -54
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/custom-breaks/custom-breaks-bins-builder.ts +0 -65
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/custom-breaks/custom-breaks-bins-options.ts +0 -9
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/custom-breaks/custom-breaks-bins.spec.ts +0 -82
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/custom-breaks/custom-breaks-bins.ts +0 -81
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/custom-breaks/custom-breaks.cy.ts +0 -378
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/equal-frequencies-bins/equal-frequencies-bins-builder.ts +0 -50
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/equal-frequencies-bins/equal-frequencies-bins-options.ts +0 -8
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/equal-frequencies-bins/equal-frequencies-bins.cy.ts +0 -362
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/equal-frequencies-bins/equal-frequencies-bins.spec.ts +0 -72
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/equal-frequencies-bins/equal-frequencies-bins.ts +0 -56
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/equal-value-ranges-bins/equal-value-ranges-bins-builder.ts +0 -60
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/equal-value-ranges-bins/equal-value-ranges-bins-options.ts +0 -9
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/equal-value-ranges-bins/equal-value-ranges-bins.cy.ts +0 -307
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/equal-value-ranges-bins/equal-value-ranges-bins.spec.ts +0 -104
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/equal-value-ranges-bins/equal-value-ranges-bins.ts +0 -89
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/no-bins/no-bins-builder.ts +0 -62
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/no-bins/no-bins-options.ts +0 -8
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/no-bins/no-bins.cy.ts +0 -265
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/no-bins/no-bins.spec.ts +0 -42
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/no-bins/no-bins.ts +0 -42
- package/src/lib/geographies/config/layers/geographies-layer/geographies-layer-builder.ts +0 -116
- package/src/lib/geographies/config/layers/geographies-layer/geographies-layer-options.ts +0 -20
- package/src/lib/geographies/config/layers/geographies-layer/geographies-layer.ts +0 -104
- package/src/lib/geographies/config/layers/geojson-properties-layer/geojson-properties-layer-builder.ts +0 -111
- package/src/lib/geographies/config/layers/geojson-properties-layer/geojson-properties-layer-options.ts +0 -19
- package/src/lib/geographies/config/layers/geojson-properties-layer/geojson-properties-layer.spec.ts +0 -41
- package/src/lib/geographies/config/layers/geojson-properties-layer/geojson-properties-layer.ts +0 -67
- package/src/lib/geographies/config/layers/labels/geographies-labels-builder.ts +0 -269
- package/src/lib/geographies/config/layers/labels/geographies-labels-options.ts +0 -45
- package/src/lib/geographies/config/layers/labels/geographies-labels.ts +0 -38
- package/src/lib/geographies/events/actions/geographies-click-actions.ts +0 -21
- package/src/lib/geographies/events/actions/geographies-hover-actions.ts +0 -17
- package/src/lib/geographies/events/actions/geographies-hover-move-actions.ts +0 -19
- package/src/lib/geographies/events/geographies-events.directive.spec.ts +0 -225
- package/src/lib/geographies/events/geographies-events.directive.ts +0 -235
- package/src/lib/geographies/events/geographies-interaction-output.ts +0 -17
- package/src/lib/geographies/events/geographies-tooltip-positioner.ts +0 -23
- package/src/lib/geographies/geographies-feature.ts +0 -16
- package/src/lib/geographies/geographies.component.html +0 -1
- package/src/lib/geographies/geographies.component.scss +0 -0
- package/src/lib/geographies/geographies.component.spec.ts +0 -148
- package/src/lib/geographies/geographies.component.ts +0 -318
- package/src/lib/geographies/geographies.cy.ts +0 -640
- package/src/lib/geographies/geographies.module.ts +0 -9
- package/src/lib/geographies/index.ts +0 -32
- package/src/lib/grouped-bars/config/grouped-bars-builder.ts +0 -66
- package/src/lib/grouped-bars/config/grouped-bars-config.ts +0 -41
- package/src/lib/grouped-bars/config/grouped-bars-options.ts +0 -9
- package/src/lib/grouped-bars/events/grouped-bars-events.directive.ts +0 -221
- package/src/lib/grouped-bars/grouped-bars.component.scss +0 -0
- package/src/lib/grouped-bars/grouped-bars.component.spec.ts +0 -25
- package/src/lib/grouped-bars/grouped-bars.component.ts +0 -94
- package/src/lib/grouped-bars/grouped-bars.module.ts +0 -9
- package/src/lib/grouped-bars/index.ts +0 -10
- package/src/lib/image-download/image-download-config.ts +0 -57
- package/src/lib/image-download/image-download-enums.ts +0 -7
- package/src/lib/image-download/image-download-options.ts +0 -14
- package/src/lib/image-download/image-download.service.ts +0 -70
- package/src/lib/image-download/index.ts +0 -4
- package/src/lib/lines/config/area-fills/area-fills-builder.ts +0 -87
- package/src/lib/lines/config/area-fills/area-fills-options.ts +0 -8
- package/src/lib/lines/config/area-fills/area-fills.ts +0 -14
- package/src/lib/lines/config/lines-builder.ts +0 -242
- package/src/lib/lines/config/lines-config.spec.ts +0 -52
- package/src/lib/lines/config/lines-config.ts +0 -96
- package/src/lib/lines/config/lines-options.ts +0 -19
- package/src/lib/lines/config/stroke/lines-stroke-builder.ts +0 -135
- package/src/lib/lines/config/stroke/lines-stroke-options.ts +0 -6
- package/src/lib/lines/config/stroke/lines-stroke.ts +0 -15
- package/src/lib/lines/events/actions/lines-click-actions.ts +0 -17
- package/src/lib/lines/events/actions/lines-hover-move-actions.ts +0 -113
- package/src/lib/lines/events/actions/lines-marker-click-actions.ts +0 -29
- package/src/lib/lines/events/lines-events.directive.spec.ts +0 -152
- package/src/lib/lines/events/lines-events.directive.ts +0 -310
- package/src/lib/lines/events/lines-interaction-output.ts +0 -17
- package/src/lib/lines/events/lines-tooltip-positioner.ts +0 -24
- package/src/lib/lines/index.ts +0 -17
- package/src/lib/lines/lines.component.scss +0 -0
- package/src/lib/lines/lines.component.spec.ts +0 -95
- package/src/lib/lines/lines.component.ts +0 -425
- package/src/lib/lines/lines.cy.ts +0 -738
- package/src/lib/lines/lines.module.ts +0 -9
- package/src/lib/map-legend/continuous-legend/continuous-legend.component.html +0 -28
- package/src/lib/map-legend/continuous-legend/continuous-legend.component.scss +0 -76
- package/src/lib/map-legend/continuous-legend/continuous-legend.component.spec.ts +0 -61
- package/src/lib/map-legend/continuous-legend/continuous-legend.component.ts +0 -82
- package/src/lib/map-legend/discontinuous-legend/discontinuous-legend.component.html +0 -40
- package/src/lib/map-legend/discontinuous-legend/discontinuous-legend.component.scss +0 -141
- package/src/lib/map-legend/discontinuous-legend/discontinuous-legend.component.spec.ts +0 -75
- package/src/lib/map-legend/discontinuous-legend/discontinuous-legend.component.ts +0 -57
- package/src/lib/map-legend/index.ts +0 -2
- package/src/lib/map-legend/map-legend-base.spec.ts +0 -190
- package/src/lib/map-legend/map-legend-base.ts +0 -99
- package/src/lib/map-legend/map-legend.component.html +0 -24
- package/src/lib/map-legend/map-legend.component.scss +0 -0
- package/src/lib/map-legend/map-legend.component.spec.ts +0 -125
- package/src/lib/map-legend/map-legend.component.ts +0 -80
- package/src/lib/map-legend/map-legend.module.ts +0 -8
- package/src/lib/marks/aux-marks/aux-marks.ts +0 -18
- package/src/lib/marks/aux-marks/config/aux-marks-builder.ts +0 -25
- package/src/lib/marks/aux-marks/config/aux-marks-config.ts +0 -6
- package/src/lib/marks/config/marks-config.ts +0 -14
- package/src/lib/marks/config/marks-options.ts +0 -9
- package/src/lib/marks/index.ts +0 -15
- package/src/lib/marks/map-marks/map-aux-marks/map-aux-marks.spec.ts +0 -74
- package/src/lib/marks/map-marks/map-aux-marks/map-aux-marks.ts +0 -40
- package/src/lib/marks/map-marks/map-primary-marks/map-primary-marks.spec.ts +0 -79
- package/src/lib/marks/map-marks/map-primary-marks/map-primary-marks.ts +0 -63
- package/src/lib/marks/marks.ts +0 -39
- package/src/lib/marks/primary-marks/config/primary-marks-builder.ts +0 -75
- package/src/lib/marks/primary-marks/config/primary-marks-config.ts +0 -9
- package/src/lib/marks/primary-marks/primary-marks-base.spec.ts +0 -58
- package/src/lib/marks/primary-marks/primary-marks.ts +0 -43
- package/src/lib/marks/xy-marks/xy-aux-marks/xy-aux-marks.ts +0 -40
- package/src/lib/marks/xy-marks/xy-marks-config.ts +0 -5
- package/src/lib/marks/xy-marks/xy-marks.ts +0 -10
- package/src/lib/marks/xy-marks/xy-primary-marks/xy-primary-marks-config.ts +0 -7
- package/src/lib/marks/xy-marks/xy-primary-marks/xy-primary-marks.spec.ts +0 -186
- package/src/lib/marks/xy-marks/xy-primary-marks/xy-primary-marks.ts +0 -72
- package/src/lib/point-markers/index.ts +0 -3
- package/src/lib/point-markers/point-markers-builder.ts +0 -93
- package/src/lib/point-markers/point-markers-options.ts +0 -6
- package/src/lib/point-markers/point-markers.ts +0 -13
- package/src/lib/quantitative-rules/config/labels/quantitative-rules-labels-builder.ts +0 -162
- package/src/lib/quantitative-rules/config/labels/quantitative-rules-labels-options.ts +0 -17
- package/src/lib/quantitative-rules/config/labels/quantitative-rules-labels.ts +0 -26
- package/src/lib/quantitative-rules/config/quantitative-rules-builder.ts +0 -134
- package/src/lib/quantitative-rules/config/quantitative-rules-config.ts +0 -21
- package/src/lib/quantitative-rules/config/quantitative-rules-dimensions.ts +0 -20
- package/src/lib/quantitative-rules/config/quantitative-rules-options.ts +0 -13
- package/src/lib/quantitative-rules/index.ts +0 -6
- package/src/lib/quantitative-rules/quantitative-rules.component.scss +0 -3
- package/src/lib/quantitative-rules/quantitative-rules.component.spec.ts +0 -50
- package/src/lib/quantitative-rules/quantitative-rules.component.ts +0 -224
- package/src/lib/quantitative-rules/quantitative-rules.cy.ts +0 -549
- package/src/lib/quantitative-rules/quantitative-rules.module.ts +0 -8
- package/src/lib/stacked-area/config/stacked-area-builder.ts +0 -264
- package/src/lib/stacked-area/config/stacked-area-config.spec.ts +0 -107
- package/src/lib/stacked-area/config/stacked-area-config.ts +0 -109
- package/src/lib/stacked-area/config/stacked-area-options.ts +0 -28
- package/src/lib/stacked-area/events/actions/stacked-area-hover-move-actions.ts +0 -17
- package/src/lib/stacked-area/events/stacked-area-events.directive.spec.ts +0 -168
- package/src/lib/stacked-area/events/stacked-area-events.directive.ts +0 -272
- package/src/lib/stacked-area/events/stacked-area-interaction-output.ts +0 -33
- package/src/lib/stacked-area/events/stacked-area-tooltip-positioner.ts +0 -37
- package/src/lib/stacked-area/index.ts +0 -7
- package/src/lib/stacked-area/stacked-area.component.scss +0 -0
- package/src/lib/stacked-area/stacked-area.component.spec.ts +0 -41
- package/src/lib/stacked-area/stacked-area.component.ts +0 -241
- package/src/lib/stacked-area/stacked-area.module.ts +0 -9
- package/src/lib/stacked-bars/config/stacked-bars-builder.ts +0 -109
- package/src/lib/stacked-bars/config/stacked-bars-config.spec.ts +0 -122
- package/src/lib/stacked-bars/config/stacked-bars-config.ts +0 -79
- package/src/lib/stacked-bars/config/stacked-bars-options.ts +0 -16
- package/src/lib/stacked-bars/events/actions/stacked-bars-click-actions.ts +0 -23
- package/src/lib/stacked-bars/events/actions/stacked-bars-hover-actions.ts +0 -22
- package/src/lib/stacked-bars/events/actions/stacked-bars-hover-move-actions.ts +0 -21
- package/src/lib/stacked-bars/events/stacked-bars-events.directive.spec.ts +0 -266
- package/src/lib/stacked-bars/events/stacked-bars-events.directive.ts +0 -240
- package/src/lib/stacked-bars/index.ts +0 -10
- package/src/lib/stacked-bars/stacked-bars.component.scss +0 -0
- package/src/lib/stacked-bars/stacked-bars.component.spec.ts +0 -25
- package/src/lib/stacked-bars/stacked-bars.component.ts +0 -158
- package/src/lib/stacked-bars/stacked-bars.module.ts +0 -9
- package/src/lib/stroke/base/stroke-base-options.ts +0 -7
- package/src/lib/stroke/base/stroke-base.ts +0 -9
- package/src/lib/stroke/index.ts +0 -5
- package/src/lib/stroke/stroke-builder.ts +0 -103
- package/src/lib/stroke/stroke-options.ts +0 -5
- package/src/lib/stroke/stroke.ts +0 -12
- package/src/lib/svg-text-wrap/index.ts +0 -3
- package/src/lib/svg-text-wrap/svg-text-wrap-builder.ts +0 -105
- package/src/lib/svg-text-wrap/svg-text-wrap-options.ts +0 -8
- package/src/lib/svg-text-wrap/svg-text-wrap.ts +0 -137
- package/src/lib/testing/data/continent-population-year-data.ts +0 -126
- package/src/lib/testing/data/country-area-continent.ts +0 -59
- package/src/lib/testing/data/state-population-income-year-data.ts +0 -123
- package/src/lib/testing/stubs/bars.component.stub.ts +0 -12
- package/src/lib/testing/stubs/chart.component.stub.ts +0 -6
- package/src/lib/testing/stubs/click.directive.stub.ts +0 -15
- package/src/lib/testing/stubs/core/destroy-ref.stub.ts +0 -9
- package/src/lib/testing/stubs/core/overlay-ref.stub.ts +0 -13
- package/src/lib/testing/stubs/core/overlay.stub.ts +0 -8
- package/src/lib/testing/stubs/event.directive.stub.ts +0 -10
- package/src/lib/testing/stubs/hover-move.directive.stub.ts +0 -17
- package/src/lib/testing/stubs/hover.directive.stub.ts +0 -14
- package/src/lib/testing/stubs/input-event.directive.stub.ts +0 -9
- package/src/lib/testing/stubs/lines.component.stub.ts +0 -13
- package/src/lib/testing/stubs/map-aux-marks.stub.ts +0 -10
- package/src/lib/testing/stubs/map-chart.component.stub.ts +0 -3
- package/src/lib/testing/stubs/map-legend-content.stub.ts +0 -16
- package/src/lib/testing/stubs/map-legend.component.stub.ts +0 -10
- package/src/lib/testing/stubs/map-primary-marks.stub.ts +0 -16
- package/src/lib/testing/stubs/ordinal-axis.stub.ts +0 -18
- package/src/lib/testing/stubs/primary-marks.stub.ts +0 -18
- package/src/lib/testing/stubs/quantitative-axis.stub.ts +0 -18
- package/src/lib/testing/stubs/services/main.service.stub.ts +0 -5
- package/src/lib/testing/stubs/services/utilities.service.stub.ts +0 -7
- package/src/lib/testing/stubs/stacked-area.component.stub.ts +0 -13
- package/src/lib/testing/stubs/x-axis.stub.ts +0 -10
- package/src/lib/testing/stubs/xy-axis.class.stub.ts +0 -20
- package/src/lib/testing/stubs/xy-axis.stub.ts +0 -44
- package/src/lib/testing/stubs/xy-chart.component.stub.ts +0 -5
- package/src/lib/testing/stubs/xy-data-marks.stub.ts +0 -15
- package/src/lib/testing/stubs/y-axis.stub.ts +0 -15
- package/src/lib/tooltips/config/tooltip.ts +0 -11
- package/src/lib/tooltips/html-tooltip/config/html-tooltip-builder.ts +0 -134
- package/src/lib/tooltips/html-tooltip/config/html-tooltip-config.ts +0 -21
- package/src/lib/tooltips/html-tooltip/config/html-tooltip-options.ts +0 -12
- package/src/lib/tooltips/html-tooltip/config/position/tooltip-position-builder.ts +0 -191
- package/src/lib/tooltips/html-tooltip/config/position/tooltip-position.ts +0 -42
- package/src/lib/tooltips/html-tooltip/config/size/tooltip-size-builder.ts +0 -75
- package/src/lib/tooltips/html-tooltip/config/size/tooltip-size-options.ts +0 -8
- package/src/lib/tooltips/html-tooltip/config/size/tooltip-size.ts +0 -15
- package/src/lib/tooltips/html-tooltip/html-tooltip.directive.spec.ts +0 -537
- package/src/lib/tooltips/html-tooltip/html-tooltip.directive.ts +0 -210
- package/src/lib/tooltips/html-tooltip/html-tooltip.module.ts +0 -16
- package/src/lib/tooltips/html-tooltip/tooltip-triangle/tooltip-triangle.component.html +0 -41
- package/src/lib/tooltips/html-tooltip/tooltip-triangle/tooltip-triangle.component.scss +0 -63
- package/src/lib/tooltips/html-tooltip/tooltip-triangle/tooltip-triangle.component.ts +0 -19
- package/src/lib/tooltips/index.ts +0 -11
- package/src/lib/tooltips/svg-tooltip/config/svg-tooltip.ts +0 -5
- package/src/lib/xy-background/index.ts +0 -2
- package/src/lib/xy-background/xy-background.component.html +0 -10
- package/src/lib/xy-background/xy-background.component.scss +0 -0
- package/src/lib/xy-background/xy-background.component.spec.ts +0 -24
- package/src/lib/xy-background/xy-background.component.ts +0 -19
- package/src/lib/xy-background/xy-background.module.ts +0 -8
- package/src/public-api.ts +0 -26
- package/src/test.ts +0 -15
- package/tsconfig.doc.json +0 -4
- package/tsconfig.json +0 -20
- package/tsconfig.lib.json +0 -23
- package/tsconfig.lib.prod.json +0 -10
- package/tsconfig.spec.json +0 -10
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
import { TestBed } from '@angular/core/testing';
|
|
3
|
-
import { BehaviorSubject } from 'rxjs';
|
|
4
|
-
import { Ranges } from '../../../charts';
|
|
5
|
-
import { XyChartComponent } from '../../../charts/xy-chart/xy-chart.component';
|
|
6
|
-
import { XyChartComponentStub } from '../../../testing/stubs/xy-chart.component.stub';
|
|
7
|
-
import { XyPrimaryMarksStub } from '../../../testing/stubs/xy-data-marks.stub';
|
|
8
|
-
|
|
9
|
-
describe('XyPrimaryMarks abstract class', () => {
|
|
10
|
-
let abstractClass: XyPrimaryMarksStub<any>;
|
|
11
|
-
|
|
12
|
-
beforeEach(() => {
|
|
13
|
-
TestBed.configureTestingModule({
|
|
14
|
-
providers: [
|
|
15
|
-
XyPrimaryMarksStub,
|
|
16
|
-
{
|
|
17
|
-
provide: XyChartComponent,
|
|
18
|
-
useValue: XyChartComponentStub,
|
|
19
|
-
},
|
|
20
|
-
],
|
|
21
|
-
});
|
|
22
|
-
abstractClass = TestBed.inject(XyPrimaryMarksStub);
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
describe('ngOnInit()', () => {
|
|
26
|
-
beforeEach(() => {
|
|
27
|
-
spyOn(abstractClass, 'subscribeToRanges');
|
|
28
|
-
spyOn(abstractClass, 'subscribeToScales');
|
|
29
|
-
});
|
|
30
|
-
it('calls subscribeToRanges()', () => {
|
|
31
|
-
abstractClass.ngOnInit();
|
|
32
|
-
expect(abstractClass.subscribeToRanges).toHaveBeenCalledTimes(1);
|
|
33
|
-
});
|
|
34
|
-
it('calls subscribeToScales()', () => {
|
|
35
|
-
abstractClass.ngOnInit();
|
|
36
|
-
expect(abstractClass.subscribeToScales).toHaveBeenCalledTimes(1);
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
describe('subscribeToRanges', () => {
|
|
41
|
-
let setChartScalesFromRangesSpy: jasmine.Spy;
|
|
42
|
-
const startRanges = { x: [20, 400], y: [0, 100] } as Ranges;
|
|
43
|
-
beforeEach(() => {
|
|
44
|
-
abstractClass.chart = {
|
|
45
|
-
ranges: new BehaviorSubject<Ranges>(startRanges),
|
|
46
|
-
} as any;
|
|
47
|
-
(abstractClass.chart as any).ranges$ = (
|
|
48
|
-
abstractClass.chart as any
|
|
49
|
-
).ranges.asObservable();
|
|
50
|
-
setChartScalesFromRangesSpy = spyOn(
|
|
51
|
-
abstractClass,
|
|
52
|
-
'setChartScalesFromRanges'
|
|
53
|
-
);
|
|
54
|
-
spyOn(abstractClass, 'initFromConfig');
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
it('sets ranges to the emitted value from the subscription', () => {
|
|
58
|
-
abstractClass.subscribeToRanges();
|
|
59
|
-
expect(abstractClass.ranges).toEqual(startRanges);
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
describe('if scales are defined and all required scales are defined', () => {
|
|
63
|
-
beforeEach(() => {
|
|
64
|
-
abstractClass.scales = {
|
|
65
|
-
x: 'test x',
|
|
66
|
-
y: 'test y',
|
|
67
|
-
} as any;
|
|
68
|
-
abstractClass.requiredScales = ['x', 'y'];
|
|
69
|
-
});
|
|
70
|
-
it('calls setPropertiesFromRanges once with the correct values', () => {
|
|
71
|
-
abstractClass.subscribeToRanges();
|
|
72
|
-
setChartScalesFromRangesSpy.calls.reset();
|
|
73
|
-
(abstractClass.chart as any).ranges.next('test range');
|
|
74
|
-
expect(abstractClass.setChartScalesFromRanges).toHaveBeenCalledTimes(1);
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
describe('if scales are not defined', () => {
|
|
79
|
-
beforeEach(() => {
|
|
80
|
-
abstractClass.scales = null as any;
|
|
81
|
-
abstractClass.requiredScales = ['x', 'y'];
|
|
82
|
-
});
|
|
83
|
-
it('does not call setPropertiesFromRanges', () => {
|
|
84
|
-
abstractClass.subscribeToRanges();
|
|
85
|
-
setChartScalesFromRangesSpy.calls.reset();
|
|
86
|
-
(abstractClass.chart as any).ranges.next('test range');
|
|
87
|
-
expect(abstractClass.setChartScalesFromRanges).not.toHaveBeenCalled();
|
|
88
|
-
});
|
|
89
|
-
it('calls initFromConfig', () => {
|
|
90
|
-
abstractClass.subscribeToRanges();
|
|
91
|
-
expect(abstractClass.initFromConfig).toHaveBeenCalledTimes(1);
|
|
92
|
-
});
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
describe('if not all required scales are defined', () => {
|
|
96
|
-
beforeEach(() => {
|
|
97
|
-
abstractClass.scales = {
|
|
98
|
-
x: 'test x',
|
|
99
|
-
y: null,
|
|
100
|
-
} as any;
|
|
101
|
-
abstractClass.requiredScales = ['x', 'y'];
|
|
102
|
-
});
|
|
103
|
-
it('does not call setPropertiesFromRanges', () => {
|
|
104
|
-
abstractClass.subscribeToRanges();
|
|
105
|
-
setChartScalesFromRangesSpy.calls.reset();
|
|
106
|
-
(abstractClass.chart as any).ranges.next('test range');
|
|
107
|
-
expect(abstractClass.setChartScalesFromRanges).not.toHaveBeenCalled();
|
|
108
|
-
});
|
|
109
|
-
});
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
describe('subscribeToScales()', () => {
|
|
113
|
-
beforeEach(() => {
|
|
114
|
-
abstractClass.chart = {
|
|
115
|
-
scales: new BehaviorSubject<any>(null),
|
|
116
|
-
} as any;
|
|
117
|
-
abstractClass.chart.scales$ = (
|
|
118
|
-
abstractClass.chart as any
|
|
119
|
-
).scales.asObservable();
|
|
120
|
-
spyOn(abstractClass, 'drawMarks');
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
describe('if scales are defined', () => {
|
|
124
|
-
beforeEach(() => {
|
|
125
|
-
abstractClass.scales = {
|
|
126
|
-
x: undefined as any,
|
|
127
|
-
y: undefined as any,
|
|
128
|
-
useTransition: undefined as any,
|
|
129
|
-
};
|
|
130
|
-
});
|
|
131
|
-
it('sets scales to the emitted value from the subscription', () => {
|
|
132
|
-
abstractClass.subscribeToScales();
|
|
133
|
-
(abstractClass.chart as any).scales.next({
|
|
134
|
-
x: 'test x' as any,
|
|
135
|
-
y: 'test y' as any,
|
|
136
|
-
useTransition: true,
|
|
137
|
-
});
|
|
138
|
-
expect(abstractClass.scales).toEqual({
|
|
139
|
-
x: 'test x' as any,
|
|
140
|
-
y: 'test y' as any,
|
|
141
|
-
useTransition: true,
|
|
142
|
-
});
|
|
143
|
-
});
|
|
144
|
-
it('calls drawMarks once with the correct values', () => {
|
|
145
|
-
abstractClass.subscribeToScales();
|
|
146
|
-
(abstractClass.chart as any).scales.next({
|
|
147
|
-
x: 'test x' as any,
|
|
148
|
-
y: 'test y' as any,
|
|
149
|
-
useTransition: true,
|
|
150
|
-
});
|
|
151
|
-
expect(abstractClass.drawMarks).toHaveBeenCalledTimes(1);
|
|
152
|
-
});
|
|
153
|
-
});
|
|
154
|
-
|
|
155
|
-
describe('if scales are not defined', () => {
|
|
156
|
-
it('does not call drawMarks', () => {
|
|
157
|
-
abstractClass.subscribeToScales();
|
|
158
|
-
expect(abstractClass.drawMarks).not.toHaveBeenCalled();
|
|
159
|
-
});
|
|
160
|
-
it('does not set scales', () => {
|
|
161
|
-
abstractClass.subscribeToScales();
|
|
162
|
-
expect(abstractClass.scales).toBeUndefined();
|
|
163
|
-
});
|
|
164
|
-
});
|
|
165
|
-
});
|
|
166
|
-
|
|
167
|
-
describe('getTransitionDuration', () => {
|
|
168
|
-
beforeEach(() => {
|
|
169
|
-
abstractClass.chart.config = {
|
|
170
|
-
transitionDuration: 123,
|
|
171
|
-
} as any;
|
|
172
|
-
});
|
|
173
|
-
it('returns chart.transitionDuration if useTransition is true', () => {
|
|
174
|
-
abstractClass.scales = {
|
|
175
|
-
useTransition: true,
|
|
176
|
-
} as any;
|
|
177
|
-
expect(abstractClass.getTransitionDuration()).toEqual(123);
|
|
178
|
-
});
|
|
179
|
-
it('returns 0 if useTransition is false', () => {
|
|
180
|
-
abstractClass.scales = {
|
|
181
|
-
useTransition: false,
|
|
182
|
-
} as any;
|
|
183
|
-
expect(abstractClass.getTransitionDuration()).toEqual(0);
|
|
184
|
-
});
|
|
185
|
-
});
|
|
186
|
-
});
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { Directive, OnInit, inject } from '@angular/core';
|
|
2
|
-
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
3
|
-
import { filter } from 'rxjs';
|
|
4
|
-
import {
|
|
5
|
-
XyChartComponent,
|
|
6
|
-
XyChartScales,
|
|
7
|
-
XyContentScale,
|
|
8
|
-
} from '../../../charts/xy-chart/xy-chart.component';
|
|
9
|
-
import { DataMarksOptions } from '../../config/marks-options';
|
|
10
|
-
import { PrimaryMarks } from '../../primary-marks/primary-marks';
|
|
11
|
-
import { XyMarks } from '../xy-marks';
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* @internal
|
|
15
|
-
*/
|
|
16
|
-
@Directive()
|
|
17
|
-
export abstract class VicXyPrimaryMarks<
|
|
18
|
-
Datum,
|
|
19
|
-
TPrimaryMarksConfig extends DataMarksOptions<Datum>,
|
|
20
|
-
>
|
|
21
|
-
extends PrimaryMarks<Datum, TPrimaryMarksConfig>
|
|
22
|
-
implements OnInit, XyMarks
|
|
23
|
-
{
|
|
24
|
-
scales: XyChartScales;
|
|
25
|
-
requiredScales: (keyof typeof XyContentScale)[] = [
|
|
26
|
-
XyContentScale.x,
|
|
27
|
-
XyContentScale.y,
|
|
28
|
-
];
|
|
29
|
-
public override chart = inject(XyChartComponent);
|
|
30
|
-
|
|
31
|
-
ngOnInit(): void {
|
|
32
|
-
this.subscribeToRanges();
|
|
33
|
-
this.subscribeToScales();
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
subscribeToRanges(): void {
|
|
37
|
-
this.chart.ranges$
|
|
38
|
-
.pipe(
|
|
39
|
-
takeUntilDestroyed(this.destroyRef),
|
|
40
|
-
filter((ranges) => !!ranges)
|
|
41
|
-
)
|
|
42
|
-
.subscribe((ranges) => {
|
|
43
|
-
this.ranges = ranges;
|
|
44
|
-
if (
|
|
45
|
-
this.scales &&
|
|
46
|
-
this.requiredScales.every((scale) => this.scales[scale])
|
|
47
|
-
) {
|
|
48
|
-
this.setChartScalesFromRanges(false);
|
|
49
|
-
} else {
|
|
50
|
-
this.initFromConfig();
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
subscribeToScales(): void {
|
|
56
|
-
this.chart.scales$
|
|
57
|
-
.pipe(
|
|
58
|
-
takeUntilDestroyed(this.destroyRef),
|
|
59
|
-
filter((scales) => !!scales)
|
|
60
|
-
)
|
|
61
|
-
.subscribe((scales): void => {
|
|
62
|
-
this.scales.x = scales.x;
|
|
63
|
-
this.scales.y = scales.y;
|
|
64
|
-
this.scales.useTransition = scales.useTransition;
|
|
65
|
-
this.drawMarks();
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
getTransitionDuration(): number {
|
|
70
|
-
return this.scales.useTransition ? this.chart.config.transitionDuration : 0;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { safeAssign } from '@mathstack/app-kit';
|
|
2
|
-
import { PointMarkers } from './point-markers';
|
|
3
|
-
|
|
4
|
-
const DEFAULT = {
|
|
5
|
-
_class: () => '',
|
|
6
|
-
_display: () => true,
|
|
7
|
-
_radius: 3,
|
|
8
|
-
_growByOnHover: 2,
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export class PointMarkersBuilder<Datum> {
|
|
12
|
-
private _display: (d: Datum) => boolean;
|
|
13
|
-
private _class: (d: Datum) => string;
|
|
14
|
-
private _growByOnHover: number;
|
|
15
|
-
private _radius: number;
|
|
16
|
-
|
|
17
|
-
constructor() {
|
|
18
|
-
safeAssign(this, DEFAULT);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* OPTIONAL. Provides a class on the SVG element that correspends to a single datum. If a datum creates multiple SVG elements -- for example, a rect and a label, the class will be applied on the parent SVGGElement.
|
|
23
|
-
*
|
|
24
|
-
* IF the chart does not have SVG elements that correspond to a single datum, this class will be placed on the SVG element that represents a collection of data, for example, a area in a stacked area chart, or a line in a line chart. In this case the datum passed to the callback function will be the first datum in the collection.
|
|
25
|
-
*
|
|
26
|
-
* Note that if the resultant string has spaces in the name, multiple classes will be applied. For example, if the class is 'North Carolina', the element will have the classes 'North' and 'Carolina'.
|
|
27
|
-
*/
|
|
28
|
-
class(value: null): this;
|
|
29
|
-
class(value: string): this;
|
|
30
|
-
class(value: (d: Datum) => string): this;
|
|
31
|
-
class(value: ((d: Datum) => string) | string | null): this {
|
|
32
|
-
if (value === null) {
|
|
33
|
-
this._class = DEFAULT._class;
|
|
34
|
-
return this;
|
|
35
|
-
}
|
|
36
|
-
if (typeof value === 'string') {
|
|
37
|
-
this._class = () => value;
|
|
38
|
-
return this;
|
|
39
|
-
}
|
|
40
|
-
this._class = value;
|
|
41
|
-
return this;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* OPTIONAL. A boolean to determine if point markers will be _displayed_.
|
|
46
|
-
*
|
|
47
|
-
* This is used to configure the visibilty of markers -- a `true` value will set the `display` of markers to `block`, while a `false` value will set the display of the markers to `none`.
|
|
48
|
-
*
|
|
49
|
-
* One use case is to have markers hidden until a user interaction, such as hover.
|
|
50
|
-
*
|
|
51
|
-
* If a function is provided, markers whose filtering predicate returns `true` will have `display: block` while those whose predicate returns `false` will have `display: none` when the markers are drawn.
|
|
52
|
-
*
|
|
53
|
-
* @default () => true
|
|
54
|
-
*/
|
|
55
|
-
display(display: boolean): this;
|
|
56
|
-
display(display: (d: Datum) => boolean): this;
|
|
57
|
-
display(display: boolean | ((d: Datum) => boolean)): this {
|
|
58
|
-
this._display = typeof display === 'boolean' ? () => display : display;
|
|
59
|
-
return this;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* OPTIONAL. A value by which the point marker will expand on hover, in px.
|
|
64
|
-
*
|
|
65
|
-
* @default 2
|
|
66
|
-
*/
|
|
67
|
-
growByOnHover(growByOnHover: number): this {
|
|
68
|
-
this._growByOnHover = growByOnHover;
|
|
69
|
-
return this;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* OPTIONAL. A value for the radius of the point marker, in px.
|
|
74
|
-
*
|
|
75
|
-
* @default 3
|
|
76
|
-
*/
|
|
77
|
-
radius(radius: number): this {
|
|
78
|
-
this._radius = radius;
|
|
79
|
-
return this;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* @internal This function is for internal use only and should never be called by the user.
|
|
84
|
-
*/
|
|
85
|
-
_build(): PointMarkers<Datum> {
|
|
86
|
-
return new PointMarkers({
|
|
87
|
-
datumClass: this._class,
|
|
88
|
-
display: this._display,
|
|
89
|
-
growByOnHover: this._growByOnHover,
|
|
90
|
-
radius: this._radius,
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { safeAssign } from '@mathstack/app-kit';
|
|
2
|
-
import { PointMarkersOptions } from './point-markers-options';
|
|
3
|
-
|
|
4
|
-
export class PointMarkers<Datum> implements PointMarkersOptions<Datum> {
|
|
5
|
-
readonly datumClass: (d: Datum, i: number) => string;
|
|
6
|
-
readonly display: (d: Datum) => boolean;
|
|
7
|
-
readonly growByOnHover: number;
|
|
8
|
-
readonly radius: number;
|
|
9
|
-
|
|
10
|
-
constructor(options: PointMarkersOptions<Datum>) {
|
|
11
|
-
safeAssign(this, options);
|
|
12
|
-
}
|
|
13
|
-
}
|
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
import { safeAssign } from '@mathstack/app-kit';
|
|
2
|
-
import { QuantitativeRulesLabels } from './quantitative-rules-labels';
|
|
3
|
-
|
|
4
|
-
const DEFAULT = {
|
|
5
|
-
_display: () => true,
|
|
6
|
-
_dominantBaseline: 'middle',
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export class RulesLabelsBuilder<Datum> {
|
|
10
|
-
private _color: (d: Datum) => string;
|
|
11
|
-
private _display: (d: Datum) => boolean;
|
|
12
|
-
private _dominantBaseline:
|
|
13
|
-
| 'middle'
|
|
14
|
-
| 'text-after-edge'
|
|
15
|
-
| 'text-before-edge'
|
|
16
|
-
| 'central'
|
|
17
|
-
| 'auto'
|
|
18
|
-
| 'hanging'
|
|
19
|
-
| 'ideographic'
|
|
20
|
-
| 'alphabetic';
|
|
21
|
-
private _value: (d: Datum) => string;
|
|
22
|
-
private _offset: number;
|
|
23
|
-
private _position: (start: number, end: number, d: Datum) => number;
|
|
24
|
-
private _textAnchor: 'start' | 'middle' | 'end';
|
|
25
|
-
|
|
26
|
-
constructor() {
|
|
27
|
-
safeAssign(this, DEFAULT);
|
|
28
|
-
this._value = (d: Datum) => `${d}`;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* OPTIONAL. Set the color of the labels.
|
|
33
|
-
*
|
|
34
|
-
* If not provided, the color of the line will be used.
|
|
35
|
-
*
|
|
36
|
-
* To unset the color, pass `null`.
|
|
37
|
-
*/
|
|
38
|
-
color(color: null): this;
|
|
39
|
-
color(color: string): this;
|
|
40
|
-
color(color: (d: Datum) => string): this;
|
|
41
|
-
color(color: string | ((d: Datum) => string) | null) {
|
|
42
|
-
if (color === null) {
|
|
43
|
-
this._color = null;
|
|
44
|
-
return this;
|
|
45
|
-
}
|
|
46
|
-
this._color = typeof color === 'string' ? () => color : color;
|
|
47
|
-
return this;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* OPTIONAL. Set the display of the labels.
|
|
52
|
-
*
|
|
53
|
-
* If not provided, the labels will be displayed.
|
|
54
|
-
*
|
|
55
|
-
* @default true
|
|
56
|
-
*/
|
|
57
|
-
display(display: boolean): this;
|
|
58
|
-
display(display: (d: Datum) => boolean): this;
|
|
59
|
-
display(display: boolean | ((d: Datum) => boolean)) {
|
|
60
|
-
this._display = typeof display === 'boolean' ? () => display : display;
|
|
61
|
-
return this;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* OPTIONAL. Set the dominant baseline of the labels.
|
|
66
|
-
*
|
|
67
|
-
* @default 'middle'
|
|
68
|
-
*/
|
|
69
|
-
dominantBaseline(
|
|
70
|
-
dominantBaseline:
|
|
71
|
-
| 'middle'
|
|
72
|
-
| 'text-after-edge'
|
|
73
|
-
| 'text-before-edge'
|
|
74
|
-
| 'central'
|
|
75
|
-
| 'auto'
|
|
76
|
-
| 'hanging'
|
|
77
|
-
| 'ideographic'
|
|
78
|
-
| 'alphabetic'
|
|
79
|
-
) {
|
|
80
|
-
this._dominantBaseline = dominantBaseline;
|
|
81
|
-
return this;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* OPTIONAL. Set the offset of the labels.
|
|
86
|
-
*
|
|
87
|
-
* @default -12 for horizontal orientation, 0 for vertical orientation
|
|
88
|
-
*/
|
|
89
|
-
offset(offset: number) {
|
|
90
|
-
this._offset = offset;
|
|
91
|
-
return this;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* OPTIONAL. Set the position of the labels.
|
|
96
|
-
*
|
|
97
|
-
* @default end for horizontal orientation, end for vertical orientation
|
|
98
|
-
*/
|
|
99
|
-
position(position: (start: number, end: number, d: Datum) => number) {
|
|
100
|
-
this._position = position;
|
|
101
|
-
return this;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* OPTIONAL. Set the text anchor of the labels.
|
|
106
|
-
*
|
|
107
|
-
* @default 'end' for horizontal orientation, 'middle' for vertical orientation
|
|
108
|
-
*/
|
|
109
|
-
textAnchor(textAnchor: 'start' | 'middle' | 'end') {
|
|
110
|
-
this._textAnchor = textAnchor;
|
|
111
|
-
return this;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* REQUIRED. Set the value of the labels.
|
|
116
|
-
*/
|
|
117
|
-
value(value: (d: Datum) => string) {
|
|
118
|
-
this._value = value;
|
|
119
|
-
return this;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
_build(): QuantitativeRulesLabels<Datum> {
|
|
123
|
-
return new QuantitativeRulesLabels<Datum>({
|
|
124
|
-
color: this._color,
|
|
125
|
-
display: this._display,
|
|
126
|
-
dominantBaseline: this._dominantBaseline,
|
|
127
|
-
value: this._value,
|
|
128
|
-
offset: this._offset,
|
|
129
|
-
position: this._position,
|
|
130
|
-
textAnchor: this._textAnchor,
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
validateBuilder(
|
|
135
|
-
orientation: 'horizontal' | 'vertical',
|
|
136
|
-
lineColor: (d: Datum) => string
|
|
137
|
-
): void {
|
|
138
|
-
if (!this._color) {
|
|
139
|
-
this._color = lineColor;
|
|
140
|
-
}
|
|
141
|
-
if (!this._offset) {
|
|
142
|
-
if (orientation === 'horizontal') {
|
|
143
|
-
this._offset = -12;
|
|
144
|
-
} else {
|
|
145
|
-
this._offset = 0;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
if (!this._position) {
|
|
149
|
-
if (orientation === 'horizontal') {
|
|
150
|
-
this._position = (start: number, end: number) => end - 4;
|
|
151
|
-
} else {
|
|
152
|
-
this._position = (start: number, end: number) => end - 12;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
if (!this._textAnchor) {
|
|
156
|
-
this._textAnchor = orientation === 'horizontal' ? 'end' : 'middle';
|
|
157
|
-
}
|
|
158
|
-
if (!this.value) {
|
|
159
|
-
throw new Error('QuantitativeRulesLabels: value is required');
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export interface QuantitativeRulesLabelsOptions<Datum> {
|
|
2
|
-
color: (d: Datum) => string;
|
|
3
|
-
display: (d: Datum) => boolean;
|
|
4
|
-
dominantBaseline:
|
|
5
|
-
| 'auto'
|
|
6
|
-
| 'middle'
|
|
7
|
-
| 'central'
|
|
8
|
-
| 'text-before-edge'
|
|
9
|
-
| 'text-after-edge'
|
|
10
|
-
| 'hanging'
|
|
11
|
-
| 'ideographic'
|
|
12
|
-
| 'alphabetic';
|
|
13
|
-
value: (d: Datum) => string;
|
|
14
|
-
offset: number;
|
|
15
|
-
position: (start: number, end: number, d: Datum) => number;
|
|
16
|
-
textAnchor: 'start' | 'middle' | 'end';
|
|
17
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { safeAssign } from '@mathstack/app-kit';
|
|
2
|
-
import { QuantitativeRulesLabelsOptions } from './quantitative-rules-labels-options';
|
|
3
|
-
|
|
4
|
-
export class QuantitativeRulesLabels<
|
|
5
|
-
Datum,
|
|
6
|
-
> implements QuantitativeRulesLabelsOptions<Datum> {
|
|
7
|
-
color: (d: Datum) => string;
|
|
8
|
-
display: (d: Datum) => boolean;
|
|
9
|
-
dominantBaseline:
|
|
10
|
-
| 'middle'
|
|
11
|
-
| 'text-after-edge'
|
|
12
|
-
| 'text-before-edge'
|
|
13
|
-
| 'central'
|
|
14
|
-
| 'auto'
|
|
15
|
-
| 'hanging'
|
|
16
|
-
| 'ideographic'
|
|
17
|
-
| 'alphabetic';
|
|
18
|
-
value: (d: Datum) => string;
|
|
19
|
-
offset: number;
|
|
20
|
-
position: (start: number, end: number, d: Datum) => number;
|
|
21
|
-
textAnchor: 'start' | 'middle' | 'end';
|
|
22
|
-
|
|
23
|
-
constructor(options: QuantitativeRulesLabelsOptions<Datum>) {
|
|
24
|
-
safeAssign(this, options);
|
|
25
|
-
}
|
|
26
|
-
}
|