@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,9 +0,0 @@
|
|
|
1
|
-
import { NgModule } from '@angular/core';
|
|
2
|
-
import { BarsComponent } from './bars.component';
|
|
3
|
-
import { BarsEventsDirective } from './events/bars-events.directive';
|
|
4
|
-
|
|
5
|
-
@NgModule({
|
|
6
|
-
imports: [BarsComponent, BarsEventsDirective],
|
|
7
|
-
exports: [BarsComponent, BarsEventsDirective],
|
|
8
|
-
})
|
|
9
|
-
export class VicBarsModule {}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { safeAssign } from '@mathstack/app-kit';
|
|
2
|
-
import { BarsBackgrounds } from './bars-backgrounds';
|
|
3
|
-
|
|
4
|
-
const DEFAULT = {
|
|
5
|
-
_color: 'whitesmoke',
|
|
6
|
-
_events: false,
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export class BarsBackgroundsBuilder {
|
|
10
|
-
private _color: string;
|
|
11
|
-
private _events: boolean;
|
|
12
|
-
|
|
13
|
-
constructor() {
|
|
14
|
-
safeAssign(this, DEFAULT);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* OPTIONAL. Determines the color of the background.
|
|
19
|
-
*
|
|
20
|
-
* @param value - The color of the background.
|
|
21
|
-
*
|
|
22
|
-
* If not called, the default color is 'whitesmoke'.
|
|
23
|
-
*/
|
|
24
|
-
color(value: string): this {
|
|
25
|
-
this._color = value;
|
|
26
|
-
return this;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Determines whether the background is interactive or not.
|
|
31
|
-
*
|
|
32
|
-
* @param value - If `true`, the background is interactive and will respond to Viz Components events. If `false`, the background is not interactive.
|
|
33
|
-
*
|
|
34
|
-
* If not called, the default value is `false`.
|
|
35
|
-
*/
|
|
36
|
-
events(value: boolean): this {
|
|
37
|
-
this._events = value;
|
|
38
|
-
return this;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* @internal
|
|
43
|
-
* This function is for internal use only and should never be called by the user.
|
|
44
|
-
*/
|
|
45
|
-
_build(): BarsBackgrounds {
|
|
46
|
-
return new BarsBackgrounds({
|
|
47
|
-
color: this._color,
|
|
48
|
-
events: this._events,
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { safeAssign } from '@mathstack/app-kit';
|
|
2
|
-
import { BarsBackgroundsOptions } from './bars-backgrounds-options';
|
|
3
|
-
|
|
4
|
-
export class BarsBackgrounds {
|
|
5
|
-
readonly color: string;
|
|
6
|
-
readonly events: boolean;
|
|
7
|
-
|
|
8
|
-
constructor(options: BarsBackgroundsOptions) {
|
|
9
|
-
safeAssign(this, options);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
@@ -1,340 +0,0 @@
|
|
|
1
|
-
import { Injectable } from '@angular/core';
|
|
2
|
-
import { DataValue } from '../../core/types/values';
|
|
3
|
-
import { FillDefinition } from '../../data-dimensions';
|
|
4
|
-
import { NumberChartPositionDimensionBuilder } from '../../data-dimensions/continuous-quantitative/number-chart-position/number-chart-position-builder';
|
|
5
|
-
import { OrdinalChartPositionDimensionBuilder } from '../../data-dimensions/ordinal/ordinal-chart-position/ordinal-chart-position-builder';
|
|
6
|
-
import { OrdinalVisualValueDimensionBuilder } from '../../data-dimensions/ordinal/ordinal-visual-value/ordinal-visual-value-builder';
|
|
7
|
-
import { PrimaryMarksBuilder } from '../../marks/primary-marks/config/primary-marks-builder';
|
|
8
|
-
import { BarsBackgroundsBuilder } from './backgrounds/bars-backgrounds-builder';
|
|
9
|
-
import { BarsConfig } from './bars-config';
|
|
10
|
-
import {
|
|
11
|
-
BarsDimensions,
|
|
12
|
-
HORIZONTAL_BARS_DIMENSIONS,
|
|
13
|
-
VERTICAL_BARS_DIMENSIONS,
|
|
14
|
-
} from './bars-dimensions';
|
|
15
|
-
import { BarsLabelsBuilder } from './labels/bars-labels-builder';
|
|
16
|
-
|
|
17
|
-
abstract class BaseDimensionsBuilder<Datum, TOrdinalValue extends DataValue> {
|
|
18
|
-
protected _ordinalDimensionBuilder: OrdinalChartPositionDimensionBuilder<
|
|
19
|
-
Datum,
|
|
20
|
-
TOrdinalValue
|
|
21
|
-
>;
|
|
22
|
-
protected _quantitativeDimensionBuilder: NumberChartPositionDimensionBuilder<Datum>;
|
|
23
|
-
|
|
24
|
-
// Getter methods for VicBarsConfigBuilder to access the builders
|
|
25
|
-
get ordinalDimensionBuilder() {
|
|
26
|
-
return this._ordinalDimensionBuilder;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
get quantitativeDimensionBuilder() {
|
|
30
|
-
return this._quantitativeDimensionBuilder;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
protected initOrdinalDimensionBuilder() {
|
|
34
|
-
this._ordinalDimensionBuilder = new OrdinalChartPositionDimensionBuilder();
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
protected initQuantitativeDimensionBuilder() {
|
|
38
|
-
this._quantitativeDimensionBuilder =
|
|
39
|
-
new NumberChartPositionDimensionBuilder();
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export class HorizontalBarsDimensionsBuilder<
|
|
44
|
-
Datum,
|
|
45
|
-
TOrdinalValue extends DataValue,
|
|
46
|
-
> extends BaseDimensionsBuilder<Datum, TOrdinalValue> {
|
|
47
|
-
/**
|
|
48
|
-
* REQUIRED. Specifies how values derived from `Datum` (of type `number`) set the x domain of the chart, and how those values are displayed.
|
|
49
|
-
*
|
|
50
|
-
* @param x - A function that specifies how the quantitative values that are mapped to the x dimension will be used in the chart.
|
|
51
|
-
*/
|
|
52
|
-
x(x: (x: NumberChartPositionDimensionBuilder<Datum>) => void): this {
|
|
53
|
-
this.initQuantitativeDimensionBuilder();
|
|
54
|
-
x(this._quantitativeDimensionBuilder);
|
|
55
|
-
return this;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* REQUIRED. Specifies how values derived from `Datum` (may be type `string`, `number`, or `Date`, though typically `string`) set the y domain of the chart, and how those values are displayed.
|
|
60
|
-
*
|
|
61
|
-
* @param y - A function that specifies how ordinal/categorical values that are mapped to the y dimension will be used in the chart.
|
|
62
|
-
*/
|
|
63
|
-
y(
|
|
64
|
-
y: (y: OrdinalChartPositionDimensionBuilder<Datum, TOrdinalValue>) => void
|
|
65
|
-
): this {
|
|
66
|
-
this.initOrdinalDimensionBuilder();
|
|
67
|
-
y(this._ordinalDimensionBuilder);
|
|
68
|
-
return this;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export class VerticalBarsDimensionsBuilder<
|
|
73
|
-
Datum,
|
|
74
|
-
TOrdinalValue extends DataValue,
|
|
75
|
-
> extends BaseDimensionsBuilder<Datum, TOrdinalValue> {
|
|
76
|
-
/**
|
|
77
|
-
* REQUIRED. Specifies how values derived from `Datum` (may be type `string`, `number`, or `Date`, though typically `string`) set the x domain of the chart, and how those values are displayed.
|
|
78
|
-
*
|
|
79
|
-
* @param x - A function that specifies how ordinal/categorical values that are mapped to the x dimension will be used in the chart.
|
|
80
|
-
*/
|
|
81
|
-
x(
|
|
82
|
-
x: (x: OrdinalChartPositionDimensionBuilder<Datum, TOrdinalValue>) => void
|
|
83
|
-
): this {
|
|
84
|
-
this.initOrdinalDimensionBuilder();
|
|
85
|
-
x(this._ordinalDimensionBuilder);
|
|
86
|
-
return this;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* REQUIRED. Specifies how values derived from `Datum` (of type `number`) set the y domain of the chart, and how those values are displayed.
|
|
91
|
-
*
|
|
92
|
-
* @param y - A function that specifies how the quantitative values that are mapped to the y dimension will be used in the chart.
|
|
93
|
-
*/
|
|
94
|
-
y(y: (y: NumberChartPositionDimensionBuilder<Datum>) => void): this {
|
|
95
|
-
this.initQuantitativeDimensionBuilder();
|
|
96
|
-
y(this._quantitativeDimensionBuilder);
|
|
97
|
-
return this;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* Builds a configuration object for a BarsComponent.
|
|
103
|
-
*
|
|
104
|
-
* 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: [VicBarsConfigBuilder]` in the component decorator)
|
|
105
|
-
*
|
|
106
|
-
* The first generic parameter, Datum, is the type of the data that will be used to create the bars.
|
|
107
|
-
*
|
|
108
|
-
* The second generic parameter, TOrdinalValue, is the type of the ordinal data that will be used to position the bars.
|
|
109
|
-
*/
|
|
110
|
-
@Injectable()
|
|
111
|
-
export class VicBarsConfigBuilder<
|
|
112
|
-
Datum,
|
|
113
|
-
OrdinalDomain extends DataValue,
|
|
114
|
-
> extends PrimaryMarksBuilder<Datum> {
|
|
115
|
-
protected _customFills: FillDefinition<Datum>[];
|
|
116
|
-
protected dimensions: BarsDimensions;
|
|
117
|
-
protected _orientation: 'horizontal' | 'vertical';
|
|
118
|
-
protected backgroundsBuilder: BarsBackgroundsBuilder;
|
|
119
|
-
protected colorDimensionBuilder: OrdinalVisualValueDimensionBuilder<
|
|
120
|
-
Datum,
|
|
121
|
-
string,
|
|
122
|
-
string
|
|
123
|
-
>;
|
|
124
|
-
protected labelsBuilder: BarsLabelsBuilder<Datum>;
|
|
125
|
-
protected ordinalDimensionBuilder: OrdinalChartPositionDimensionBuilder<
|
|
126
|
-
Datum,
|
|
127
|
-
OrdinalDomain
|
|
128
|
-
>;
|
|
129
|
-
protected quantitativeDimensionBuilder: NumberChartPositionDimensionBuilder<Datum>;
|
|
130
|
-
|
|
131
|
-
constructor() {
|
|
132
|
-
super();
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* OPTIONAL. Specifies properties of bars to be drawn behind the bars that represent data values. The background bars span the full width of the chart.
|
|
137
|
-
*
|
|
138
|
-
* @param backgrounds - A function that specifies the color of background bars and whether they respond to events, or `null` to unset the backgrounds function.
|
|
139
|
-
*
|
|
140
|
-
* If called with no arguments, the default background will be `whitesmoke` and events will be `false`.
|
|
141
|
-
*
|
|
142
|
-
* If not called, no background bars will be created.
|
|
143
|
-
*/
|
|
144
|
-
backgrounds(backgrounds: (backgrounds: BarsBackgroundsBuilder) => void): this;
|
|
145
|
-
backgrounds(): this;
|
|
146
|
-
backgrounds(backgrounds: null): this;
|
|
147
|
-
backgrounds(
|
|
148
|
-
backgrounds: ((backgrounds: BarsBackgroundsBuilder) => void) | null | void
|
|
149
|
-
): this {
|
|
150
|
-
if (backgrounds === null) {
|
|
151
|
-
this.backgroundsBuilder = undefined;
|
|
152
|
-
return this;
|
|
153
|
-
}
|
|
154
|
-
this.backgroundsBuilder = new BarsBackgroundsBuilder();
|
|
155
|
-
if (backgrounds) {
|
|
156
|
-
backgrounds?.(this.backgroundsBuilder);
|
|
157
|
-
}
|
|
158
|
-
return this;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
* OPTIONAL. Specifies how values derived from `Datum` (of type `string`) set the color of the bars, and how those values are displayed.
|
|
163
|
-
*
|
|
164
|
-
* @param color - A function that specifies how values derived from `Datum` will be used to set the color of the bars, or null to unset the color., or null to unset the color function.
|
|
165
|
-
*
|
|
166
|
-
* If not called, all bars will be colored with the first color in `d3.schemeTableau10`, the default `range` color scale.
|
|
167
|
-
*/
|
|
168
|
-
color(
|
|
169
|
-
color: (
|
|
170
|
-
color: OrdinalVisualValueDimensionBuilder<Datum, string, string>
|
|
171
|
-
) => void
|
|
172
|
-
): this;
|
|
173
|
-
color(color: null): this;
|
|
174
|
-
color(
|
|
175
|
-
color:
|
|
176
|
-
| ((
|
|
177
|
-
color: OrdinalVisualValueDimensionBuilder<Datum, string, string>
|
|
178
|
-
) => void)
|
|
179
|
-
| null
|
|
180
|
-
): this {
|
|
181
|
-
if (color === null) {
|
|
182
|
-
this.colorDimensionBuilder = undefined;
|
|
183
|
-
return this;
|
|
184
|
-
}
|
|
185
|
-
this.initColorDimensionBuilder();
|
|
186
|
-
color?.(this.colorDimensionBuilder);
|
|
187
|
-
return this;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
private initColorDimensionBuilder() {
|
|
191
|
-
this.colorDimensionBuilder = new OrdinalVisualValueDimensionBuilder();
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
/**
|
|
195
|
-
* OPTIONAL. Determines custom fills for specified bars. Intended to be used with a user-provided fill in <defs> (provided in html) whose `id` is referenced here. The `shouldApply` function is used to determine whether the fill should be applied to a given datum.
|
|
196
|
-
*
|
|
197
|
-
* @param values - An array of custom fills ({ defId: string; shouldApply: (d: Datum) => boolean;}[]), or `null` to unset the custom fills.
|
|
198
|
-
*
|
|
199
|
-
* This will override any fill set by the `color` dimension.
|
|
200
|
-
*/
|
|
201
|
-
customFills(values: FillDefinition<Datum>[] | null): this {
|
|
202
|
-
if (values === null) {
|
|
203
|
-
this._customFills = undefined;
|
|
204
|
-
return this;
|
|
205
|
-
}
|
|
206
|
-
this._customFills = values;
|
|
207
|
-
return this;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
/**
|
|
211
|
-
* REQUIRED FOR HORIZONTAL BAR CHART.
|
|
212
|
-
*
|
|
213
|
-
* @param bars - A function that specifies properties for the horizontal bars, or `null` to not set the horizontal orientation.
|
|
214
|
-
*/
|
|
215
|
-
horizontal(
|
|
216
|
-
bars: (bars: HorizontalBarsDimensionsBuilder<Datum, OrdinalDomain>) => void
|
|
217
|
-
): this;
|
|
218
|
-
horizontal(bars: null): this;
|
|
219
|
-
horizontal(
|
|
220
|
-
bars:
|
|
221
|
-
| ((bars: HorizontalBarsDimensionsBuilder<Datum, OrdinalDomain>) => void)
|
|
222
|
-
| null
|
|
223
|
-
): this {
|
|
224
|
-
// Do not reset anything if null is passed, as vertical will set properties if no horizontal is provided.
|
|
225
|
-
// allow for
|
|
226
|
-
// .horizontal(bars => condition ? bars.stuff() : null)
|
|
227
|
-
// .vertical(bars => !condition ? bars.stuff() : null)
|
|
228
|
-
if (bars === null) return this;
|
|
229
|
-
this._orientation = 'horizontal';
|
|
230
|
-
this.dimensions = HORIZONTAL_BARS_DIMENSIONS;
|
|
231
|
-
const builder = new HorizontalBarsDimensionsBuilder<Datum, OrdinalDomain>();
|
|
232
|
-
bars(builder);
|
|
233
|
-
this.ordinalDimensionBuilder = builder.ordinalDimensionBuilder;
|
|
234
|
-
this.quantitativeDimensionBuilder = builder.quantitativeDimensionBuilder;
|
|
235
|
-
return this;
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
/**
|
|
239
|
-
* OPTIONAL. Specifies properties of labels to be rendered at the end of bars, typically used to show bar values.
|
|
240
|
-
*
|
|
241
|
-
* @param labels - A function that specifies properties for the labels, or `null` to unset the labels.
|
|
242
|
-
*
|
|
243
|
-
* If not called, no labels will be created.
|
|
244
|
-
*/
|
|
245
|
-
labels(labels: (labels: BarsLabelsBuilder<Datum>) => void): this;
|
|
246
|
-
labels(labels: null): this;
|
|
247
|
-
labels(labels: ((labels: BarsLabelsBuilder<Datum>) => void) | null): this {
|
|
248
|
-
if (labels === null) {
|
|
249
|
-
this.labelsBuilder = undefined;
|
|
250
|
-
return this;
|
|
251
|
-
}
|
|
252
|
-
this.labelsBuilder = new BarsLabelsBuilder<Datum>();
|
|
253
|
-
labels?.(this.labelsBuilder);
|
|
254
|
-
return this;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
/**
|
|
258
|
-
* REQUIRED FOR VERTICAL BAR CHART.
|
|
259
|
-
*
|
|
260
|
-
* @param bars - A function that specifies properties for the vertical bars, or `null` to not set the vertical orientation.
|
|
261
|
-
*/
|
|
262
|
-
vertical(
|
|
263
|
-
bars: (bars: VerticalBarsDimensionsBuilder<Datum, OrdinalDomain>) => void
|
|
264
|
-
): this;
|
|
265
|
-
vertical(bars: null): this;
|
|
266
|
-
vertical(
|
|
267
|
-
bars:
|
|
268
|
-
| ((bars: VerticalBarsDimensionsBuilder<Datum, OrdinalDomain>) => void)
|
|
269
|
-
| null
|
|
270
|
-
): this {
|
|
271
|
-
if (bars === null) return this;
|
|
272
|
-
this._orientation = 'vertical';
|
|
273
|
-
this.dimensions = VERTICAL_BARS_DIMENSIONS;
|
|
274
|
-
const builder = new VerticalBarsDimensionsBuilder<Datum, OrdinalDomain>();
|
|
275
|
-
bars(builder);
|
|
276
|
-
this.ordinalDimensionBuilder = builder.ordinalDimensionBuilder;
|
|
277
|
-
this.quantitativeDimensionBuilder = builder.quantitativeDimensionBuilder;
|
|
278
|
-
return this;
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
/**
|
|
282
|
-
* REQUIRED. Validates and builds the configuration object for the bars that can be passed to BarsComponent.
|
|
283
|
-
*
|
|
284
|
-
* The user must call this at the end of the chain of methods to build the configuration object.
|
|
285
|
-
*/
|
|
286
|
-
getConfig(): BarsConfig<Datum, OrdinalDomain> {
|
|
287
|
-
this.validateBuilder('Bars');
|
|
288
|
-
return new BarsConfig(this.dimensions, {
|
|
289
|
-
marksClass: 'vic-bars',
|
|
290
|
-
backgrounds: this.backgroundsBuilder?._build(),
|
|
291
|
-
color: this.colorDimensionBuilder._build('Color'),
|
|
292
|
-
customFills: this._customFills,
|
|
293
|
-
data: this._data,
|
|
294
|
-
datumClass: this._datumClass,
|
|
295
|
-
labels: this.labelsBuilder?._build(),
|
|
296
|
-
mixBlendMode: this._mixBlendMode,
|
|
297
|
-
ordinal: this.ordinalDimensionBuilder._build(
|
|
298
|
-
'band',
|
|
299
|
-
this.getOrdinalDimensionName()
|
|
300
|
-
),
|
|
301
|
-
quantitative: this.quantitativeDimensionBuilder._build(
|
|
302
|
-
this.getQuantitativeDimensionName()
|
|
303
|
-
),
|
|
304
|
-
});
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
protected override validateBuilder(componentName: string): void {
|
|
308
|
-
super.validateBuilder(componentName);
|
|
309
|
-
if (!this.colorDimensionBuilder) {
|
|
310
|
-
this.initColorDimensionBuilder();
|
|
311
|
-
}
|
|
312
|
-
if (!this._orientation) {
|
|
313
|
-
// Technically we could make horizontal the default, but we want to make sure users are thinking about this.
|
|
314
|
-
throw new Error(
|
|
315
|
-
`${componentName} Builder: Orientation is required. Please use method 'horizontal' or 'vertical' to set orientation.`
|
|
316
|
-
);
|
|
317
|
-
}
|
|
318
|
-
if (!this.ordinalDimensionBuilder) {
|
|
319
|
-
// Note that the chart will still build if there is not ordinal dimension provided but it will not be full featured/anything we imagine users wanting, so we make this required.
|
|
320
|
-
const dimension = this.getOrdinalDimensionName();
|
|
321
|
-
throw new Error(
|
|
322
|
-
`${componentName} Builder: ${dimension} dimension is required. Please use ${dimension.toLowerCase()} method to create dimension.`
|
|
323
|
-
);
|
|
324
|
-
}
|
|
325
|
-
if (!this.quantitativeDimensionBuilder) {
|
|
326
|
-
const dimension = this.getQuantitativeDimensionName();
|
|
327
|
-
throw new Error(
|
|
328
|
-
`${componentName} Builder: ${dimension} dimension is required. Please use ${dimension.toLowerCase()} method to create dimension.`
|
|
329
|
-
);
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
protected getOrdinalDimensionName(): string {
|
|
334
|
-
return this._orientation === 'horizontal' ? 'Y' : 'X';
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
protected getQuantitativeDimensionName(): string {
|
|
338
|
-
return this._orientation === 'horizontal' ? 'X' : 'Y';
|
|
339
|
-
}
|
|
340
|
-
}
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
import { NumberChartPositionDimension } from '../../data-dimensions/continuous-quantitative/number-chart-position/number-chart-position';
|
|
3
|
-
import { OrdinalChartPositionDimension } from '../../data-dimensions/ordinal/ordinal-chart-position/ordinal-chart-position';
|
|
4
|
-
import { OrdinalVisualValueDimension } from '../../data-dimensions/ordinal/ordinal-visual-value/ordinal-visual-value';
|
|
5
|
-
import { VicBarsConfigBuilder } from './bars-builder';
|
|
6
|
-
import { BarsConfig } from './bars-config';
|
|
7
|
-
|
|
8
|
-
type Datum = { value: number; state: string };
|
|
9
|
-
const data = [
|
|
10
|
-
{ value: 1, state: 'AL' },
|
|
11
|
-
{ value: 2, state: 'AK' },
|
|
12
|
-
{ value: 3, state: 'AZ' },
|
|
13
|
-
{ value: 4, state: 'CA' },
|
|
14
|
-
{ value: 5, state: 'CO' },
|
|
15
|
-
{ value: 6, state: 'CO' },
|
|
16
|
-
];
|
|
17
|
-
function getNewConfig(): BarsConfig<Datum, string> {
|
|
18
|
-
return new VicBarsConfigBuilder<Datum, string>()
|
|
19
|
-
.data(data)
|
|
20
|
-
.horizontal((bars) =>
|
|
21
|
-
bars
|
|
22
|
-
.x((dimension) => dimension.valueAccessor((d) => d.value))
|
|
23
|
-
.y((dimension) => dimension.valueAccessor((d) => d.state))
|
|
24
|
-
)
|
|
25
|
-
.getConfig();
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
describe('BarsConfig', () => {
|
|
29
|
-
let config: BarsConfig<Datum, string>;
|
|
30
|
-
|
|
31
|
-
describe('init()', () => {
|
|
32
|
-
beforeEach(() => {
|
|
33
|
-
spyOn(BarsConfig.prototype as any, 'setDimensionPropertiesFromData');
|
|
34
|
-
spyOn(BarsConfig.prototype as any, 'setValueIndices');
|
|
35
|
-
spyOn(BarsConfig.prototype as any, 'setHasNegativeValues');
|
|
36
|
-
spyOn(BarsConfig.prototype as any, 'setBarsKeyFunction');
|
|
37
|
-
config = getNewConfig();
|
|
38
|
-
});
|
|
39
|
-
it('calls setDimensionPropertiesFromData once', () => {
|
|
40
|
-
expect(
|
|
41
|
-
(config as any).setDimensionPropertiesFromData
|
|
42
|
-
).toHaveBeenCalledTimes(1);
|
|
43
|
-
});
|
|
44
|
-
it('calls setValueIndices once', () => {
|
|
45
|
-
expect((config as any).setValueIndices).toHaveBeenCalledTimes(1);
|
|
46
|
-
});
|
|
47
|
-
it('calls setHasNegativeValues once', () => {
|
|
48
|
-
expect((config as any).setHasNegativeValues).toHaveBeenCalledTimes(1);
|
|
49
|
-
});
|
|
50
|
-
it('calls setBarsKeyFunction once', () => {
|
|
51
|
-
expect((config as any).setBarsKeyFunction).toHaveBeenCalledTimes(1);
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
describe('setDimensionPropertiesFromData()', () => {
|
|
56
|
-
beforeEach(() => {
|
|
57
|
-
spyOn(BarsConfig.prototype as any, 'initPropertiesFromData');
|
|
58
|
-
spyOn(
|
|
59
|
-
NumberChartPositionDimension.prototype as any,
|
|
60
|
-
'setPropertiesFromData'
|
|
61
|
-
);
|
|
62
|
-
spyOn(
|
|
63
|
-
OrdinalChartPositionDimension.prototype as any,
|
|
64
|
-
'setPropertiesFromData'
|
|
65
|
-
);
|
|
66
|
-
spyOn(
|
|
67
|
-
OrdinalVisualValueDimension.prototype as any,
|
|
68
|
-
'setPropertiesFromData'
|
|
69
|
-
);
|
|
70
|
-
config = getNewConfig();
|
|
71
|
-
(config as any).setDimensionPropertiesFromData();
|
|
72
|
-
});
|
|
73
|
-
it('calls quantitative.setPropertiesFromData once', () => {
|
|
74
|
-
expect(
|
|
75
|
-
config.quantitative.setPropertiesFromData
|
|
76
|
-
).toHaveBeenCalledOnceWith(data);
|
|
77
|
-
});
|
|
78
|
-
it('calls ordinal.setPropertiesFromData once', () => {
|
|
79
|
-
expect(config.ordinal.setPropertiesFromData).toHaveBeenCalledOnceWith(
|
|
80
|
-
data,
|
|
81
|
-
true
|
|
82
|
-
);
|
|
83
|
-
});
|
|
84
|
-
it('calls categorical.setPropertiesFromData once', () => {
|
|
85
|
-
expect(config.color.setPropertiesFromData).toHaveBeenCalledOnceWith(data);
|
|
86
|
-
});
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
describe('setValueIndices()', () => {
|
|
90
|
-
beforeEach(() => {
|
|
91
|
-
spyOn(BarsConfig.prototype as any, 'initPropertiesFromData');
|
|
92
|
-
});
|
|
93
|
-
it('returns the value indices of datums with unique ordinal values', () => {
|
|
94
|
-
config = getNewConfig();
|
|
95
|
-
(config as any).setDimensionPropertiesFromData();
|
|
96
|
-
(config as any).setValueIndices();
|
|
97
|
-
expect(config.valueIndices).toEqual([0, 1, 2, 3, 4]);
|
|
98
|
-
});
|
|
99
|
-
it('sets valueIndices to the correct array when ordinal domain is limited by user', () => {
|
|
100
|
-
config = new VicBarsConfigBuilder<Datum, string>()
|
|
101
|
-
.data(data)
|
|
102
|
-
.horizontal((bars) =>
|
|
103
|
-
bars
|
|
104
|
-
.x((dimension) => dimension.valueAccessor((d) => d.value))
|
|
105
|
-
.y((dimension) =>
|
|
106
|
-
dimension.valueAccessor((d) => d.state).domain(['AL', 'AZ', 'CA'])
|
|
107
|
-
)
|
|
108
|
-
)
|
|
109
|
-
.getConfig();
|
|
110
|
-
(config as any).setDimensionPropertiesFromData();
|
|
111
|
-
(config as any).setValueIndices();
|
|
112
|
-
expect(config.valueIndices).toEqual([0, 2, 3]);
|
|
113
|
-
});
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
describe('setHasNegativeValues()', () => {
|
|
117
|
-
beforeEach(() => {
|
|
118
|
-
spyOn(BarsConfig.prototype as any, 'initPropertiesFromData');
|
|
119
|
-
config = getNewConfig();
|
|
120
|
-
});
|
|
121
|
-
it('returns false if all values are positive', () => {
|
|
122
|
-
config.quantitative.values = [1, 2, 3, 4, 5];
|
|
123
|
-
(config as any).setHasNegativeValues();
|
|
124
|
-
expect(config.hasNegativeValues).toBeFalse();
|
|
125
|
-
});
|
|
126
|
-
it('returns true if any values are negative', () => {
|
|
127
|
-
config.quantitative.values = [1, 2, -3, 4, 5];
|
|
128
|
-
(config as any).setHasNegativeValues();
|
|
129
|
-
expect(config.hasNegativeValues).toBeTrue();
|
|
130
|
-
});
|
|
131
|
-
});
|
|
132
|
-
});
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { safeAssign } from '@mathstack/app-kit';
|
|
2
|
-
import { min, range } from 'd3';
|
|
3
|
-
import { DataValue } from '../../core/types/values';
|
|
4
|
-
import { FillDefinition } from '../../data-dimensions';
|
|
5
|
-
import { NumberChartPositionDimension } from '../../data-dimensions/continuous-quantitative/number-chart-position/number-chart-position';
|
|
6
|
-
import { OrdinalChartPositionDimension } from '../../data-dimensions/ordinal/ordinal-chart-position/ordinal-chart-position';
|
|
7
|
-
import { OrdinalVisualValueDimension } from '../../data-dimensions/ordinal/ordinal-visual-value/ordinal-visual-value';
|
|
8
|
-
import { XyPrimaryMarksConfig } from '../../marks/xy-marks/xy-primary-marks/xy-primary-marks-config';
|
|
9
|
-
import { BarsBackgrounds } from './backgrounds/bars-backgrounds';
|
|
10
|
-
import { BarsDimensions } from './bars-dimensions';
|
|
11
|
-
import { BarsOptions } from './bars-options';
|
|
12
|
-
import { BarsLabels } from './labels/bars-labels';
|
|
13
|
-
|
|
14
|
-
export class BarsConfig<Datum, OrdinalDomain extends DataValue>
|
|
15
|
-
extends XyPrimaryMarksConfig<Datum>
|
|
16
|
-
implements BarsOptions<Datum, OrdinalDomain>
|
|
17
|
-
{
|
|
18
|
-
barsKeyFunction: (i: number) => string;
|
|
19
|
-
readonly backgrounds: BarsBackgrounds;
|
|
20
|
-
readonly color: OrdinalVisualValueDimension<Datum, string, string>;
|
|
21
|
-
readonly customFills: FillDefinition<Datum>[];
|
|
22
|
-
readonly dimensions: BarsDimensions;
|
|
23
|
-
hasNegativeValues: boolean;
|
|
24
|
-
readonly labels: BarsLabels<Datum>;
|
|
25
|
-
readonly ordinal: OrdinalChartPositionDimension<Datum, OrdinalDomain>;
|
|
26
|
-
readonly quantitative: NumberChartPositionDimension<Datum>;
|
|
27
|
-
|
|
28
|
-
constructor(
|
|
29
|
-
dimensions: BarsDimensions,
|
|
30
|
-
options: BarsOptions<Datum, OrdinalDomain>
|
|
31
|
-
) {
|
|
32
|
-
super();
|
|
33
|
-
safeAssign(this, options);
|
|
34
|
-
this.dimensions = dimensions;
|
|
35
|
-
this.initPropertiesFromData();
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
protected initPropertiesFromData(): void {
|
|
39
|
-
this.setDimensionPropertiesFromData();
|
|
40
|
-
this.setValueIndices();
|
|
41
|
-
this.setHasNegativeValues();
|
|
42
|
-
this.setBarsKeyFunction();
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
protected setDimensionPropertiesFromData(): void {
|
|
46
|
-
this.quantitative.setPropertiesFromData(this.data);
|
|
47
|
-
this.ordinal.setPropertiesFromData(this.data, this.dimensions.isHorizontal);
|
|
48
|
-
this.color.setPropertiesFromData(this.data);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
protected setValueIndices(): void {
|
|
52
|
-
this.valueIndices = range(this.data.length).filter((i) => {
|
|
53
|
-
if (!this.ordinal.domainIncludes(this.ordinal.values[i])) {
|
|
54
|
-
return false;
|
|
55
|
-
} else {
|
|
56
|
-
const ordinalValue = this.ordinal.values[i];
|
|
57
|
-
const firstIndex = this.ordinal.values.indexOf(ordinalValue);
|
|
58
|
-
return i === firstIndex;
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
protected setHasNegativeValues(): void {
|
|
64
|
-
this.hasNegativeValues = min(this.quantitative.values) < 0;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
protected setBarsKeyFunction(): void {
|
|
68
|
-
this.barsKeyFunction = (i: number): string => `${this.ordinal.values[i]}`;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export interface BarsDimensions {
|
|
2
|
-
x: 'ordinal' | 'quantitative';
|
|
3
|
-
y: 'ordinal' | 'quantitative';
|
|
4
|
-
ordinal: 'x' | 'y';
|
|
5
|
-
quantitative: 'x' | 'y';
|
|
6
|
-
quantitativeDimension: 'width' | 'height';
|
|
7
|
-
isHorizontal: boolean;
|
|
8
|
-
isVertical: boolean;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export const HORIZONTAL_BARS_DIMENSIONS: BarsDimensions = {
|
|
12
|
-
x: 'quantitative',
|
|
13
|
-
y: 'ordinal',
|
|
14
|
-
ordinal: 'y',
|
|
15
|
-
quantitative: 'x',
|
|
16
|
-
quantitativeDimension: 'width',
|
|
17
|
-
isHorizontal: true,
|
|
18
|
-
isVertical: false,
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export const VERTICAL_BARS_DIMENSIONS: BarsDimensions = {
|
|
22
|
-
x: 'ordinal',
|
|
23
|
-
y: 'quantitative',
|
|
24
|
-
ordinal: 'x',
|
|
25
|
-
quantitative: 'y',
|
|
26
|
-
quantitativeDimension: 'height',
|
|
27
|
-
isHorizontal: false,
|
|
28
|
-
isVertical: true,
|
|
29
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { DataValue } from '../../core/types/values';
|
|
2
|
-
import { FillDefinition } from '../../data-dimensions';
|
|
3
|
-
import { NumberChartPositionDimension } from '../../data-dimensions/continuous-quantitative/number-chart-position/number-chart-position';
|
|
4
|
-
import { OrdinalChartPositionDimension } from '../../data-dimensions/ordinal/ordinal-chart-position/ordinal-chart-position';
|
|
5
|
-
import { OrdinalVisualValueDimension } from '../../data-dimensions/ordinal/ordinal-visual-value/ordinal-visual-value';
|
|
6
|
-
import { DataMarksOptions } from '../../marks/config/marks-options';
|
|
7
|
-
import { BarsBackgrounds } from './backgrounds/bars-backgrounds';
|
|
8
|
-
import { BarsLabels } from './labels/bars-labels';
|
|
9
|
-
|
|
10
|
-
export interface BarsOptions<
|
|
11
|
-
Datum,
|
|
12
|
-
OrdinalDomain extends DataValue,
|
|
13
|
-
> extends DataMarksOptions<Datum> {
|
|
14
|
-
backgrounds: BarsBackgrounds;
|
|
15
|
-
color: OrdinalVisualValueDimension<Datum, string, string>;
|
|
16
|
-
customFills: FillDefinition<Datum>[];
|
|
17
|
-
ordinal: OrdinalChartPositionDimension<Datum, OrdinalDomain>;
|
|
18
|
-
quantitative: NumberChartPositionDimension<Datum>;
|
|
19
|
-
labels: BarsLabels<Datum>;
|
|
20
|
-
}
|