@mathstack/viz 1.1.4 → 2.0.3
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/CHANGELOG.md +0 -0
- package/LICENSE +21 -21
- package/README.md +11 -0
- package/cypress/fixtures/example.json +5 -0
- package/cypress/fixtures/usMap.json +13511 -0
- package/cypress/support/commands.ts +104 -0
- package/cypress/support/component-index.html +12 -0
- package/cypress/support/component.ts +33 -0
- package/cypress.config.ts +9 -0
- package/karma.conf.js +62 -0
- package/ng-package.json +8 -0
- package/package.json +10 -19
- package/project.json +97 -0
- package/src/.eslintrc.json +35 -0
- package/src/.prettierrc +31 -0
- package/src/lib/axes/base/config/xy-axis-builder.ts +68 -0
- package/src/lib/axes/base/config/xy-axis-config.ts +35 -0
- package/{lib/axes/base/config/xy-axis-options.d.ts → src/lib/axes/base/config/xy-axis-options.ts} +11 -10
- package/src/lib/axes/base/xy-axis-base.spec.ts +114 -0
- package/src/lib/axes/base/xy-axis-base.ts +300 -0
- package/src/lib/axes/base/xy-axis-domain-lines.cy.ts +511 -0
- package/src/lib/axes/baseline/axis-baseline-builder.ts +77 -0
- package/src/lib/axes/baseline/axis-baseline-options.ts +4 -0
- package/src/lib/axes/baseline/axis-baseline.ts +11 -0
- package/src/lib/axes/grid/grid-builder.ts +74 -0
- package/src/lib/axes/grid/grid-config.ts +13 -0
- package/src/lib/axes/grid/grid-options.ts +7 -0
- package/src/lib/axes/index.ts +40 -0
- package/src/lib/axes/label/axis-label-builder.ts +140 -0
- package/src/lib/axes/label/axis-label-options.ts +12 -0
- package/src/lib/axes/label/axis-label.ts +18 -0
- package/src/lib/axes/label/axis-labels.cy.ts +303 -0
- package/src/lib/axes/ordinal/ordinal-axis-config.ts +31 -0
- package/src/lib/axes/ordinal/ordinal-axis.spec.ts +30 -0
- package/src/lib/axes/ordinal/ordinal-axis.ts +26 -0
- package/src/lib/axes/quantitative/quantitative-axis-config.ts +39 -0
- package/src/lib/axes/quantitative/quantitative-axis-ticks.cy.ts +748 -0
- package/src/lib/axes/quantitative/quantitative-axis.spec.ts +537 -0
- package/src/lib/axes/quantitative/quantitative-axis.ts +191 -0
- package/src/lib/axes/ticks/tick-wrap/tick-wrap-builder.ts +141 -0
- package/src/lib/axes/ticks/tick-wrap/tick-wrap-options.ts +11 -0
- package/src/lib/axes/ticks/tick-wrap/tick-wrap.cy.ts +360 -0
- package/src/lib/axes/ticks/tick-wrap/tick-wrap.ts +21 -0
- package/src/lib/axes/ticks/ticks-builder.ts +370 -0
- package/src/lib/axes/ticks/ticks-options.ts +24 -0
- package/src/lib/axes/ticks/ticks.ts +33 -0
- package/src/lib/axes/x/x-axis-config.ts +48 -0
- package/src/lib/axes/x/x-axis.spec.ts +90 -0
- package/src/lib/axes/x/x-axis.ts +109 -0
- package/src/lib/axes/x-ordinal/x-ordinal-axis-builder.ts +75 -0
- package/src/lib/axes/x-ordinal/x-ordinal-axis-config.ts +27 -0
- package/src/lib/axes/x-ordinal/x-ordinal-axis.component.ts +33 -0
- package/src/lib/axes/x-quantitative/x-quantitative-axis-builder.ts +74 -0
- package/src/lib/axes/x-quantitative/x-quantitative-axis-config.ts +32 -0
- package/src/lib/axes/x-quantitative/x-quantitative-axis.component.ts +40 -0
- package/src/lib/axes/xy-axis.module.ts +20 -0
- package/src/lib/axes/y/y-axis-config.ts +47 -0
- package/src/lib/axes/y/y-axis.spec.ts +92 -0
- package/src/lib/axes/y/y-axis.ts +161 -0
- package/src/lib/axes/y-ordinal/y-ordinal-axis-builder.ts +76 -0
- package/src/lib/axes/y-ordinal/y-ordinal-axis-config.ts +29 -0
- package/src/lib/axes/y-ordinal/y-ordinal-axis.component.ts +33 -0
- package/src/lib/axes/y-quantitative-axis/y-quantitative-axis-builder.ts +74 -0
- package/src/lib/axes/y-quantitative-axis/y-quantitative-axis-config.ts +34 -0
- package/src/lib/axes/y-quantitative-axis/y-quantitative-axis.component.ts +40 -0
- package/src/lib/bars/bars.component.scss +0 -0
- package/src/lib/bars/bars.component.spec.ts +1470 -0
- package/src/lib/bars/bars.component.ts +717 -0
- package/src/lib/bars/bars.cy.ts +829 -0
- package/src/lib/bars/bars.module.ts +9 -0
- package/src/lib/bars/config/backgrounds/bars-backgrounds-builder.ts +51 -0
- package/{lib/bars/config/backgrounds/bars-backgrounds-options.d.ts → src/lib/bars/config/backgrounds/bars-backgrounds-options.ts} +4 -4
- package/src/lib/bars/config/backgrounds/bars-backgrounds.ts +11 -0
- package/src/lib/bars/config/bars-builder.ts +340 -0
- package/src/lib/bars/config/bars-config.spec.ts +132 -0
- package/src/lib/bars/config/bars-config.ts +70 -0
- package/src/lib/bars/config/bars-dimensions.ts +29 -0
- package/{lib/bars/config/bars-options.d.ts → src/lib/bars/config/bars-options.ts} +20 -16
- package/src/lib/bars/config/labels/bars-labels-builder.ts +89 -0
- package/src/lib/bars/config/labels/bars-labels-options.ts +6 -0
- package/src/lib/bars/config/labels/bars-labels.cy.ts +781 -0
- package/src/lib/bars/config/labels/bars-labels.ts +13 -0
- package/src/lib/bars/events/actions/bars-click-actions.ts +23 -0
- package/src/lib/bars/events/actions/bars-hover-actions.ts +43 -0
- package/src/lib/bars/events/actions/bars-hover-move-actions.ts +21 -0
- package/src/lib/bars/events/bars-events.directive.spec.ts +186 -0
- package/src/lib/bars/events/bars-events.directive.ts +235 -0
- package/src/lib/bars/events/bars-interaction-output.ts +17 -0
- package/src/lib/bars/events/bars-tooltip-positioner.ts +24 -0
- package/{lib/bars/index.d.ts → src/lib/bars/index.ts} +18 -12
- package/src/lib/charts/chart/chart-scaling.cy.ts +323 -0
- package/src/lib/charts/chart/chart.component.html +45 -0
- package/src/lib/charts/chart/chart.component.scss +37 -0
- package/src/lib/charts/chart/chart.component.ts +243 -0
- package/{lib/charts/chart/chart.token.d.ts → src/lib/charts/chart/chart.token.ts} +4 -3
- package/src/lib/charts/chart/chart.ts +5 -0
- package/src/lib/charts/chart/config/chart-builder.ts +194 -0
- package/src/lib/charts/chart/config/chart-config.ts +21 -0
- package/src/lib/charts/chart/config/chart-options.ts +11 -0
- package/src/lib/charts/chart.module.ts +10 -0
- package/{lib/charts/index.d.ts → src/lib/charts/index.ts} +9 -8
- package/src/lib/charts/map-chart/map-chart.component.scss +0 -0
- package/src/lib/charts/map-chart/map-chart.component.spec.ts +35 -0
- package/src/lib/charts/map-chart/map-chart.component.ts +61 -0
- package/src/lib/charts/xy-chart/xy-chart.component.spec.ts +34 -0
- package/src/lib/charts/xy-chart/xy-chart.component.ts +65 -0
- package/src/lib/core/common-behaviors/constructor.ts +7 -0
- package/src/lib/core/index.ts +11 -0
- package/src/lib/core/pipes/resize-chart-height.pipe.spec.ts +23 -0
- package/src/lib/core/pipes/resize-chart-height.pipe.ts +20 -0
- package/src/lib/core/styles/_spacing.scss +4 -0
- package/src/lib/core/types/layout.ts +28 -0
- package/src/lib/core/types/scale.ts +6 -0
- package/src/lib/core/types/utility.ts +11 -0
- package/{lib/core/types/values.d.ts → src/lib/core/types/values.ts} +10 -7
- package/src/lib/core/utilities/colors.spec.ts +57 -0
- package/src/lib/core/utilities/colors.ts +42 -0
- package/src/lib/core/utilities/fill-utilities.spec.ts +25 -0
- package/src/lib/core/utilities/fill-utilities.ts +21 -0
- package/src/lib/core/utilities/type-guards.spec.ts +55 -0
- package/src/lib/core/utilities/type-guards.ts +33 -0
- package/src/lib/core/utilities/value-format.ts +21 -0
- package/src/lib/core/utilities/values.spec.ts +954 -0
- package/src/lib/core/utilities/values.ts +189 -0
- package/src/lib/data-dimensions/continuous-quantitative/date-chart-position/date-chart-position-builder.ts +105 -0
- package/src/lib/data-dimensions/continuous-quantitative/date-chart-position/date-chart-position-options.ts +24 -0
- package/src/lib/data-dimensions/continuous-quantitative/date-chart-position/date-chart-position.spec.ts +66 -0
- package/src/lib/data-dimensions/continuous-quantitative/date-chart-position/date-chart-position.ts +72 -0
- package/{lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/concrete-domain-padding.d.ts → src/lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/concrete-domain-padding.ts} +10 -5
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/domain-padding.ts +76 -0
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/domain-test-utility.ts +130 -0
- package/{lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/percent-over/percent-over-options.d.ts → src/lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/percent-over/percent-over-options.ts} +3 -3
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/percent-over/percent-over.ts +37 -0
- package/{lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/pixel/pixel-options.d.ts → src/lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/pixel/pixel-options.ts} +3 -3
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/pixel/pixel.ts +73 -0
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/quantitative-domain-padding.cy.ts +978 -0
- package/{lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/round-to-interval/round-to-interval-options.d.ts → src/lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/round-to-interval/round-to-interval-options.ts} +3 -3
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/round-to-interval/round-to-interval.ts +27 -0
- package/{lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/round-to-sig-fig/round-to-sig-fig-options.d.ts → src/lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/round-to-sig-fig/round-to-sig-fig-options.ts} +3 -3
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/round-to-sig-fig/round-to-sig-fig.ts +30 -0
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/number-chart-position-builder.ts +183 -0
- package/{lib/data-dimensions/continuous-quantitative/number-chart-position/number-chart-position-options.d.ts → src/lib/data-dimensions/continuous-quantitative/number-chart-position/number-chart-position-options.ts} +8 -5
- package/src/lib/data-dimensions/continuous-quantitative/number-chart-position/number-chart-position.spec.ts +28 -0
- package/{lib/data-dimensions/continuous-quantitative/number-chart-position/number-chart-position.d.ts → src/lib/data-dimensions/continuous-quantitative/number-chart-position/number-chart-position.ts} +62 -30
- package/src/lib/data-dimensions/continuous-quantitative/number-dimension/number-dimension-options.ts +15 -0
- package/src/lib/data-dimensions/continuous-quantitative/number-dimension/number-dimension.spec.ts +155 -0
- package/src/lib/data-dimensions/continuous-quantitative/number-dimension/number-dimension.ts +57 -0
- package/src/lib/data-dimensions/continuous-quantitative/number-visual-value/number-visual-value-builder.ts +166 -0
- package/src/lib/data-dimensions/continuous-quantitative/number-visual-value/number-visual-value-options.ts +10 -0
- package/src/lib/data-dimensions/continuous-quantitative/number-visual-value/number-visual-value.spec.ts +34 -0
- package/{lib/data-dimensions/continuous-quantitative/number-visual-value/number-visual-value.d.ts → src/lib/data-dimensions/continuous-quantitative/number-visual-value/number-visual-value.ts} +57 -29
- package/src/lib/data-dimensions/dimension-builder.ts +45 -0
- package/src/lib/data-dimensions/dimension-options.ts +12 -0
- package/src/lib/data-dimensions/dimension.ts +30 -0
- package/src/lib/data-dimensions/index.ts +31 -0
- package/src/lib/data-dimensions/ordinal/ordinal-chart-position/ordinal-chart-position-builder.ts +122 -0
- package/src/lib/data-dimensions/ordinal/ordinal-chart-position/ordinal-chart-position-options.ts +12 -0
- package/src/lib/data-dimensions/ordinal/ordinal-chart-position/ordinal-chart-position.spec.ts +83 -0
- package/src/lib/data-dimensions/ordinal/ordinal-chart-position/ordinal-chart-position.ts +101 -0
- package/src/lib/data-dimensions/ordinal/ordinal-visual-value/ordinal-visual-value-builder.ts +108 -0
- package/src/lib/data-dimensions/ordinal/ordinal-visual-value/ordinal-visual-value-options.ts +12 -0
- package/src/lib/data-dimensions/ordinal/ordinal-visual-value/ordinal-visual-value.cy.ts +384 -0
- package/src/lib/data-dimensions/ordinal/ordinal-visual-value/ordinal-visual-value.spec.ts +63 -0
- package/src/lib/data-dimensions/ordinal/ordinal-visual-value/ordinal-visual-value.ts +79 -0
- package/src/lib/data-export/data-export-config.ts +98 -0
- package/src/lib/data-export/data-export.spec.ts +33 -0
- package/src/lib/data-export/data-export.ts +87 -0
- package/{lib/data-export/index.d.ts → src/lib/data-export/index.ts} +2 -2
- package/src/lib/dots/config/dots-builder.ts +442 -0
- package/src/lib/dots/config/dots-config.spec.ts +123 -0
- package/src/lib/dots/config/dots-config.ts +81 -0
- package/{lib/dots/config/dots-options.d.ts → src/lib/dots/config/dots-options.ts} +32 -17
- package/src/lib/dots/dots.component.scss +0 -0
- package/src/lib/dots/dots.component.spec.ts +143 -0
- package/src/lib/dots/dots.component.ts +291 -0
- package/src/lib/dots/dots.cy.ts +594 -0
- package/src/lib/dots/dots.module.ts +9 -0
- package/src/lib/dots/events/actions/dots-hover-actions.ts +19 -0
- package/src/lib/dots/events/actions/dots-hover-move-actions.ts +38 -0
- package/src/lib/dots/events/dots-events.directive.ts +214 -0
- package/src/lib/dots/events/dots-interaction-output.ts +15 -0
- package/src/lib/dots/events/dots-tooltip-positioner.ts +24 -0
- package/{lib/dots/index.d.ts → src/lib/dots/index.ts} +10 -9
- package/src/lib/events/events.directive.ts +184 -0
- package/src/lib/events/events.types.ts +57 -0
- package/{lib/events/index.d.ts → src/lib/events/index.ts} +4 -4
- package/src/lib/events/interaction-output.ts +34 -0
- package/src/lib/events/tooltip-positioner.ts +15 -0
- package/src/lib/fill-definitions/fill-definitions.ts +4 -0
- package/{lib/fill-definitions/index.d.ts → src/lib/fill-definitions/index.ts} +1 -1
- package/src/lib/geographies/config/geographies-builder.ts +224 -0
- package/src/lib/geographies/config/geographies-config.spec.ts +100 -0
- package/src/lib/geographies/config/geographies-config.ts +81 -0
- package/src/lib/geographies/config/geographies-options.ts +37 -0
- package/src/lib/geographies/config/layers/attribute-data-layer/attribute-data-layer-builder.ts +212 -0
- package/{lib/geographies/config/layers/attribute-data-layer/attribute-data-layer-options.d.ts → src/lib/geographies/config/layers/attribute-data-layer/attribute-data-layer-options.ts} +26 -16
- package/src/lib/geographies/config/layers/attribute-data-layer/attribute-data-layer.spec.ts +119 -0
- package/src/lib/geographies/config/layers/attribute-data-layer/attribute-data-layer.ts +148 -0
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/attribute-data/attribute-data-dimension-builder.ts +65 -0
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/attribute-data/attribute-data-dimension-options.ts +15 -0
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/attribute-data/attribute-data-dimension.ts +32 -0
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/attribute-data-bin-enums.ts +10 -0
- package/{lib/geographies/config/layers/attribute-data-layer/dimensions/attribute-data-bin-types.d.ts → src/lib/geographies/config/layers/attribute-data-layer/dimensions/attribute-data-bin-types.ts} +15 -8
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/calculated-bins/calculated-bins-builder.ts +18 -0
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/calculated-bins/calculated-bins-options.ts +8 -0
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/calculated-bins/calculated-bins.spec.ts +60 -0
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/calculated-bins/calculated-bins.ts +34 -0
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/categorical-bins/categorical-bins-builder.ts +46 -0
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/categorical-bins/categorical-bins-options.ts +8 -0
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/categorical-bins/categorical-bins.cy.ts +437 -0
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/categorical-bins/categorical-bins.spec.ts +105 -0
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/categorical-bins/categorical-bins.ts +54 -0
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/custom-breaks/custom-breaks-bins-builder.ts +65 -0
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/custom-breaks/custom-breaks-bins-options.ts +9 -0
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/custom-breaks/custom-breaks-bins.spec.ts +82 -0
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/custom-breaks/custom-breaks-bins.ts +81 -0
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/custom-breaks/custom-breaks.cy.ts +378 -0
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/equal-frequencies-bins/equal-frequencies-bins-builder.ts +50 -0
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/equal-frequencies-bins/equal-frequencies-bins-options.ts +8 -0
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/equal-frequencies-bins/equal-frequencies-bins.cy.ts +362 -0
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/equal-frequencies-bins/equal-frequencies-bins.spec.ts +72 -0
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/equal-frequencies-bins/equal-frequencies-bins.ts +56 -0
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/equal-value-ranges-bins/equal-value-ranges-bins-builder.ts +60 -0
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/equal-value-ranges-bins/equal-value-ranges-bins-options.ts +9 -0
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/equal-value-ranges-bins/equal-value-ranges-bins.cy.ts +307 -0
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/equal-value-ranges-bins/equal-value-ranges-bins.spec.ts +104 -0
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/equal-value-ranges-bins/equal-value-ranges-bins.ts +89 -0
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/no-bins/no-bins-builder.ts +62 -0
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/no-bins/no-bins-options.ts +8 -0
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/no-bins/no-bins.cy.ts +265 -0
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/no-bins/no-bins.spec.ts +42 -0
- package/src/lib/geographies/config/layers/attribute-data-layer/dimensions/no-bins/no-bins.ts +42 -0
- package/src/lib/geographies/config/layers/geographies-layer/geographies-layer-builder.ts +116 -0
- package/{lib/geographies/config/layers/geographies-layer/geographies-layer-options.d.ts → src/lib/geographies/config/layers/geographies-layer/geographies-layer-options.ts} +20 -16
- package/src/lib/geographies/config/layers/geographies-layer/geographies-layer.ts +104 -0
- package/src/lib/geographies/config/layers/geojson-properties-layer/geojson-properties-layer-builder.ts +111 -0
- package/src/lib/geographies/config/layers/geojson-properties-layer/geojson-properties-layer-options.ts +19 -0
- package/src/lib/geographies/config/layers/geojson-properties-layer/geojson-properties-layer.spec.ts +41 -0
- package/src/lib/geographies/config/layers/geojson-properties-layer/geojson-properties-layer.ts +67 -0
- package/src/lib/geographies/config/layers/labels/geographies-labels-builder.ts +269 -0
- package/src/lib/geographies/config/layers/labels/geographies-labels-options.ts +45 -0
- package/src/lib/geographies/config/layers/labels/geographies-labels.ts +38 -0
- package/src/lib/geographies/events/actions/geographies-click-actions.ts +21 -0
- package/src/lib/geographies/events/actions/geographies-hover-actions.ts +17 -0
- package/src/lib/geographies/events/actions/geographies-hover-move-actions.ts +19 -0
- package/src/lib/geographies/events/geographies-events.directive.spec.ts +225 -0
- package/src/lib/geographies/events/geographies-events.directive.ts +235 -0
- package/src/lib/geographies/events/geographies-interaction-output.ts +17 -0
- package/src/lib/geographies/events/geographies-tooltip-positioner.ts +23 -0
- package/src/lib/geographies/geographies-feature.ts +16 -0
- package/src/lib/geographies/geographies.component.html +1 -0
- package/src/lib/geographies/geographies.component.scss +0 -0
- package/src/lib/geographies/geographies.component.spec.ts +148 -0
- package/src/lib/geographies/geographies.component.ts +318 -0
- package/src/lib/geographies/geographies.cy.ts +640 -0
- package/src/lib/geographies/geographies.module.ts +9 -0
- package/{lib/geographies/index.d.ts → src/lib/geographies/index.ts} +32 -32
- package/src/lib/grouped-bars/config/grouped-bars-builder.ts +66 -0
- package/src/lib/grouped-bars/config/grouped-bars-config.ts +41 -0
- package/src/lib/grouped-bars/config/grouped-bars-options.ts +9 -0
- package/src/lib/grouped-bars/events/grouped-bars-events.directive.ts +221 -0
- package/src/lib/grouped-bars/grouped-bars.component.scss +0 -0
- package/src/lib/grouped-bars/grouped-bars.component.spec.ts +25 -0
- package/src/lib/grouped-bars/grouped-bars.component.ts +94 -0
- package/src/lib/grouped-bars/grouped-bars.module.ts +9 -0
- package/{lib/grouped-bars/index.d.ts → src/lib/grouped-bars/index.ts} +10 -7
- package/src/lib/image-download/image-download-config.ts +57 -0
- package/src/lib/image-download/image-download-enums.ts +7 -0
- package/src/lib/image-download/image-download-options.ts +14 -0
- package/src/lib/image-download/image-download.service.ts +70 -0
- package/{lib/image-download/index.d.ts → src/lib/image-download/index.ts} +4 -4
- package/src/lib/lines/config/area-fills/area-fills-builder.ts +87 -0
- package/src/lib/lines/config/area-fills/area-fills-options.ts +8 -0
- package/src/lib/lines/config/area-fills/area-fills.ts +14 -0
- package/src/lib/lines/config/lines-builder.ts +242 -0
- package/src/lib/lines/config/lines-config.spec.ts +52 -0
- package/src/lib/lines/config/lines-config.ts +96 -0
- package/{lib/lines/config/lines-options.d.ts → src/lib/lines/config/lines-options.ts} +19 -18
- package/src/lib/lines/config/stroke/lines-stroke-builder.ts +135 -0
- package/{lib/lines/config/stroke/lines-stroke-options.d.ts → src/lib/lines/config/stroke/lines-stroke-options.ts} +6 -5
- package/src/lib/lines/config/stroke/lines-stroke.ts +15 -0
- package/src/lib/lines/events/actions/lines-click-actions.ts +17 -0
- package/src/lib/lines/events/actions/lines-hover-move-actions.ts +113 -0
- package/src/lib/lines/events/actions/lines-marker-click-actions.ts +29 -0
- package/src/lib/lines/events/lines-events.directive.spec.ts +152 -0
- package/src/lib/lines/events/lines-events.directive.ts +310 -0
- package/src/lib/lines/events/lines-interaction-output.ts +17 -0
- package/src/lib/lines/events/lines-tooltip-positioner.ts +24 -0
- package/{lib/lines/index.d.ts → src/lib/lines/index.ts} +17 -11
- package/src/lib/lines/lines.component.scss +0 -0
- package/src/lib/lines/lines.component.spec.ts +95 -0
- package/src/lib/lines/lines.component.ts +425 -0
- package/src/lib/lines/lines.cy.ts +738 -0
- package/src/lib/lines/lines.module.ts +9 -0
- package/src/lib/map-legend/continuous-legend/continuous-legend.component.html +28 -0
- package/src/lib/map-legend/continuous-legend/continuous-legend.component.scss +76 -0
- package/src/lib/map-legend/continuous-legend/continuous-legend.component.spec.ts +61 -0
- package/src/lib/map-legend/continuous-legend/continuous-legend.component.ts +82 -0
- package/src/lib/map-legend/discontinuous-legend/discontinuous-legend.component.html +40 -0
- package/src/lib/map-legend/discontinuous-legend/discontinuous-legend.component.scss +141 -0
- package/src/lib/map-legend/discontinuous-legend/discontinuous-legend.component.spec.ts +75 -0
- package/src/lib/map-legend/discontinuous-legend/discontinuous-legend.component.ts +57 -0
- package/{lib/map-legend/index.d.ts → src/lib/map-legend/index.ts} +2 -2
- package/src/lib/map-legend/map-legend-base.spec.ts +190 -0
- package/src/lib/map-legend/map-legend-base.ts +99 -0
- package/src/lib/map-legend/map-legend.component.html +24 -0
- package/src/lib/map-legend/map-legend.component.scss +0 -0
- package/src/lib/map-legend/map-legend.component.spec.ts +125 -0
- package/src/lib/map-legend/map-legend.component.ts +80 -0
- package/src/lib/map-legend/map-legend.module.ts +8 -0
- package/src/lib/marks/aux-marks/aux-marks.ts +18 -0
- package/src/lib/marks/aux-marks/config/aux-marks-builder.ts +25 -0
- package/{lib/marks/aux-marks/config/aux-marks-config.d.ts → src/lib/marks/aux-marks/config/aux-marks-config.ts} +6 -4
- package/src/lib/marks/config/marks-config.ts +14 -0
- package/src/lib/marks/config/marks-options.ts +9 -0
- package/{lib/marks/index.d.ts → src/lib/marks/index.ts} +15 -15
- package/src/lib/marks/map-marks/map-aux-marks/map-aux-marks.spec.ts +74 -0
- package/src/lib/marks/map-marks/map-aux-marks/map-aux-marks.ts +40 -0
- package/src/lib/marks/map-marks/map-primary-marks/map-primary-marks.spec.ts +79 -0
- package/src/lib/marks/map-marks/map-primary-marks/map-primary-marks.ts +63 -0
- package/src/lib/marks/marks.ts +39 -0
- package/src/lib/marks/primary-marks/config/primary-marks-builder.ts +75 -0
- package/src/lib/marks/primary-marks/config/primary-marks-config.ts +9 -0
- package/src/lib/marks/primary-marks/primary-marks-base.spec.ts +58 -0
- package/src/lib/marks/primary-marks/primary-marks.ts +43 -0
- package/src/lib/marks/xy-marks/xy-aux-marks/xy-aux-marks.ts +40 -0
- package/src/lib/marks/xy-marks/xy-marks-config.ts +5 -0
- package/src/lib/marks/xy-marks/xy-marks.ts +10 -0
- package/src/lib/marks/xy-marks/xy-primary-marks/xy-primary-marks-config.ts +7 -0
- package/src/lib/marks/xy-marks/xy-primary-marks/xy-primary-marks.spec.ts +186 -0
- package/src/lib/marks/xy-marks/xy-primary-marks/xy-primary-marks.ts +72 -0
- package/{lib/point-markers/index.d.ts → src/lib/point-markers/index.ts} +3 -2
- package/src/lib/point-markers/point-markers-builder.ts +93 -0
- package/src/lib/point-markers/point-markers-options.ts +6 -0
- package/src/lib/point-markers/point-markers.ts +13 -0
- package/src/lib/quantitative-rules/config/labels/quantitative-rules-labels-builder.ts +162 -0
- package/src/lib/quantitative-rules/config/labels/quantitative-rules-labels-options.ts +17 -0
- package/src/lib/quantitative-rules/config/labels/quantitative-rules-labels.ts +26 -0
- package/src/lib/quantitative-rules/config/quantitative-rules-builder.ts +134 -0
- package/src/lib/quantitative-rules/config/quantitative-rules-config.ts +21 -0
- package/src/lib/quantitative-rules/config/quantitative-rules-dimensions.ts +20 -0
- package/{lib/quantitative-rules/config/quantitative-rules-options.d.ts → src/lib/quantitative-rules/config/quantitative-rules-options.ts} +13 -10
- package/{lib/quantitative-rules/index.d.ts → src/lib/quantitative-rules/index.ts} +6 -6
- package/src/lib/quantitative-rules/quantitative-rules.component.scss +3 -0
- package/src/lib/quantitative-rules/quantitative-rules.component.spec.ts +50 -0
- package/src/lib/quantitative-rules/quantitative-rules.component.ts +224 -0
- package/src/lib/quantitative-rules/quantitative-rules.cy.ts +549 -0
- package/src/lib/quantitative-rules/quantitative-rules.module.ts +8 -0
- package/src/lib/stacked-area/config/stacked-area-builder.ts +264 -0
- package/src/lib/stacked-area/config/stacked-area-config.spec.ts +107 -0
- package/src/lib/stacked-area/config/stacked-area-config.ts +109 -0
- package/src/lib/stacked-area/config/stacked-area-options.ts +28 -0
- package/src/lib/stacked-area/events/actions/stacked-area-hover-move-actions.ts +17 -0
- package/src/lib/stacked-area/events/stacked-area-events.directive.spec.ts +168 -0
- package/src/lib/stacked-area/events/stacked-area-events.directive.ts +272 -0
- package/src/lib/stacked-area/events/stacked-area-interaction-output.ts +33 -0
- package/src/lib/stacked-area/events/stacked-area-tooltip-positioner.ts +37 -0
- package/{lib/stacked-area/index.d.ts → src/lib/stacked-area/index.ts} +7 -7
- package/src/lib/stacked-area/stacked-area.component.scss +0 -0
- package/src/lib/stacked-area/stacked-area.component.spec.ts +41 -0
- package/src/lib/stacked-area/stacked-area.component.ts +241 -0
- package/src/lib/stacked-area/stacked-area.module.ts +9 -0
- package/src/lib/stacked-bars/config/stacked-bars-builder.ts +109 -0
- package/src/lib/stacked-bars/config/stacked-bars-config.spec.ts +122 -0
- package/src/lib/stacked-bars/config/stacked-bars-config.ts +79 -0
- package/src/lib/stacked-bars/config/stacked-bars-options.ts +16 -0
- package/src/lib/stacked-bars/events/actions/stacked-bars-click-actions.ts +23 -0
- package/src/lib/stacked-bars/events/actions/stacked-bars-hover-actions.ts +22 -0
- package/src/lib/stacked-bars/events/actions/stacked-bars-hover-move-actions.ts +21 -0
- package/src/lib/stacked-bars/events/stacked-bars-events.directive.spec.ts +266 -0
- package/src/lib/stacked-bars/events/stacked-bars-events.directive.ts +240 -0
- package/{lib/stacked-bars/index.d.ts → src/lib/stacked-bars/index.ts} +10 -10
- package/src/lib/stacked-bars/stacked-bars.component.scss +0 -0
- package/src/lib/stacked-bars/stacked-bars.component.spec.ts +25 -0
- package/src/lib/stacked-bars/stacked-bars.component.ts +158 -0
- package/src/lib/stacked-bars/stacked-bars.module.ts +9 -0
- package/src/lib/stroke/base/stroke-base-options.ts +7 -0
- package/src/lib/stroke/base/stroke-base.ts +9 -0
- package/src/lib/stroke/index.ts +5 -0
- package/src/lib/stroke/stroke-builder.ts +103 -0
- package/{lib/stroke/stroke-options.d.ts → src/lib/stroke/stroke-options.ts} +5 -4
- package/src/lib/stroke/stroke.ts +12 -0
- package/{lib/svg-text-wrap/index.d.ts → src/lib/svg-text-wrap/index.ts} +3 -2
- package/src/lib/svg-text-wrap/svg-text-wrap-builder.ts +105 -0
- package/src/lib/svg-text-wrap/svg-text-wrap-options.ts +8 -0
- package/src/lib/svg-text-wrap/svg-text-wrap.ts +137 -0
- package/src/lib/testing/data/continent-population-year-data.ts +126 -0
- package/src/lib/testing/data/country-area-continent.ts +59 -0
- package/src/lib/testing/data/state-population-income-year-data.ts +123 -0
- package/src/lib/testing/stubs/bars.component.stub.ts +12 -0
- package/src/lib/testing/stubs/chart.component.stub.ts +6 -0
- package/src/lib/testing/stubs/click.directive.stub.ts +15 -0
- package/src/lib/testing/stubs/core/destroy-ref.stub.ts +9 -0
- package/src/lib/testing/stubs/core/overlay-ref.stub.ts +13 -0
- package/src/lib/testing/stubs/core/overlay.stub.ts +8 -0
- package/src/lib/testing/stubs/event.directive.stub.ts +10 -0
- package/src/lib/testing/stubs/hover-move.directive.stub.ts +17 -0
- package/src/lib/testing/stubs/hover.directive.stub.ts +14 -0
- package/src/lib/testing/stubs/input-event.directive.stub.ts +9 -0
- package/src/lib/testing/stubs/lines.component.stub.ts +13 -0
- package/src/lib/testing/stubs/map-aux-marks.stub.ts +10 -0
- package/src/lib/testing/stubs/map-chart.component.stub.ts +3 -0
- package/src/lib/testing/stubs/map-legend-content.stub.ts +16 -0
- package/src/lib/testing/stubs/map-legend.component.stub.ts +10 -0
- package/src/lib/testing/stubs/map-primary-marks.stub.ts +16 -0
- package/src/lib/testing/stubs/ordinal-axis.stub.ts +18 -0
- package/src/lib/testing/stubs/primary-marks.stub.ts +18 -0
- package/src/lib/testing/stubs/quantitative-axis.stub.ts +18 -0
- package/src/lib/testing/stubs/services/main.service.stub.ts +5 -0
- package/src/lib/testing/stubs/services/utilities.service.stub.ts +7 -0
- package/src/lib/testing/stubs/stacked-area.component.stub.ts +13 -0
- package/src/lib/testing/stubs/x-axis.stub.ts +10 -0
- package/src/lib/testing/stubs/xy-axis.class.stub.ts +20 -0
- package/src/lib/testing/stubs/xy-axis.stub.ts +44 -0
- package/src/lib/testing/stubs/xy-chart.component.stub.ts +5 -0
- package/src/lib/testing/stubs/xy-data-marks.stub.ts +15 -0
- package/src/lib/testing/stubs/y-axis.stub.ts +15 -0
- package/src/lib/tooltips/config/tooltip.ts +11 -0
- package/src/lib/tooltips/html-tooltip/config/html-tooltip-builder.ts +134 -0
- package/src/lib/tooltips/html-tooltip/config/html-tooltip-config.ts +21 -0
- package/{lib/tooltips/html-tooltip/config/html-tooltip-options.d.ts → src/lib/tooltips/html-tooltip/config/html-tooltip-options.ts} +12 -11
- package/src/lib/tooltips/html-tooltip/config/position/tooltip-position-builder.ts +191 -0
- package/src/lib/tooltips/html-tooltip/config/position/tooltip-position.ts +42 -0
- package/src/lib/tooltips/html-tooltip/config/size/tooltip-size-builder.ts +75 -0
- package/src/lib/tooltips/html-tooltip/config/size/tooltip-size-options.ts +8 -0
- package/src/lib/tooltips/html-tooltip/config/size/tooltip-size.ts +15 -0
- package/src/lib/tooltips/html-tooltip/html-tooltip.directive.spec.ts +537 -0
- package/src/lib/tooltips/html-tooltip/html-tooltip.directive.ts +210 -0
- package/src/lib/tooltips/html-tooltip/html-tooltip.module.ts +16 -0
- package/src/lib/tooltips/html-tooltip/tooltip-triangle/tooltip-triangle.component.html +41 -0
- package/src/lib/tooltips/html-tooltip/tooltip-triangle/tooltip-triangle.component.scss +63 -0
- package/src/lib/tooltips/html-tooltip/tooltip-triangle/tooltip-triangle.component.ts +19 -0
- package/{lib/tooltips/index.d.ts → src/lib/tooltips/index.ts} +11 -11
- package/src/lib/tooltips/svg-tooltip/config/svg-tooltip.ts +5 -0
- package/{lib/xy-background/index.d.ts → src/lib/xy-background/index.ts} +2 -2
- package/src/lib/xy-background/xy-background.component.html +10 -0
- package/src/lib/xy-background/xy-background.component.scss +0 -0
- package/src/lib/xy-background/xy-background.component.spec.ts +24 -0
- package/src/lib/xy-background/xy-background.component.ts +19 -0
- package/src/lib/xy-background/xy-background.module.ts +8 -0
- package/{public-api.d.ts → src/public-api.ts} +26 -23
- package/src/test.ts +15 -0
- package/tsconfig.doc.json +4 -0
- package/tsconfig.json +20 -0
- package/tsconfig.lib.json +23 -0
- package/tsconfig.lib.prod.json +10 -0
- package/tsconfig.spec.json +10 -0
- package/fesm2022/mathstack-viz.mjs +0 -11049
- package/fesm2022/mathstack-viz.mjs.map +0 -1
- package/index.d.ts +0 -5
- package/lib/axes/base/config/xy-axis-builder.d.ts +0 -38
- package/lib/axes/base/config/xy-axis-config.d.ts +0 -18
- package/lib/axes/base/xy-axis-base.d.ts +0 -49
- package/lib/axes/baseline/axis-baseline-builder.d.ts +0 -31
- package/lib/axes/baseline/axis-baseline-options.d.ts +0 -7
- package/lib/axes/baseline/axis-baseline.d.ts +0 -9
- package/lib/axes/grid/grid-builder.d.ts +0 -29
- package/lib/axes/grid/grid-config.d.ts +0 -8
- package/lib/axes/grid/grid-options.d.ts +0 -6
- package/lib/axes/index.d.ts +0 -13
- package/lib/axes/label/axis-label-builder.d.ts +0 -63
- package/lib/axes/label/axis-label-options.d.ts +0 -11
- package/lib/axes/label/axis-label.d.ts +0 -13
- package/lib/axes/ordinal/ordinal-axis-config.d.ts +0 -38
- package/lib/axes/ordinal/ordinal-axis.d.ts +0 -43
- package/lib/axes/quantitative/quantitative-axis-config.d.ts +0 -38
- package/lib/axes/quantitative/quantitative-axis.d.ts +0 -51
- package/lib/axes/ticks/tick-wrap/tick-wrap-builder.d.ts +0 -64
- package/lib/axes/ticks/tick-wrap/tick-wrap-options.d.ts +0 -8
- package/lib/axes/ticks/tick-wrap/tick-wrap.d.ts +0 -13
- package/lib/axes/ticks/ticks-builder.d.ts +0 -172
- package/lib/axes/ticks/ticks-options.d.ts +0 -22
- package/lib/axes/ticks/ticks.d.ts +0 -24
- package/lib/axes/x/x-axis-config.d.ts +0 -42
- package/lib/axes/x/x-axis.d.ts +0 -47
- package/lib/axes/x-ordinal/x-ordinal-axis-builder.d.ts +0 -29
- package/lib/axes/x-ordinal/x-ordinal-axis-config.d.ts +0 -25
- package/lib/axes/x-ordinal/x-ordinal-axis.component.d.ts +0 -88
- package/lib/axes/x-quantitative/x-quantitative-axis-builder.d.ts +0 -29
- package/lib/axes/x-quantitative/x-quantitative-axis-config.d.ts +0 -25
- package/lib/axes/x-quantitative/x-quantitative-axis.component.d.ts +0 -53
- package/lib/axes/xy-axis.module.d.ts +0 -10
- package/lib/axes/y/y-axis-config.d.ts +0 -42
- package/lib/axes/y/y-axis.d.ts +0 -53
- package/lib/axes/y-ordinal/y-ordinal-axis-builder.d.ts +0 -29
- package/lib/axes/y-ordinal/y-ordinal-axis-config.d.ts +0 -25
- package/lib/axes/y-ordinal/y-ordinal-axis.component.d.ts +0 -89
- package/lib/axes/y-quantitative-axis/y-quantitative-axis-builder.d.ts +0 -29
- package/lib/axes/y-quantitative-axis/y-quantitative-axis-config.d.ts +0 -25
- package/lib/axes/y-quantitative-axis/y-quantitative-axis.component.d.ts +0 -54
- package/lib/bars/bars.component.d.ts +0 -91
- package/lib/bars/bars.module.d.ts +0 -8
- package/lib/bars/config/backgrounds/bars-backgrounds-builder.d.ts +0 -27
- package/lib/bars/config/backgrounds/bars-backgrounds.d.ts +0 -6
- package/lib/bars/config/bars-builder.d.ts +0 -132
- package/lib/bars/config/bars-config.d.ts +0 -27
- package/lib/bars/config/bars-dimensions.d.ts +0 -11
- package/lib/bars/config/labels/bars-labels-builder.d.ts +0 -48
- package/lib/bars/config/labels/bars-labels-options.d.ts +0 -9
- package/lib/bars/config/labels/bars-labels.d.ts +0 -11
- package/lib/bars/events/actions/bars-click-actions.d.ts +0 -8
- package/lib/bars/events/actions/bars-hover-actions.d.ts +0 -12
- package/lib/bars/events/actions/bars-hover-move-actions.d.ts +0 -8
- package/lib/bars/events/bars-events.directive.d.ts +0 -38
- package/lib/bars/events/bars-interaction-output.d.ts +0 -16
- package/lib/bars/events/bars-tooltip-positioner.d.ts +0 -13
- package/lib/charts/chart/chart.component.d.ts +0 -73
- package/lib/charts/chart/chart.d.ts +0 -4
- package/lib/charts/chart/config/chart-builder.d.ts +0 -94
- package/lib/charts/chart/config/chart-config.d.ts +0 -16
- package/lib/charts/chart/config/chart-options.d.ts +0 -10
- package/lib/charts/chart.module.d.ts +0 -9
- package/lib/charts/map-chart/map-chart.component.d.ts +0 -40
- package/lib/charts/xy-chart/xy-chart.component.d.ts +0 -40
- package/lib/core/common-behaviors/constructor.d.ts +0 -2
- package/lib/core/index.d.ts +0 -5
- package/lib/core/types/layout.d.ts +0 -24
- package/lib/core/types/scale.d.ts +0 -5
- package/lib/core/utilities/colors.d.ts +0 -13
- package/lib/core/utilities/fill-utilities.d.ts +0 -7
- package/lib/core/utilities/type-guards.d.ts +0 -6
- package/lib/core/utilities/value-format.d.ts +0 -11
- package/lib/core/utilities/values.d.ts +0 -16
- package/lib/data-dimensions/continuous-quantitative/date-chart-position/date-chart-position-builder.d.ts +0 -39
- package/lib/data-dimensions/continuous-quantitative/date-chart-position/date-chart-position-options.d.ts +0 -18
- package/lib/data-dimensions/continuous-quantitative/date-chart-position/date-chart-position.d.ts +0 -38
- package/lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/domain-padding.d.ts +0 -20
- package/lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/percent-over/percent-over.d.ts +0 -9
- package/lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/pixel/pixel.d.ts +0 -10
- package/lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/round-to-interval/round-to-interval.d.ts +0 -8
- package/lib/data-dimensions/continuous-quantitative/number-chart-position/domain-padding/round-to-sig-fig/round-to-sig-fig.d.ts +0 -8
- package/lib/data-dimensions/continuous-quantitative/number-chart-position/number-chart-position-builder.d.ts +0 -71
- package/lib/data-dimensions/continuous-quantitative/number-dimension/number-dimension-options.d.ts +0 -8
- package/lib/data-dimensions/continuous-quantitative/number-dimension/number-dimension.d.ts +0 -28
- package/lib/data-dimensions/continuous-quantitative/number-visual-value/number-visual-value-builder.d.ts +0 -69
- package/lib/data-dimensions/continuous-quantitative/number-visual-value/number-visual-value-options.d.ts +0 -6
- package/lib/data-dimensions/dimension-builder.d.ts +0 -21
- package/lib/data-dimensions/dimension-options.d.ts +0 -11
- package/lib/data-dimensions/dimension.d.ts +0 -16
- package/lib/data-dimensions/index.d.ts +0 -9
- package/lib/data-dimensions/ordinal/ordinal-chart-position/ordinal-chart-position-builder.d.ts +0 -53
- package/lib/data-dimensions/ordinal/ordinal-chart-position/ordinal-chart-position-options.d.ts +0 -8
- package/lib/data-dimensions/ordinal/ordinal-chart-position/ordinal-chart-position.d.ts +0 -44
- package/lib/data-dimensions/ordinal/ordinal-visual-value/ordinal-visual-value-builder.d.ts +0 -45
- package/lib/data-dimensions/ordinal/ordinal-visual-value/ordinal-visual-value-options.d.ts +0 -7
- package/lib/data-dimensions/ordinal/ordinal-visual-value/ordinal-visual-value.d.ts +0 -38
- package/lib/data-export/data-export-config.d.ts +0 -50
- package/lib/data-export/data-export.d.ts +0 -7
- package/lib/dots/config/dots-builder.d.ts +0 -110
- package/lib/dots/config/dots-config.d.ts +0 -26
- package/lib/dots/dots.component.d.ts +0 -55
- package/lib/dots/dots.module.d.ts +0 -8
- package/lib/dots/events/actions/dots-hover-actions.d.ts +0 -6
- package/lib/dots/events/actions/dots-hover-move-actions.d.ts +0 -10
- package/lib/dots/events/dots-events.directive.d.ts +0 -37
- package/lib/dots/events/dots-interaction-output.d.ts +0 -14
- package/lib/dots/events/dots-tooltip-positioner.d.ts +0 -13
- package/lib/events/events.directive.d.ts +0 -43
- package/lib/events/events.types.d.ts +0 -34
- package/lib/events/interaction-output.d.ts +0 -33
- package/lib/events/tooltip-positioner.d.ts +0 -6
- package/lib/fill-definitions/fill-definitions.d.ts +0 -4
- package/lib/geographies/config/geographies-builder.d.ts +0 -80
- package/lib/geographies/config/geographies-config.d.ts +0 -19
- package/lib/geographies/config/geographies-options.d.ts +0 -13
- package/lib/geographies/config/layers/attribute-data-layer/attribute-data-layer-builder.d.ts +0 -63
- package/lib/geographies/config/layers/attribute-data-layer/attribute-data-layer.d.ts +0 -30
- package/lib/geographies/config/layers/attribute-data-layer/dimensions/attribute-data/attribute-data-dimension-builder.d.ts +0 -40
- package/lib/geographies/config/layers/attribute-data-layer/dimensions/attribute-data/attribute-data-dimension-options.d.ts +0 -8
- package/lib/geographies/config/layers/attribute-data-layer/dimensions/attribute-data/attribute-data-dimension.d.ts +0 -18
- package/lib/geographies/config/layers/attribute-data-layer/dimensions/attribute-data-bin-enums.d.ts +0 -10
- package/lib/geographies/config/layers/attribute-data-layer/dimensions/calculated-bins/calculated-bins-builder.d.ts +0 -10
- package/lib/geographies/config/layers/attribute-data-layer/dimensions/calculated-bins/calculated-bins-options.d.ts +0 -4
- package/lib/geographies/config/layers/attribute-data-layer/dimensions/calculated-bins/calculated-bins.d.ts +0 -8
- package/lib/geographies/config/layers/attribute-data-layer/dimensions/categorical-bins/categorical-bins-builder.d.ts +0 -14
- package/lib/geographies/config/layers/attribute-data-layer/dimensions/categorical-bins/categorical-bins-options.d.ts +0 -4
- package/lib/geographies/config/layers/attribute-data-layer/dimensions/categorical-bins/categorical-bins.d.ts +0 -20
- package/lib/geographies/config/layers/attribute-data-layer/dimensions/custom-breaks/custom-breaks-bins-builder.d.ts +0 -29
- package/lib/geographies/config/layers/attribute-data-layer/dimensions/custom-breaks/custom-breaks-bins-options.d.ts +0 -5
- package/lib/geographies/config/layers/attribute-data-layer/dimensions/custom-breaks/custom-breaks-bins.d.ts +0 -23
- package/lib/geographies/config/layers/attribute-data-layer/dimensions/equal-frequencies-bins/equal-frequencies-bins-builder.d.ts +0 -16
- package/lib/geographies/config/layers/attribute-data-layer/dimensions/equal-frequencies-bins/equal-frequencies-bins-options.d.ts +0 -4
- package/lib/geographies/config/layers/attribute-data-layer/dimensions/equal-frequencies-bins/equal-frequencies-bins.d.ts +0 -18
- package/lib/geographies/config/layers/attribute-data-layer/dimensions/equal-value-ranges-bins/equal-value-ranges-bins-builder.d.ts +0 -21
- package/lib/geographies/config/layers/attribute-data-layer/dimensions/equal-value-ranges-bins/equal-value-ranges-bins-options.d.ts +0 -5
- package/lib/geographies/config/layers/attribute-data-layer/dimensions/equal-value-ranges-bins/equal-value-ranges-bins.d.ts +0 -24
- package/lib/geographies/config/layers/attribute-data-layer/dimensions/no-bins/no-bins-builder.d.ts +0 -26
- package/lib/geographies/config/layers/attribute-data-layer/dimensions/no-bins/no-bins-options.d.ts +0 -5
- package/lib/geographies/config/layers/attribute-data-layer/dimensions/no-bins/no-bins.d.ts +0 -12
- package/lib/geographies/config/layers/geographies-layer/geographies-layer-builder.d.ts +0 -52
- package/lib/geographies/config/layers/geographies-layer/geographies-layer.d.ts +0 -29
- package/lib/geographies/config/layers/geojson-properties-layer/geojson-properties-layer-builder.d.ts +0 -25
- package/lib/geographies/config/layers/geojson-properties-layer/geojson-properties-layer-options.d.ts +0 -11
- package/lib/geographies/config/layers/geojson-properties-layer/geojson-properties-layer.d.ts +0 -16
- package/lib/geographies/config/layers/labels/geographies-labels-builder.d.ts +0 -97
- package/lib/geographies/config/layers/labels/geographies-labels-options.d.ts +0 -33
- package/lib/geographies/config/layers/labels/geographies-labels.d.ts +0 -20
- package/lib/geographies/events/actions/geographies-click-actions.d.ts +0 -7
- package/lib/geographies/events/actions/geographies-hover-actions.d.ts +0 -7
- package/lib/geographies/events/actions/geographies-hover-move-actions.d.ts +0 -7
- package/lib/geographies/events/geographies-events.directive.d.ts +0 -38
- package/lib/geographies/events/geographies-interaction-output.d.ts +0 -16
- package/lib/geographies/events/geographies-tooltip-positioner.d.ts +0 -13
- package/lib/geographies/geographies-feature.d.ts +0 -5
- package/lib/geographies/geographies.component.d.ts +0 -36
- package/lib/geographies/geographies.module.d.ts +0 -8
- package/lib/grouped-bars/config/grouped-bars-builder.d.ts +0 -29
- package/lib/grouped-bars/config/grouped-bars-config.d.ts +0 -10
- package/lib/grouped-bars/config/grouped-bars-options.d.ts +0 -5
- package/lib/grouped-bars/events/grouped-bars-events.directive.d.ts +0 -35
- package/lib/grouped-bars/grouped-bars.component.d.ts +0 -19
- package/lib/grouped-bars/grouped-bars.module.d.ts +0 -8
- package/lib/image-download/image-download-config.d.ts +0 -31
- package/lib/image-download/image-download-enums.d.ts +0 -6
- package/lib/image-download/image-download-options.d.ts +0 -14
- package/lib/image-download/image-download.service.d.ts +0 -16
- package/lib/lines/config/area-fills/area-fills-builder.d.ts +0 -45
- package/lib/lines/config/area-fills/area-fills-options.d.ts +0 -7
- package/lib/lines/config/area-fills/area-fills.d.ts +0 -9
- package/lib/lines/config/lines-builder.d.ts +0 -101
- package/lib/lines/config/lines-config.d.ts +0 -37
- package/lib/lines/config/stroke/lines-stroke-builder.d.ts +0 -59
- package/lib/lines/config/stroke/lines-stroke.d.ts +0 -7
- package/lib/lines/events/actions/lines-click-actions.d.ts +0 -6
- package/lib/lines/events/actions/lines-hover-move-actions.d.ts +0 -41
- package/lib/lines/events/actions/lines-marker-click-actions.d.ts +0 -6
- package/lib/lines/events/lines-events.directive.d.ts +0 -49
- package/lib/lines/events/lines-interaction-output.d.ts +0 -16
- package/lib/lines/events/lines-tooltip-positioner.d.ts +0 -13
- package/lib/lines/lines.component.d.ts +0 -53
- package/lib/lines/lines.module.d.ts +0 -8
- package/lib/map-legend/continuous-legend/continuous-legend.component.d.ts +0 -18
- package/lib/map-legend/discontinuous-legend/discontinuous-legend.component.d.ts +0 -12
- package/lib/map-legend/map-legend-base.d.ts +0 -33
- package/lib/map-legend/map-legend.component.d.ts +0 -27
- package/lib/map-legend/map-legend.module.d.ts +0 -7
- package/lib/marks/aux-marks/aux-marks.d.ts +0 -10
- package/lib/marks/aux-marks/config/aux-marks-builder.d.ts +0 -11
- package/lib/marks/config/marks-config.d.ts +0 -9
- package/lib/marks/config/marks-options.d.ts +0 -8
- package/lib/marks/map-marks/map-aux-marks/map-aux-marks.d.ts +0 -17
- package/lib/marks/map-marks/map-primary-marks/map-primary-marks.d.ts +0 -20
- package/lib/marks/marks.d.ts +0 -31
- package/lib/marks/primary-marks/config/primary-marks-builder.d.ts +0 -32
- package/lib/marks/primary-marks/config/primary-marks-config.d.ts +0 -5
- package/lib/marks/primary-marks/primary-marks.d.ts +0 -23
- package/lib/marks/xy-marks/xy-aux-marks/xy-aux-marks.d.ts +0 -16
- package/lib/marks/xy-marks/xy-marks-config.d.ts +0 -4
- package/lib/marks/xy-marks/xy-marks.d.ts +0 -6
- package/lib/marks/xy-marks/xy-primary-marks/xy-primary-marks-config.d.ts +0 -4
- package/lib/marks/xy-marks/xy-primary-marks/xy-primary-marks.d.ts +0 -20
- package/lib/point-markers/point-markers-builder.d.ts +0 -47
- package/lib/point-markers/point-markers-options.d.ts +0 -6
- package/lib/point-markers/point-markers.d.ts +0 -8
- package/lib/quantitative-rules/config/labels/quantitative-rules-labels-builder.d.ts +0 -60
- package/lib/quantitative-rules/config/labels/quantitative-rules-labels-options.d.ts +0 -9
- package/lib/quantitative-rules/config/labels/quantitative-rules-labels.d.ts +0 -11
- package/lib/quantitative-rules/config/quantitative-rules-builder.d.ts +0 -52
- package/lib/quantitative-rules/config/quantitative-rules-config.d.ts +0 -12
- package/lib/quantitative-rules/config/quantitative-rules-dimensions.d.ts +0 -8
- package/lib/quantitative-rules/quantitative-rules.component.d.ts +0 -27
- package/lib/quantitative-rules/quantitative-rules.module.d.ts +0 -7
- package/lib/stacked-area/config/stacked-area-builder.d.ts +0 -85
- package/lib/stacked-area/config/stacked-area-config.d.ts +0 -36
- package/lib/stacked-area/config/stacked-area-options.d.ts +0 -21
- package/lib/stacked-area/events/actions/stacked-area-hover-move-actions.d.ts +0 -7
- package/lib/stacked-area/events/stacked-area-events.directive.d.ts +0 -38
- package/lib/stacked-area/events/stacked-area-interaction-output.d.ts +0 -28
- package/lib/stacked-area/events/stacked-area-tooltip-positioner.d.ts +0 -16
- package/lib/stacked-area/stacked-area.component.d.ts +0 -51
- package/lib/stacked-area/stacked-area.module.d.ts +0 -8
- package/lib/stacked-bars/config/stacked-bars-builder.d.ts +0 -26
- package/lib/stacked-bars/config/stacked-bars-config.d.ts +0 -16
- package/lib/stacked-bars/config/stacked-bars-options.d.ts +0 -7
- package/lib/stacked-bars/events/actions/stacked-bars-click-actions.d.ts +0 -8
- package/lib/stacked-bars/events/actions/stacked-bars-hover-actions.d.ts +0 -8
- package/lib/stacked-bars/events/actions/stacked-bars-hover-move-actions.d.ts +0 -8
- package/lib/stacked-bars/events/stacked-bars-events.directive.d.ts +0 -39
- package/lib/stacked-bars/stacked-bars.component.d.ts +0 -26
- package/lib/stacked-bars/stacked-bars.module.d.ts +0 -8
- package/lib/stroke/base/stroke-base-options.d.ts +0 -7
- package/lib/stroke/base/stroke-base.d.ts +0 -8
- package/lib/stroke/index.d.ts +0 -2
- package/lib/stroke/stroke-builder.d.ts +0 -56
- package/lib/stroke/stroke.d.ts +0 -6
- package/lib/svg-text-wrap/svg-text-wrap-builder.d.ts +0 -58
- package/lib/svg-text-wrap/svg-text-wrap-options.d.ts +0 -8
- package/lib/svg-text-wrap/svg-text-wrap.d.ts +0 -13
- package/lib/tooltips/config/tooltip.d.ts +0 -5
- package/lib/tooltips/html-tooltip/config/html-tooltip-builder.d.ts +0 -57
- package/lib/tooltips/html-tooltip/config/html-tooltip-config.d.ts +0 -15
- package/lib/tooltips/html-tooltip/config/position/tooltip-position-builder.d.ts +0 -34
- package/lib/tooltips/html-tooltip/config/position/tooltip-position.d.ts +0 -23
- package/lib/tooltips/html-tooltip/config/size/tooltip-size-builder.d.ts +0 -16
- package/lib/tooltips/html-tooltip/config/size/tooltip-size-options.d.ts +0 -8
- package/lib/tooltips/html-tooltip/config/size/tooltip-size.d.ts +0 -10
- package/lib/tooltips/html-tooltip/html-tooltip.directive.d.ts +0 -43
- package/lib/tooltips/html-tooltip/html-tooltip.module.d.ts +0 -10
- package/lib/tooltips/html-tooltip/tooltip-triangle/tooltip-triangle.component.d.ts +0 -7
- package/lib/xy-background/xy-background.component.d.ts +0 -9
- package/lib/xy-background/xy-background.module.d.ts +0 -7
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { safeAssign } from '@mathstack/app-kit';
|
|
2
|
+
import { TickWrapOptions } from './tick-wrap-options';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* A config that specifies how axis tick labels should wrap.
|
|
6
|
+
*/
|
|
7
|
+
export class TickWrap {
|
|
8
|
+
maintainXPosition: boolean;
|
|
9
|
+
maintainYPosition: boolean;
|
|
10
|
+
lineHeight: number;
|
|
11
|
+
breakOnChars: string[];
|
|
12
|
+
spaceAroundBreakChars: boolean;
|
|
13
|
+
width:
|
|
14
|
+
| 'bandwidth'
|
|
15
|
+
| number
|
|
16
|
+
| ((chartWidth: number, numOfTicks: number) => number);
|
|
17
|
+
|
|
18
|
+
constructor(options: TickWrapOptions) {
|
|
19
|
+
safeAssign(this, options);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
import { safeAssign } from '@mathstack/app-kit';
|
|
2
|
+
import { AxisTimeInterval } from 'd3';
|
|
3
|
+
import { TickWrapBuilder } from './tick-wrap/tick-wrap-builder';
|
|
4
|
+
import { QuantitativeTicks, Ticks } from './ticks';
|
|
5
|
+
|
|
6
|
+
export interface AxisSpecificTickBuilderOptions {
|
|
7
|
+
_sizeOuter: number;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface AxisSpecificQuantitativeTickBuilderOptions<
|
|
11
|
+
Tick,
|
|
12
|
+
> extends AxisSpecificTickBuilderOptions {
|
|
13
|
+
_format: string | ((value: Tick) => string);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const DEFAULT = {
|
|
17
|
+
_class: () => '',
|
|
18
|
+
_labelsDisplay: true,
|
|
19
|
+
_marksDisplay: true,
|
|
20
|
+
_remove: false,
|
|
21
|
+
_stroke: 'none',
|
|
22
|
+
_strokeOpacity: 1,
|
|
23
|
+
_strokeWidth: 3,
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const QUANT_DEFAULT = {
|
|
27
|
+
_spacing: 40,
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export class TicksBuilder<Tick> {
|
|
31
|
+
protected _class: (d: Tick) => string;
|
|
32
|
+
protected _fontSize: number;
|
|
33
|
+
protected _format: string | ((value: Tick) => string);
|
|
34
|
+
protected _labelsDisplay: boolean;
|
|
35
|
+
protected _rotate: number;
|
|
36
|
+
protected _labelsStroke: string;
|
|
37
|
+
protected _labelsStrokeOpacity: number;
|
|
38
|
+
protected _labelsStrokeWidth: number;
|
|
39
|
+
protected _marksDisplay: boolean;
|
|
40
|
+
protected _size: number;
|
|
41
|
+
protected _sizeInner: number;
|
|
42
|
+
protected _sizeOuter: number;
|
|
43
|
+
protected wrapBuilder: TickWrapBuilder;
|
|
44
|
+
|
|
45
|
+
constructor(options: Partial<AxisSpecificTickBuilderOptions>) {
|
|
46
|
+
safeAssign(this, DEFAULT);
|
|
47
|
+
safeAssign(this, options);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* OPTIONAL. Provides a class on the SVG G element that corresponds to a single tick.
|
|
52
|
+
*
|
|
53
|
+
* 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'.
|
|
54
|
+
*/
|
|
55
|
+
class(value: null): this;
|
|
56
|
+
class(value: string): this;
|
|
57
|
+
class(value: (d: Tick) => string): this;
|
|
58
|
+
class(value: ((d: Tick) => string) | string | null): this {
|
|
59
|
+
if (value === null) {
|
|
60
|
+
this._class = DEFAULT._class;
|
|
61
|
+
return this;
|
|
62
|
+
}
|
|
63
|
+
if (typeof value === 'string') {
|
|
64
|
+
this._class = () => value;
|
|
65
|
+
return this;
|
|
66
|
+
}
|
|
67
|
+
this._class = value;
|
|
68
|
+
return this;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* OPTIONAL. Sets the font size of the tick labels.
|
|
73
|
+
*
|
|
74
|
+
* @param value - The font size of the tick labels, in px.
|
|
75
|
+
*
|
|
76
|
+
* If not called, the default font size is D3's default, which is 10px.
|
|
77
|
+
*/
|
|
78
|
+
fontSize(value: number | null): this {
|
|
79
|
+
if (value === null) {
|
|
80
|
+
this._fontSize = undefined;
|
|
81
|
+
return this;
|
|
82
|
+
}
|
|
83
|
+
this._fontSize = value;
|
|
84
|
+
return this;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* OPTIONAL. Specifies how tick labels will be formatted. The format can be a string or a function.
|
|
89
|
+
*
|
|
90
|
+
* @param value - Either a D3 format string, a function that takes a value and returns a string, or `null` to unset the format.
|
|
91
|
+
*
|
|
92
|
+
* If not called, the default value for quantitative axes is ',.1f'. If not called for an ordinal axis, tick labels will be the unformatted ordinal value.
|
|
93
|
+
*/
|
|
94
|
+
format(format: string): this;
|
|
95
|
+
format(format: (value: Tick) => string): this;
|
|
96
|
+
format(format: null): this;
|
|
97
|
+
format(format: string | ((value: Tick) => string) | null): this {
|
|
98
|
+
if (format === null) {
|
|
99
|
+
this._format = undefined;
|
|
100
|
+
return this;
|
|
101
|
+
}
|
|
102
|
+
this._format = format;
|
|
103
|
+
return this;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* OPTIONAL. If false, tick labels will be removed.
|
|
108
|
+
*
|
|
109
|
+
* @param value - `true` to retain all tick labels, `false` to remove all tick labels.
|
|
110
|
+
*
|
|
111
|
+
* If not called, the default value is `true`.
|
|
112
|
+
*/
|
|
113
|
+
labelsDisplay(value: boolean): this {
|
|
114
|
+
this._labelsDisplay = value;
|
|
115
|
+
return this;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* OPTIONAL. Sets the color of the stroke around the tick labels. Often used to improve the legibility of tick labels, for example, on dark backgrounds.
|
|
120
|
+
*
|
|
121
|
+
* @param value - The stroke of the tick labels.
|
|
122
|
+
*
|
|
123
|
+
* If not called, the default value is 'none'.
|
|
124
|
+
*/
|
|
125
|
+
labelsStroke(value: string | null): this {
|
|
126
|
+
if (value === null) {
|
|
127
|
+
this._labelsStroke = DEFAULT._stroke;
|
|
128
|
+
return this;
|
|
129
|
+
}
|
|
130
|
+
this._labelsStroke = value;
|
|
131
|
+
return this;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* OPTIONAL. Sets the opacity of the stroke applied around the tick labels.
|
|
136
|
+
*
|
|
137
|
+
* @param value - The opacity of the stroke around the tick labels.
|
|
138
|
+
*
|
|
139
|
+
* If not called, the default value is 1.
|
|
140
|
+
*/
|
|
141
|
+
labelsStrokeOpacity(value: number | null): this {
|
|
142
|
+
if (value === null) {
|
|
143
|
+
this._labelsStrokeOpacity = undefined;
|
|
144
|
+
return this;
|
|
145
|
+
}
|
|
146
|
+
this._labelsStrokeOpacity = value;
|
|
147
|
+
return this;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* OPTIONAL. Sets the width of the stroke around the tick labels. Often used to improve the legibility of tick labels, for example, on dark backgrounds.
|
|
152
|
+
*
|
|
153
|
+
* @param value - The width of the stroke around the tick labels.
|
|
154
|
+
*
|
|
155
|
+
* If not called, the default value is 3.
|
|
156
|
+
*/
|
|
157
|
+
labelsStrokeWidth(value: number | null): this {
|
|
158
|
+
if (value === null) {
|
|
159
|
+
this._labelsStrokeWidth = undefined;
|
|
160
|
+
return this;
|
|
161
|
+
}
|
|
162
|
+
this._labelsStrokeWidth = value;
|
|
163
|
+
return this;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* OPTIONAL. If false, tick marks (lines) will be removed.
|
|
168
|
+
*
|
|
169
|
+
* @param value - `true` to retain all tick marks, `false` to remove all tick marks.
|
|
170
|
+
*
|
|
171
|
+
* If not called, the default value is `true`.
|
|
172
|
+
*/
|
|
173
|
+
marksDisplay(value: boolean): this {
|
|
174
|
+
this._marksDisplay = value;
|
|
175
|
+
return this;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* OPTIONAL. Determines the rotation of tick labels.
|
|
180
|
+
*
|
|
181
|
+
* @param value - The rotation of the tick labels in degrees, or `null` to unset the rotation.
|
|
182
|
+
*
|
|
183
|
+
* Positive values rotate clockwise, negative values rotate counterclockwise.
|
|
184
|
+
*
|
|
185
|
+
* If not called, ticks will not be rotated.
|
|
186
|
+
*/
|
|
187
|
+
|
|
188
|
+
rotate(value: number | null): this {
|
|
189
|
+
if (value === null) {
|
|
190
|
+
this._rotate = undefined;
|
|
191
|
+
return this;
|
|
192
|
+
}
|
|
193
|
+
this._rotate = value;
|
|
194
|
+
return this;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* OPTIONAL. Sets the size of inner and outer tick marks.
|
|
199
|
+
*
|
|
200
|
+
* @param value - The size of the ticks, in px.
|
|
201
|
+
*
|
|
202
|
+
* If not called or called with `null`, the default size is the D3 default size.
|
|
203
|
+
*
|
|
204
|
+
* If specified, this value will override any values set by `sizeInner` or `sizeOuter`.
|
|
205
|
+
*/
|
|
206
|
+
size(value: number | null): this {
|
|
207
|
+
if (value === null) {
|
|
208
|
+
this._size = undefined;
|
|
209
|
+
return this;
|
|
210
|
+
}
|
|
211
|
+
this._size = value;
|
|
212
|
+
return this;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* OPTIONAL. Determines the length of the inner ticks drawn by D3. Does not apply to the outermost ticks.
|
|
217
|
+
*
|
|
218
|
+
* @param value - The length of the inner ticks in pixels, or `null` to unset the value.
|
|
219
|
+
*
|
|
220
|
+
* If not called or called with `null`, the default value is the D3 default size.
|
|
221
|
+
*
|
|
222
|
+
*/
|
|
223
|
+
sizeInner(value: number | null): this {
|
|
224
|
+
if (value === null) {
|
|
225
|
+
this._sizeInner = undefined;
|
|
226
|
+
return this;
|
|
227
|
+
}
|
|
228
|
+
this._sizeInner = value;
|
|
229
|
+
return this;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* OPTIONAL. Determines the length of the square ends of the domain path drawn by D3.
|
|
234
|
+
*
|
|
235
|
+
* @param value - The length of the square ends of the domain path in pixels, or `null` to unset the value.
|
|
236
|
+
*
|
|
237
|
+
* If not called on ordinal axes, the default value is 0. If not called on quantitative axes, no modification is made to D3's default value.
|
|
238
|
+
*/
|
|
239
|
+
sizeOuter(value: number | null): this {
|
|
240
|
+
if (value === null) {
|
|
241
|
+
this._sizeOuter = undefined;
|
|
242
|
+
return this;
|
|
243
|
+
}
|
|
244
|
+
this._sizeOuter = value;
|
|
245
|
+
return this;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* OPTIONAL. Specifies how tick labels will be wrapped.
|
|
250
|
+
*
|
|
251
|
+
* @param wrap - A callback that specifies how tick labels will be wrapped, or `null` to unset the wrapping.
|
|
252
|
+
*
|
|
253
|
+
* If not called, the tick labels will not be wrapped.
|
|
254
|
+
*/
|
|
255
|
+
wrap(wrap: (wrap: TickWrapBuilder) => void): this;
|
|
256
|
+
wrap(wrap: null): this;
|
|
257
|
+
wrap(wrap: (wrap: TickWrapBuilder) => void | null): this {
|
|
258
|
+
if (wrap === null) {
|
|
259
|
+
this.wrapBuilder = undefined;
|
|
260
|
+
return this;
|
|
261
|
+
}
|
|
262
|
+
this.wrapBuilder = new TickWrapBuilder();
|
|
263
|
+
wrap(this.wrapBuilder);
|
|
264
|
+
return this;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
_build(dimension: 'x' | 'y'): Ticks<Tick> {
|
|
268
|
+
return new Ticks({
|
|
269
|
+
class: this._class,
|
|
270
|
+
fontSize: this._fontSize,
|
|
271
|
+
format: this._format,
|
|
272
|
+
labelsDisplay: this._labelsDisplay,
|
|
273
|
+
labelsStroke: this._labelsStroke,
|
|
274
|
+
labelsStrokeOpacity: this._labelsStrokeOpacity,
|
|
275
|
+
labelsStrokeWidth: this._labelsStrokeWidth,
|
|
276
|
+
marksDisplay: this._marksDisplay,
|
|
277
|
+
rotate: this._rotate,
|
|
278
|
+
size: this._size,
|
|
279
|
+
sizeInner: this._sizeInner,
|
|
280
|
+
sizeOuter: this._sizeOuter,
|
|
281
|
+
wrap: this.wrapBuilder?._build(dimension),
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
export class QuantitativeTicksBuilder<Tick> extends TicksBuilder<Tick> {
|
|
287
|
+
private _count: number | AxisTimeInterval;
|
|
288
|
+
private _spacing: number;
|
|
289
|
+
private _values: Tick[];
|
|
290
|
+
|
|
291
|
+
constructor(
|
|
292
|
+
options: Partial<AxisSpecificQuantitativeTickBuilderOptions<Tick>>
|
|
293
|
+
) {
|
|
294
|
+
super(options);
|
|
295
|
+
safeAssign(this, DEFAULT);
|
|
296
|
+
safeAssign(this, QUANT_DEFAULT);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* OPTIONAL. Approximately specifies the number of ticks for the axis.
|
|
301
|
+
*
|
|
302
|
+
* @param value - The number of ticks to pass to D3's axis.ticks(), or null to unset the number of ticks.
|
|
303
|
+
*
|
|
304
|
+
* If not called, a reasonable and valid default will be used based on the size of the chart.
|
|
305
|
+
*
|
|
306
|
+
* Note that this number will be passed to D3's `ticks()` method and therefore it can be an approximate number of ticks.
|
|
307
|
+
*
|
|
308
|
+
* If this method is called, the passed in number of ticks will be validated against the data domain and the value formatter for the axis. If the number of ticks is not valid—for example, if the ticks are formatted with %Y and there are three years of values in the data, and this method is called with 10, a valid number will be used instead.
|
|
309
|
+
*/
|
|
310
|
+
count(value: number | AxisTimeInterval | null): this {
|
|
311
|
+
if (value === null) {
|
|
312
|
+
this._count = undefined;
|
|
313
|
+
return this;
|
|
314
|
+
}
|
|
315
|
+
this._count = value;
|
|
316
|
+
return this;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* OPTIONAL. Specifies the an approximate spacing between ticks, in pixels.
|
|
321
|
+
*
|
|
322
|
+
* @param value - The spacing between ticks in pixels, or null to unset the spacing.
|
|
323
|
+
*
|
|
324
|
+
* If not called, the default value is 40. If `count` is set, this value will be ignored.
|
|
325
|
+
*/
|
|
326
|
+
spacing(value: number | null): this {
|
|
327
|
+
if (value === null) {
|
|
328
|
+
this._spacing = undefined;
|
|
329
|
+
return this;
|
|
330
|
+
}
|
|
331
|
+
this._spacing = value;
|
|
332
|
+
return this;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* OPTIONAL. Determines the values that will show up as ticks on the axis.
|
|
337
|
+
*
|
|
338
|
+
* @param values - An array of quantitative values to pass to D3's axis.tickValues(), or null to unset the tick values.
|
|
339
|
+
*
|
|
340
|
+
*/
|
|
341
|
+
values(values: Tick[] | null): this {
|
|
342
|
+
if (values === null) {
|
|
343
|
+
this._values = undefined;
|
|
344
|
+
return this;
|
|
345
|
+
}
|
|
346
|
+
this._values = values;
|
|
347
|
+
return this;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
override _build(dimension: 'x' | 'y'): QuantitativeTicks<Tick> {
|
|
351
|
+
return new QuantitativeTicks({
|
|
352
|
+
class: this._class,
|
|
353
|
+
count: this._count,
|
|
354
|
+
fontSize: this._fontSize,
|
|
355
|
+
format: this._format,
|
|
356
|
+
labelsDisplay: this._labelsDisplay,
|
|
357
|
+
labelsStroke: this._labelsStroke,
|
|
358
|
+
labelsStrokeOpacity: this._labelsStrokeOpacity,
|
|
359
|
+
labelsStrokeWidth: this._labelsStrokeWidth,
|
|
360
|
+
marksDisplay: this._marksDisplay,
|
|
361
|
+
rotate: this._rotate,
|
|
362
|
+
size: this._size,
|
|
363
|
+
sizeInner: this._sizeInner,
|
|
364
|
+
sizeOuter: this._sizeOuter,
|
|
365
|
+
spacing: this._spacing,
|
|
366
|
+
values: this._values,
|
|
367
|
+
wrap: this.wrapBuilder?._build(dimension),
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { AxisTimeInterval } from 'd3';
|
|
2
|
+
import { TickWrap } from './tick-wrap/tick-wrap';
|
|
3
|
+
|
|
4
|
+
export interface TicksOptions<Tick> {
|
|
5
|
+
class: (d: Tick) => string;
|
|
6
|
+
fontSize: number;
|
|
7
|
+
format: string | ((value: Tick) => string);
|
|
8
|
+
labelsDisplay: boolean;
|
|
9
|
+
labelsStroke: string;
|
|
10
|
+
labelsStrokeOpacity: number;
|
|
11
|
+
labelsStrokeWidth: number;
|
|
12
|
+
marksDisplay: boolean;
|
|
13
|
+
rotate: number;
|
|
14
|
+
size: number;
|
|
15
|
+
sizeInner: number;
|
|
16
|
+
sizeOuter: number;
|
|
17
|
+
wrap: TickWrap;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface QuantitativeTicksOptions<Tick> extends TicksOptions<Tick> {
|
|
21
|
+
count: number | AxisTimeInterval;
|
|
22
|
+
spacing: number;
|
|
23
|
+
values: Tick[];
|
|
24
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { safeAssign } from '@mathstack/app-kit';
|
|
2
|
+
import { TickWrap } from './tick-wrap/tick-wrap';
|
|
3
|
+
import { QuantitativeTicksOptions, TicksOptions } from './ticks-options';
|
|
4
|
+
|
|
5
|
+
export class Ticks<Tick> implements TicksOptions<Tick> {
|
|
6
|
+
class: (d: Tick) => string;
|
|
7
|
+
fontSize: number;
|
|
8
|
+
format: string | ((value: Tick) => string);
|
|
9
|
+
labelsDisplay: boolean;
|
|
10
|
+
labelsStroke: string;
|
|
11
|
+
labelsStrokeOpacity: number;
|
|
12
|
+
labelsStrokeWidth: number;
|
|
13
|
+
marksDisplay: boolean;
|
|
14
|
+
rotate: number;
|
|
15
|
+
size: number;
|
|
16
|
+
sizeInner: number;
|
|
17
|
+
sizeOuter: number;
|
|
18
|
+
wrap: TickWrap;
|
|
19
|
+
|
|
20
|
+
constructor(options: TicksOptions<Tick>) {
|
|
21
|
+
safeAssign(this, options);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export class QuantitativeTicks<Tick> extends Ticks<Tick> {
|
|
26
|
+
count: number;
|
|
27
|
+
spacing: number;
|
|
28
|
+
values: Tick[];
|
|
29
|
+
|
|
30
|
+
constructor(options: QuantitativeTicksOptions<Tick>) {
|
|
31
|
+
super(options);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { safeAssign } from '@mathstack/app-kit';
|
|
2
|
+
import { DataValue } from '../../core';
|
|
3
|
+
import { AbstractConstructor } from '../../core/common-behaviors/constructor';
|
|
4
|
+
import { XyAxisConfig } from '../base/config/xy-axis-config';
|
|
5
|
+
import { XyAxisBaseOptions } from '../base/config/xy-axis-options';
|
|
6
|
+
import { Ticks } from '../ticks/ticks';
|
|
7
|
+
|
|
8
|
+
export interface XAxisOptions extends XyAxisBaseOptions {
|
|
9
|
+
/**
|
|
10
|
+
* The side of the chart on which the axis will be placed.
|
|
11
|
+
*/
|
|
12
|
+
side: 'top' | 'bottom';
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function mixinXAxisConfig<
|
|
16
|
+
Tick extends DataValue,
|
|
17
|
+
TicksConfig extends Ticks<Tick>,
|
|
18
|
+
T extends AbstractConstructor<XyAxisConfig<Tick, TicksConfig>>,
|
|
19
|
+
>(Base: T) {
|
|
20
|
+
abstract class Mixin extends Base {
|
|
21
|
+
side: 'top' | 'bottom';
|
|
22
|
+
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
24
|
+
constructor(...args: any[]) {
|
|
25
|
+
super(...args);
|
|
26
|
+
if (args.length > 0) {
|
|
27
|
+
safeAssign(this, args[0]);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
getNumTicksBySpacing(
|
|
32
|
+
spacing: number,
|
|
33
|
+
dimensions: {
|
|
34
|
+
height: number;
|
|
35
|
+
width: number;
|
|
36
|
+
}
|
|
37
|
+
): number {
|
|
38
|
+
const d3SuggestedDefault = dimensions.width / spacing;
|
|
39
|
+
return this.getValidatedNumTicks(d3SuggestedDefault);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return Mixin;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export class XAxisConfig<
|
|
46
|
+
Tick extends DataValue,
|
|
47
|
+
TicksConfig extends Ticks<Tick>,
|
|
48
|
+
> extends mixinXAxisConfig(XyAxisConfig)<Tick, TicksConfig> {}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import { ElementRef } from '@angular/core';
|
|
3
|
+
import { TestBed } from '@angular/core/testing';
|
|
4
|
+
import { XyChartComponent } from '@mathstack/viz';
|
|
5
|
+
import { axisBottom, axisTop } from 'd3';
|
|
6
|
+
import { XAxisStub } from '../../testing/stubs/x-axis.stub';
|
|
7
|
+
import { VicXQuantitativeAxisConfigBuilder } from '../x-quantitative/x-quantitative-axis-builder';
|
|
8
|
+
|
|
9
|
+
describe('the XAxis mixin', () => {
|
|
10
|
+
let abstractClass: XAxisStub<number>;
|
|
11
|
+
const mockElementRef = {
|
|
12
|
+
nativeElement: {
|
|
13
|
+
querySelector: jasmine.createSpy('querySelector'),
|
|
14
|
+
style: {},
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
beforeEach(() => {
|
|
19
|
+
TestBed.configureTestingModule({
|
|
20
|
+
providers: [
|
|
21
|
+
XAxisStub,
|
|
22
|
+
XyChartComponent,
|
|
23
|
+
{ provide: ElementRef, useValue: mockElementRef },
|
|
24
|
+
],
|
|
25
|
+
});
|
|
26
|
+
abstractClass = TestBed.inject(XAxisStub);
|
|
27
|
+
abstractClass.scales = {
|
|
28
|
+
y: {
|
|
29
|
+
range: jasmine.createSpy().and.returnValue([100, 20]),
|
|
30
|
+
},
|
|
31
|
+
x: 'scale',
|
|
32
|
+
} as any;
|
|
33
|
+
abstractClass.chart.config = {
|
|
34
|
+
margin: { top: 10 },
|
|
35
|
+
} as any;
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
describe('setTranslate()', () => {
|
|
39
|
+
beforeEach(() => {
|
|
40
|
+
spyOn(abstractClass, 'getTranslateDistance').and.returnValue(90);
|
|
41
|
+
abstractClass.setTranslate();
|
|
42
|
+
});
|
|
43
|
+
it('calls getTranslateDistance once', () => {
|
|
44
|
+
expect(abstractClass.getTranslateDistance).toHaveBeenCalledTimes(1);
|
|
45
|
+
});
|
|
46
|
+
it('returns the correct string', () => {
|
|
47
|
+
expect(abstractClass.translate).toEqual('translate(0, 90)');
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
describe('integration: getTranslateDistance', () => {
|
|
52
|
+
it('returns the correct value for the top side', () => {
|
|
53
|
+
abstractClass.config = new VicXQuantitativeAxisConfigBuilder()
|
|
54
|
+
.side('top')
|
|
55
|
+
.getConfig() as any;
|
|
56
|
+
expect(abstractClass.getTranslateDistance()).toBe(20);
|
|
57
|
+
});
|
|
58
|
+
it('returns the correct value for the bottom side', () => {
|
|
59
|
+
abstractClass.config = new VicXQuantitativeAxisConfigBuilder()
|
|
60
|
+
.side('bottom')
|
|
61
|
+
.getConfig() as any;
|
|
62
|
+
expect(abstractClass.getTranslateDistance()).toBe(100);
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
describe('setScale', () => {
|
|
67
|
+
it('sets scale to the correct value', () => {
|
|
68
|
+
abstractClass.setScale();
|
|
69
|
+
expect(abstractClass.scale).toBe('scale');
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
describe('setAxisFunction', () => {
|
|
74
|
+
it('sets the axis function to the correct value if side is top', () => {
|
|
75
|
+
abstractClass.config = new VicXQuantitativeAxisConfigBuilder()
|
|
76
|
+
.side('top')
|
|
77
|
+
.getConfig() as any;
|
|
78
|
+
abstractClass.setAxisFunction();
|
|
79
|
+
expect(abstractClass.axisFunction).toEqual(axisTop);
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
it('sets the axis function to the correct value if side is bottom', () => {
|
|
83
|
+
abstractClass.config = new VicXQuantitativeAxisConfigBuilder()
|
|
84
|
+
.side('bottom')
|
|
85
|
+
.getConfig() as any;
|
|
86
|
+
abstractClass.setAxisFunction();
|
|
87
|
+
expect(abstractClass.axisFunction).toEqual(axisBottom);
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
});
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { axisBottom, axisTop } from 'd3';
|
|
2
|
+
import { AbstractConstructor } from '../../core/common-behaviors/constructor';
|
|
3
|
+
import { ContinuousValue, DataValue } from '../../core/types/values';
|
|
4
|
+
import { XyAxis } from '../base/xy-axis-base';
|
|
5
|
+
import { Ticks } from '../ticks/ticks';
|
|
6
|
+
import { XAxisConfig } from './x-axis-config';
|
|
7
|
+
|
|
8
|
+
export function xAxisMixin<
|
|
9
|
+
Tick extends DataValue | ContinuousValue,
|
|
10
|
+
TicksConfig extends Ticks<Tick>,
|
|
11
|
+
T extends AbstractConstructor<XyAxis<Tick, TicksConfig>>,
|
|
12
|
+
>(Base: T) {
|
|
13
|
+
abstract class Mixin extends Base {
|
|
14
|
+
override config: XAxisConfig<Tick, TicksConfig>;
|
|
15
|
+
translate: string;
|
|
16
|
+
|
|
17
|
+
setTranslate(): void {
|
|
18
|
+
const translate = this.getTranslateDistance();
|
|
19
|
+
this.translate = `translate(0, ${translate})`;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
getTranslateDistance(): number {
|
|
23
|
+
return this.config.side === 'top'
|
|
24
|
+
? this.getTopTranslate()
|
|
25
|
+
: this.getBottomTranslate();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
getTopTranslate(): number {
|
|
29
|
+
return this.scales.y.range()[1];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
getBottomTranslate(): number {
|
|
33
|
+
return this.scales.y.range()[0];
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
getBaselineTranslate(): string | null {
|
|
37
|
+
if (!this.otherAxisHasPosAndNegValues('x')) return null;
|
|
38
|
+
|
|
39
|
+
const rangeIndexForSide = this.config.side === 'top' ? 1 : 0;
|
|
40
|
+
const translateDistance =
|
|
41
|
+
this.scales.y(0) - this.scales.y.range()[rangeIndexForSide];
|
|
42
|
+
return `translate(0, ${translateDistance})`;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
setScale(): void {
|
|
46
|
+
this.scale = this.scales.x;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
setAxisFunction(): void {
|
|
50
|
+
this.axisFunction = this.config.side === 'top' ? axisTop : axisBottom;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
createLabel(): void {
|
|
54
|
+
const config = this.config.label;
|
|
55
|
+
if (!config) return;
|
|
56
|
+
|
|
57
|
+
const spaceFromMarginEdge = 4;
|
|
58
|
+
let x = config.offset.x || 0;
|
|
59
|
+
let y = config.offset.y || 0;
|
|
60
|
+
|
|
61
|
+
y +=
|
|
62
|
+
this.config.side === 'top'
|
|
63
|
+
? this.chart.config.margin.top * -1 + spaceFromMarginEdge
|
|
64
|
+
: this.chart.config.margin.bottom - spaceFromMarginEdge;
|
|
65
|
+
|
|
66
|
+
let anchor: 'start' | 'middle' | 'end';
|
|
67
|
+
const range = this.scales.x.range();
|
|
68
|
+
|
|
69
|
+
if (config.position === 'start') {
|
|
70
|
+
x += range[0];
|
|
71
|
+
anchor = config.anchor || 'start';
|
|
72
|
+
} else if (config.position === 'middle') {
|
|
73
|
+
x += (range[1] - range[0]) / 2 + range[0];
|
|
74
|
+
anchor = config.anchor || 'middle';
|
|
75
|
+
} else {
|
|
76
|
+
x += range[1];
|
|
77
|
+
anchor = config.anchor || 'end';
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
let label = this.axisGroup.select<SVGTextElement>(`.${this.class.label}`);
|
|
81
|
+
const needsInit = label.empty();
|
|
82
|
+
|
|
83
|
+
if (needsInit) {
|
|
84
|
+
label = this.axisGroup
|
|
85
|
+
.append<SVGTextElement>('text')
|
|
86
|
+
.attr('class', this.class.label);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
label
|
|
90
|
+
.text(this.config.label.text)
|
|
91
|
+
.attr('text-anchor', anchor)
|
|
92
|
+
.attr('y', y)
|
|
93
|
+
.style('visibility', config.wrap ? 'hidden' : 'visible');
|
|
94
|
+
|
|
95
|
+
if (config.wrap) {
|
|
96
|
+
requestAnimationFrame(() => {
|
|
97
|
+
this.config.label.wrap.wrap(label);
|
|
98
|
+
label.attr('x', x).style('visibility', 'visible');
|
|
99
|
+
|
|
100
|
+
label.selectAll('tspan').attr('x', x);
|
|
101
|
+
});
|
|
102
|
+
} else {
|
|
103
|
+
label.attr('x', x);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
return Mixin;
|
|
109
|
+
}
|