@unovis/ts 1.6.0-pre.1 → 1.6.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/components/area/index.js +2 -1
- package/components/area/index.js.map +1 -1
- package/components/axis/config.d.ts +4 -0
- package/components/axis/config.js +2 -2
- package/components/axis/config.js.map +1 -1
- package/components/axis/index.d.ts +0 -1
- package/components/axis/index.js +51 -19
- package/components/axis/index.js.map +1 -1
- package/components/axis/style.d.ts +40 -1
- package/components/axis/style.js +34 -35
- package/components/axis/style.js.map +1 -1
- package/components/brush/config.d.ts +1 -1
- package/components/brush/config.js.map +1 -1
- package/components/bullet-legend/config.d.ts +2 -0
- package/components/bullet-legend/config.js +1 -0
- package/components/bullet-legend/config.js.map +1 -1
- package/components/bullet-legend/index.js +10 -2
- package/components/bullet-legend/index.js.map +1 -1
- package/components/bullet-legend/modules/shape.d.ts +1 -0
- package/components/bullet-legend/modules/shape.js +61 -41
- package/components/bullet-legend/modules/shape.js.map +1 -1
- package/components/bullet-legend/types.d.ts +1 -1
- package/components/bullet-legend/types.js.map +1 -1
- package/components/crosshair/config.d.ts +20 -7
- package/components/crosshair/config.js +1 -1
- package/components/crosshair/config.js.map +1 -1
- package/components/crosshair/index.d.ts +8 -7
- package/components/crosshair/index.js +144 -72
- package/components/crosshair/index.js.map +1 -1
- package/components/graph/config.d.ts +8 -0
- package/components/graph/config.js +1 -1
- package/components/graph/config.js.map +1 -1
- package/components/graph/index.d.ts +1 -0
- package/components/graph/index.js +14 -9
- package/components/graph/index.js.map +1 -1
- package/components/graph/modules/layout.js +33 -31
- package/components/graph/modules/layout.js.map +1 -1
- package/components/graph/modules/link/index.js +1 -1
- package/components/graph/modules/link/index.js.map +1 -1
- package/components/graph/types.d.ts +2 -1
- package/components/graph/types.js.map +1 -1
- package/components/nested-donut/config.d.ts +1 -1
- package/components/nested-donut/config.js.map +1 -1
- package/components/plotband/config.d.ts +59 -0
- package/components/plotband/config.js +9 -0
- package/components/plotband/config.js.map +1 -0
- package/components/plotband/constants.d.ts +5 -0
- package/components/plotband/constants.js +413 -0
- package/components/plotband/constants.js.map +1 -0
- package/components/plotband/index.d.ts +15 -0
- package/components/plotband/index.js +92 -0
- package/components/plotband/index.js.map +1 -0
- package/components/plotband/style.d.ts +4 -0
- package/components/plotband/style.js +38 -0
- package/components/plotband/style.js.map +1 -0
- package/components/plotband/types.d.ts +51 -0
- package/components/plotband/types.js +27 -0
- package/components/plotband/types.js.map +1 -0
- package/components/plotline/config.d.ts +91 -0
- package/components/plotline/config.js +9 -0
- package/components/plotline/config.js.map +1 -0
- package/components/plotline/constants.d.ts +6 -0
- package/components/plotline/constants.js +58 -0
- package/components/plotline/constants.js.map +1 -0
- package/components/plotline/index.d.ts +14 -0
- package/components/plotline/index.js +102 -0
- package/components/plotline/index.js.map +1 -0
- package/components/plotline/style.d.ts +4 -0
- package/components/plotline/style.js +42 -0
- package/components/plotline/style.js.map +1 -0
- package/components/plotline/types.d.ts +53 -0
- package/components/plotline/types.js +33 -0
- package/components/plotline/types.js.map +1 -0
- package/components/rolling-pin-legend/config.d.ts +19 -0
- package/components/rolling-pin-legend/config.js +11 -0
- package/components/rolling-pin-legend/config.js.map +1 -0
- package/components/rolling-pin-legend/index.d.ts +16 -0
- package/components/rolling-pin-legend/index.js +69 -0
- package/components/rolling-pin-legend/index.js.map +1 -0
- package/components/rolling-pin-legend/style.d.ts +22 -0
- package/components/rolling-pin-legend/style.js +39 -0
- package/components/rolling-pin-legend/style.js.map +1 -0
- package/components/rolling-pin-legend/types.d.ts +1 -0
- package/components/rolling-pin-legend/types.js +2 -0
- package/components/rolling-pin-legend/types.js.map +1 -0
- package/components/scatter/index.d.ts +1 -0
- package/components/scatter/index.js +11 -1
- package/components/scatter/index.js.map +1 -1
- package/components/timeline/config.d.ts +65 -14
- package/components/timeline/config.js +15 -1
- package/components/timeline/config.js.map +1 -1
- package/components/timeline/constants.d.ts +3 -0
- package/components/timeline/constants.js +6 -0
- package/components/timeline/constants.js.map +1 -0
- package/components/timeline/index.d.ts +21 -10
- package/components/timeline/index.js +380 -95
- package/components/timeline/index.js.map +1 -1
- package/components/timeline/style.d.ts +7 -0
- package/components/timeline/style.js +40 -1
- package/components/timeline/style.js.map +1 -1
- package/components/timeline/types.d.ts +62 -0
- package/components/timeline/types.js +2 -0
- package/components/timeline/types.js.map +1 -0
- package/components/timeline/utils.d.ts +2 -0
- package/components/timeline/utils.js +16 -0
- package/components/timeline/utils.js.map +1 -0
- package/components/tooltip/index.js +4 -3
- package/components/tooltip/index.js.map +1 -1
- package/components/treemap/config.d.ts +52 -0
- package/components/treemap/config.js +6 -0
- package/components/treemap/config.js.map +1 -0
- package/components/treemap/index.d.ts +18 -0
- package/components/treemap/index.js +274 -0
- package/components/treemap/index.js.map +1 -0
- package/components/treemap/style.d.ts +25 -0
- package/components/treemap/style.js +69 -0
- package/components/treemap/style.js.map +1 -0
- package/components/treemap/types.d.ts +11 -0
- package/components/treemap/types.js +2 -0
- package/components/treemap/types.js.map +1 -0
- package/components/xy-labels/index.js +1 -1
- package/components/xy-labels/index.js.map +1 -1
- package/components.d.ts +10 -2
- package/components.js +4 -0
- package/components.js.map +1 -1
- package/containers/single-container/index.js +3 -1
- package/containers/single-container/index.js.map +1 -1
- package/containers/xy-container/config.d.ts +2 -0
- package/containers/xy-container/config.js +1 -1
- package/containers/xy-container/config.js.map +1 -1
- package/containers/xy-container/index.js +17 -7
- package/containers/xy-container/index.js.map +1 -1
- package/core/component/index.d.ts +4 -0
- package/core/component/index.js +6 -0
- package/core/component/index.js.map +1 -1
- package/core/xy-component/index.d.ts +1 -0
- package/core/xy-component/index.js +3 -1
- package/core/xy-component/index.js.map +1 -1
- package/data-models/graph.js +7 -1
- package/data-models/graph.js.map +1 -1
- package/index.js +10 -3
- package/index.js.map +1 -1
- package/package.json +2 -2
- package/styles/index.js +1 -0
- package/styles/index.js.map +1 -1
- package/types/data.d.ts +5 -0
- package/types/data.js +7 -0
- package/types/data.js.map +1 -1
- package/types/position.d.ts +2 -1
- package/types/position.js +1 -0
- package/types/position.js.map +1 -1
- package/types/text.d.ts +1 -1
- package/types/text.js.map +1 -1
- package/types.d.ts +5 -0
- package/types.js +6 -1
- package/types.js.map +1 -1
- package/utils/color.d.ts +7 -0
- package/utils/color.js +14 -2
- package/utils/color.js.map +1 -1
- package/utils/data.d.ts +4 -4
- package/utils/data.js +41 -10
- package/utils/data.js.map +1 -1
- package/utils/index.js +3 -3
- package/utils/path.d.ts +8 -0
- package/utils/path.js +109 -1
- package/utils/path.js.map +1 -1
- package/utils/text.d.ts +3 -2
- package/utils/text.js +22 -10
- package/utils/text.js.map +1 -1
package/components/area/index.js
CHANGED
|
@@ -101,7 +101,8 @@ class Area extends XYComponentCore {
|
|
|
101
101
|
getYDataExtent(scaleByVisibleData) {
|
|
102
102
|
const { config, datamodel } = this;
|
|
103
103
|
const yAccessors = (isArray(config.y) ? config.y : [config.y]);
|
|
104
|
-
const
|
|
104
|
+
const xDomain = this.xScale.domain();
|
|
105
|
+
const data = scaleByVisibleData ? filterDataByRange(datamodel.data, xDomain, config.x, true) : datamodel.data;
|
|
105
106
|
return getStackedExtent(data, config.baseline, ...yAccessors);
|
|
106
107
|
}
|
|
107
108
|
_emptyPath() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/area/index.ts"],"sourcesContent":["import { select } from 'd3-selection'\nimport { Transition } from 'd3-transition'\nimport { area, Area as AreaInterface } from 'd3-shape'\nimport { interpolatePath } from 'd3-interpolate-path'\n\n// Core\nimport { XYComponentCore } from 'core/xy-component'\n\n// Utils\nimport { getNumber, getString, isArray, isNumber, getStackedExtent, getStackedData, filterDataByRange } from 'utils/data'\nimport { smartTransition } from 'utils/d3'\nimport { getColor } from 'utils/color'\n\n// Types\nimport { Curve, CurveType } from 'types/curve'\nimport { NumericAccessor } from 'types/accessor'\n\n// Local Types\nimport { AreaDatum } from './types'\n\n// Config\nimport { AreaDefaultConfig, AreaConfigInterface } from './config'\n\n// Styles\nimport * as s from './style'\n\nexport class Area<Datum> extends XYComponentCore<Datum, AreaConfigInterface<Datum>> {\n static selectors = s\n protected _defaultConfig = AreaDefaultConfig as AreaConfigInterface<Datum>\n public config: AreaConfigInterface<Datum> = this._defaultConfig\n public stacked = true\n private _areaGen: AreaInterface<AreaDatum>\n private _prevNegative: boolean[] | undefined // To help guessing the stack direction when an accessor was set to null or 0\n\n events = {\n [Area.selectors.area]: {},\n }\n\n constructor (config?: AreaConfigInterface<Datum>) {\n super()\n if (config) this.setConfig(config)\n\n // Determine if the provided chart should be stacked\n this.stacked = Array.isArray(this.config.y)\n }\n\n _render (customDuration?: number): void {\n super._render(customDuration)\n const { config, datamodel: { data } } = this\n const duration = isNumber(customDuration) ? customDuration : config.duration\n\n const curveGen = Curve[config.curveType as CurveType]\n this._areaGen = area<AreaDatum>()\n .x(d => d.x)\n .y0(d => d.y0)\n .y1(d => d.y1)\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n .curve(curveGen)\n\n const yAccessors = (isArray(config.y) ? config.y : [config.y]) as NumericAccessor<Datum>[]\n const areaDataX = data.map((d, i) => this.xScale(getNumber(d, config.x, i)))\n\n const stacked = getStackedData(data, config.baseline, yAccessors, this._prevNegative)\n this._prevNegative = stacked.map(s => !!s.isMostlyNegative)\n const minHeightCumulativeArray: number[] = []\n const stackedData: AreaDatum[][] = stacked.map(\n arr => arr.map(\n (d, j) => {\n const x = areaDataX[j]\n const y0 = this.yScale(d[0])\n const y1 = this.yScale(d[1])\n const isNegativeArea = y1 > y0\n\n // Get cumulative adjustment and apply in the correct direction\n const cumulative = minHeightCumulativeArray[j] || 0\n const adjustedY0 = isNegativeArea ? y0 + cumulative : y0 - cumulative\n const adjustedY1 = isNegativeArea ? y1 + cumulative : y1 - cumulative\n\n // Calculate height adjustment if needed\n let heightAdjustment = 0\n if ((config.minHeight || config.minHeight1Px) &&\n Math.abs(adjustedY1 - adjustedY0) < (config.minHeight ?? 1)) {\n heightAdjustment = (config.minHeight ?? 1) - Math.abs(adjustedY1 - adjustedY0)\n minHeightCumulativeArray[j] = cumulative + heightAdjustment\n }\n\n return {\n x,\n y0: adjustedY0,\n y1: isNegativeArea ? adjustedY1 + heightAdjustment : adjustedY1 - heightAdjustment,\n }\n }\n )\n )\n\n // We reverse the data in order to have the first areas to be displayed on top\n // for better visibility when they're close to zero\n const areaMaxIdx = stackedData.length - 1\n const stackedDataReversed = stackedData.reverse()\n const areas = this.g\n .selectAll<SVGPathElement, AreaDatum>(`.${s.area}`)\n .data(stackedDataReversed)\n\n const areasEnter = areas.enter().append('path')\n .attr('class', s.area)\n .attr('d', d => this._areaGen(d) || this._emptyPath())\n .style('opacity', 0)\n .style('fill', (d, i) => getColor(data, config.color, areaMaxIdx - i))\n\n const areasMerged = smartTransition(areasEnter.merge(areas), duration)\n .style('opacity', (d, i) => {\n const isDefined = d.some(p => (p.y0 - p.y1) !== 0)\n return isDefined ? getNumber(data, config.opacity, areaMaxIdx - i) : 0\n })\n .style('fill', (d, i) => getColor(data, config.color, areaMaxIdx - i))\n .style('cursor', (d, i) => getString(data, config.cursor, areaMaxIdx - i))\n\n if (duration) {\n const transition = areasMerged as Transition<SVGPathElement, AreaDatum[], SVGGElement, AreaDatum[]>\n transition.attrTween('d', (d, i, el) => {\n const previous = select(el[i]).attr('d')\n const next = this._areaGen(d) || this._emptyPath()\n return interpolatePath(previous, next)\n })\n } else {\n areasMerged.attr('d', d => this._areaGen(d) || this._emptyPath())\n }\n\n smartTransition(areas.exit(), duration)\n .style('opacity', 0)\n .remove()\n }\n\n getYDataExtent (scaleByVisibleData: boolean): number[] {\n const { config, datamodel } = this\n const yAccessors = (isArray(config.y) ? config.y : [config.y]) as NumericAccessor<Datum>[]\n\n const data = scaleByVisibleData ? filterDataByRange(datamodel.data, this.xScale.domain() as [number, number], config.x) : datamodel.data\n return getStackedExtent(data, config.baseline, ...yAccessors)\n }\n\n _emptyPath (): string {\n const xRange = this.xScale.range()\n const yDomain = this.yScale.domain() as number[]\n\n const y0 = this.yScale((yDomain[0] + yDomain[1]) / 2)\n const y1 = y0\n\n return this._areaGen([\n { y0, y1, x: xRange[0] },\n { y0, y1, x: xRange[1] },\n ])\n }\n}\n"],"names":["s.area","s"],"mappings":";;;;;;;;;;;;AA0BM,MAAO,IAAY,SAAQ,eAAkD,CAAA;AAYjF,IAAA,WAAA,CAAa,MAAmC,EAAA;AAC9C,QAAA,KAAK,EAAE,CAAA;QAXC,IAAc,CAAA,cAAA,GAAG,iBAA+C,CAAA;AACnE,QAAA,IAAA,CAAA,MAAM,GAA+B,IAAI,CAAC,cAAc,CAAA;QACxD,IAAO,CAAA,OAAA,GAAG,IAAI,CAAA;AAIrB,QAAA,IAAA,CAAA,MAAM,GAAG;AACP,YAAA,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,GAAG,EAAE;SAC1B,CAAA;AAIC,QAAA,IAAI,MAAM;AAAE,YAAA,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;;AAGlC,QAAA,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;KAC5C;AAED,IAAA,OAAO,CAAE,cAAuB,EAAA;AAC9B,QAAA,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,CAAA;QAC7B,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,EAAE,GAAG,IAAI,CAAA;AAC5C,QAAA,MAAM,QAAQ,GAAG,QAAQ,CAAC,cAAc,CAAC,GAAG,cAAc,GAAG,MAAM,CAAC,QAAQ,CAAA;QAE5E,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,SAAsB,CAAC,CAAA;AACrD,QAAA,IAAI,CAAC,QAAQ,GAAG,IAAI,EAAa;aAC9B,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;aACX,EAAE,CAAC,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AM,EAAc,CAAA;QAEhD,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAA;QACrD,MAAM,EAAE,GAAG,EAAE,CAAA;QAEb,OAAO,IAAI,CAAC,QAAQ,CAAC;YACnB,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE;YACxB,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE;AACzB,SAAA,CAAC,CAAA;KACH;;AA9HM,IAAS,CAAA,SAAA,GAAGC,KAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/area/index.ts"],"sourcesContent":["import { select } from 'd3-selection'\nimport { Transition } from 'd3-transition'\nimport { area, Area as AreaInterface } from 'd3-shape'\nimport { interpolatePath } from 'd3-interpolate-path'\n\n// Core\nimport { XYComponentCore } from 'core/xy-component'\n\n// Utils\nimport { getNumber, getString, isArray, isNumber, getStackedExtent, getStackedData, filterDataByRange } from 'utils/data'\nimport { smartTransition } from 'utils/d3'\nimport { getColor } from 'utils/color'\n\n// Types\nimport { Curve, CurveType } from 'types/curve'\nimport { NumericAccessor } from 'types/accessor'\n\n// Local Types\nimport { AreaDatum } from './types'\n\n// Config\nimport { AreaDefaultConfig, AreaConfigInterface } from './config'\n\n// Styles\nimport * as s from './style'\n\nexport class Area<Datum> extends XYComponentCore<Datum, AreaConfigInterface<Datum>> {\n static selectors = s\n protected _defaultConfig = AreaDefaultConfig as AreaConfigInterface<Datum>\n public config: AreaConfigInterface<Datum> = this._defaultConfig\n public stacked = true\n private _areaGen: AreaInterface<AreaDatum>\n private _prevNegative: boolean[] | undefined // To help guessing the stack direction when an accessor was set to null or 0\n\n events = {\n [Area.selectors.area]: {},\n }\n\n constructor (config?: AreaConfigInterface<Datum>) {\n super()\n if (config) this.setConfig(config)\n\n // Determine if the provided chart should be stacked\n this.stacked = Array.isArray(this.config.y)\n }\n\n _render (customDuration?: number): void {\n super._render(customDuration)\n const { config, datamodel: { data } } = this\n const duration = isNumber(customDuration) ? customDuration : config.duration\n\n const curveGen = Curve[config.curveType as CurveType]\n this._areaGen = area<AreaDatum>()\n .x(d => d.x)\n .y0(d => d.y0)\n .y1(d => d.y1)\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n .curve(curveGen)\n\n const yAccessors = (isArray(config.y) ? config.y : [config.y]) as NumericAccessor<Datum>[]\n const areaDataX = data.map((d, i) => this.xScale(getNumber(d, config.x, i)))\n\n const stacked = getStackedData(data, config.baseline, yAccessors, this._prevNegative)\n this._prevNegative = stacked.map(s => !!s.isMostlyNegative)\n const minHeightCumulativeArray: number[] = []\n const stackedData: AreaDatum[][] = stacked.map(\n arr => arr.map(\n (d, j) => {\n const x = areaDataX[j]\n const y0 = this.yScale(d[0])\n const y1 = this.yScale(d[1])\n const isNegativeArea = y1 > y0\n\n // Get cumulative adjustment and apply in the correct direction\n const cumulative = minHeightCumulativeArray[j] || 0\n const adjustedY0 = isNegativeArea ? y0 + cumulative : y0 - cumulative\n const adjustedY1 = isNegativeArea ? y1 + cumulative : y1 - cumulative\n\n // Calculate height adjustment if needed\n let heightAdjustment = 0\n if ((config.minHeight || config.minHeight1Px) &&\n Math.abs(adjustedY1 - adjustedY0) < (config.minHeight ?? 1)) {\n heightAdjustment = (config.minHeight ?? 1) - Math.abs(adjustedY1 - adjustedY0)\n minHeightCumulativeArray[j] = cumulative + heightAdjustment\n }\n\n return {\n x,\n y0: adjustedY0,\n y1: isNegativeArea ? adjustedY1 + heightAdjustment : adjustedY1 - heightAdjustment,\n }\n }\n )\n )\n\n // We reverse the data in order to have the first areas to be displayed on top\n // for better visibility when they're close to zero\n const areaMaxIdx = stackedData.length - 1\n const stackedDataReversed = stackedData.reverse()\n const areas = this.g\n .selectAll<SVGPathElement, AreaDatum>(`.${s.area}`)\n .data(stackedDataReversed)\n\n const areasEnter = areas.enter().append('path')\n .attr('class', s.area)\n .attr('d', d => this._areaGen(d) || this._emptyPath())\n .style('opacity', 0)\n .style('fill', (d, i) => getColor(data, config.color, areaMaxIdx - i))\n\n const areasMerged = smartTransition(areasEnter.merge(areas), duration)\n .style('opacity', (d, i) => {\n const isDefined = d.some(p => (p.y0 - p.y1) !== 0)\n return isDefined ? getNumber(data, config.opacity, areaMaxIdx - i) : 0\n })\n .style('fill', (d, i) => getColor(data, config.color, areaMaxIdx - i))\n .style('cursor', (d, i) => getString(data, config.cursor, areaMaxIdx - i))\n\n if (duration) {\n const transition = areasMerged as Transition<SVGPathElement, AreaDatum[], SVGGElement, AreaDatum[]>\n transition.attrTween('d', (d, i, el) => {\n const previous = select(el[i]).attr('d')\n const next = this._areaGen(d) || this._emptyPath()\n return interpolatePath(previous, next)\n })\n } else {\n areasMerged.attr('d', d => this._areaGen(d) || this._emptyPath())\n }\n\n smartTransition(areas.exit(), duration)\n .style('opacity', 0)\n .remove()\n }\n\n getYDataExtent (scaleByVisibleData: boolean): number[] {\n const { config, datamodel } = this\n const yAccessors = (isArray(config.y) ? config.y : [config.y]) as NumericAccessor<Datum>[]\n\n const xDomain = this.xScale.domain() as [number, number]\n const data = scaleByVisibleData ? filterDataByRange(datamodel.data, xDomain, config.x, true) : datamodel.data\n return getStackedExtent(data, config.baseline, ...yAccessors)\n }\n\n _emptyPath (): string {\n const xRange = this.xScale.range()\n const yDomain = this.yScale.domain() as number[]\n\n const y0 = this.yScale((yDomain[0] + yDomain[1]) / 2)\n const y1 = y0\n\n return this._areaGen([\n { y0, y1, x: xRange[0] },\n { y0, y1, x: xRange[1] },\n ])\n }\n}\n"],"names":["s.area","s"],"mappings":";;;;;;;;;;;;AA0BM,MAAO,IAAY,SAAQ,eAAkD,CAAA;AAYjF,IAAA,WAAA,CAAa,MAAmC,EAAA;AAC9C,QAAA,KAAK,EAAE,CAAA;QAXC,IAAc,CAAA,c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AC,EAAE;YACxB,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE;AACzB,SAAA,CAAC,CAAA;KACH;;AA/HM,IAAS,CAAA,SAAA,GAAGC,KAAC;;;;"}
|
|
@@ -15,6 +15,10 @@ export interface AxisConfigInterface<Datum> extends Partial<XYComponentConfigInt
|
|
|
15
15
|
labelFontSize?: string | null;
|
|
16
16
|
/** Distance between the axis and the label in pixels. Default: `8` */
|
|
17
17
|
labelMargin?: number;
|
|
18
|
+
/** Label text fit mode: `FitMode.Wrap` or `FitMode.Trim`. Default: `FitMode.Wrap`. */
|
|
19
|
+
labelTextFitMode?: FitMode | string;
|
|
20
|
+
/** Label text trim mode: `TrimMode.Start`, `TrimMode.Middle` or `TrimMode.End`. Default: `TrimMode.Middle` */
|
|
21
|
+
labelTextTrimType?: TrimMode | string;
|
|
18
22
|
/** Font color of the axis label as CSS string. Default: `null` */
|
|
19
23
|
labelColor?: string | null;
|
|
20
24
|
/** Sets whether to draw the grid lines or not. Default: `true` */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { XYComponentDefaultConfig } from '../../core/xy-component/config.js';
|
|
2
|
-
import {
|
|
2
|
+
import { FitMode, TrimMode } from '../../types/text.js';
|
|
3
3
|
|
|
4
|
-
const AxisDefaultConfig = Object.assign(Object.assign({}, XYComponentDefaultConfig), { position: undefined, type: undefined, label: undefined, labelFontSize: null, gridLine: true, tickLine: true, domainLine: true, numTicks: undefined, minMaxTicksOnly: false, minMaxTicksOnlyWhenWidthIsLess: 250, tickTextWidth: undefined, tickTextSeparator: undefined, tickTextForceWordBreak: false, tickTextTrimType: TrimMode.Middle, tickTextFitMode: FitMode.Wrap, tickTextFontSize: null, tickTextAlign: undefined, tickTextColor: null, tickTextAngle: undefined, labelMargin: 8, labelColor: null, tickFormat: undefined, tickValues: undefined, fullSize: true, tickPadding: 8, tickTextHideOverlapping: undefined });
|
|
4
|
+
const AxisDefaultConfig = Object.assign(Object.assign({}, XYComponentDefaultConfig), { position: undefined, type: undefined, label: undefined, labelFontSize: null, labelTextFitMode: FitMode.Wrap, labelTextTrimType: TrimMode.Middle, gridLine: true, tickLine: true, domainLine: true, numTicks: undefined, minMaxTicksOnly: false, minMaxTicksOnlyWhenWidthIsLess: 250, tickTextWidth: undefined, tickTextSeparator: undefined, tickTextForceWordBreak: false, tickTextTrimType: TrimMode.Middle, tickTextFitMode: FitMode.Wrap, tickTextFontSize: null, tickTextAlign: undefined, tickTextColor: null, tickTextAngle: undefined, labelMargin: 8, labelColor: null, tickFormat: undefined, tickValues: undefined, fullSize: true, tickPadding: 8, tickTextHideOverlapping: undefined });
|
|
5
5
|
|
|
6
6
|
export { AxisDefaultConfig };
|
|
7
7
|
//# sourceMappingURL=config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sources":["../../../src/components/axis/config.ts"],"sourcesContent":["import { XYComponentConfigInterface, XYComponentDefaultConfig } from 'core/xy-component/config'\n\n// Types\nimport { AxisType } from 'components/axis/types'\nimport { Position } from 'types/position'\nimport { FitMode, TrimMode, TextAlign } from 'types/text'\n\n// We extend partial XY config interface because x and y properties are optional for Axis\nexport interface AxisConfigInterface<Datum> extends Partial<XYComponentConfigInterface<Datum>> {\n /** Axis position: `Position.Top`, `Position.Bottom`, `Position.Right` or `Position.Left`. Default: `undefined` */\n position?: Position | string;\n /** Axis type: `AxisType.X` or `AxisType.Y` */\n type?: AxisType | string;\n /** Extend the axis domain line to be full width or full height. Default: `true` */\n fullSize?: boolean;\n /** Axis label. Default: `undefined` */\n label?: string;\n /** Font size of the axis label as CSS string. Default: `null` */\n labelFontSize?: string | null;\n /** Distance between the axis and the label in pixels. Default: `8` */\n labelMargin?: number;\n /** Font color of the axis label as CSS string. Default: `null` */\n labelColor?: string | null;\n /** Sets whether to draw the grid lines or not. Default: `true` */\n gridLine?: boolean;\n /** Sets whether to draw the tick lines or not. Default: `true` */\n tickLine?: boolean;\n /** Sets whether to draw the domain line or not. Default: `true` */\n domainLine?: boolean;\n /** Draw only the min and max axis ticks. Default: `false` */\n minMaxTicksOnly?: boolean;\n /** Draw only the min and max axis ticks, when the chart\n * width is less than the specified value.\n * Default: `250` */\n minMaxTicksOnlyWhenWidthIsLess?: number;\n /** Tick label formatter function. Default: `undefined` */\n tickFormat?: ((tick: number | Date, i: number, ticks: number[] | Date[]) => string);\n /** Explicitly set tick values. Default: `undefined` */\n tickValues?: number[];\n /** Set the approximate number of axis ticks (will be passed to D3's axis constructor). Default: `undefined` */\n numTicks?: number;\n /** Tick text fit mode: `FitMode.Wrap` or `FitMode.Trim`. Default: `FitMode.Wrap`. */\n tickTextFitMode?: FitMode | string;\n /** Maximum width in pixels for the tick text to be wrapped or trimmed. Default: `undefined` */\n tickTextWidth?: number;\n /** Tick text wrapping separator. String or array of strings. Default: `undefined` */\n tickTextSeparator?: string | string[];\n /** Force word break for ticks when they don't fit. Default: `false` */\n tickTextForceWordBreak?: boolean;\n /** Tick text trim mode: `TrimMode.Start`, `TrimMode.Middle` or `TrimMode.End`. Default: `TrimMode.Middle` */\n tickTextTrimType?: TrimMode | string;\n /** Font size of the tick text as CSS string. Default: `null` */\n tickTextFontSize?: string | null;\n /** Text alignment for ticks: `TextAlign.Left`, `TextAlign.Center` or `TextAlign.Right`. Default: `undefined` */\n tickTextAlign?: TextAlign | string;\n /** Font color of the tick text as CSS string. Default: `null` */\n tickTextColor?: string | null;\n /** Text rotation angle for ticks. Default: `undefined` */\n tickTextAngle?: number;\n /** Hide tick labels that overlap with each other.\n * To define overlapping, a simple bounding box collision detection algorithm is used.\n * Which means the result won't be accurate when `tickTextAngle` is specified.\n * Default: `undefined` */\n tickTextHideOverlapping?: boolean;\n /** The spacing in pixels between the tick and it's label. Default: `8` */\n tickPadding?: number;\n}\n\nexport const AxisDefaultConfig: AxisConfigInterface<unknown> = {\n ...XYComponentDefaultConfig,\n position: undefined,\n type: undefined,\n label: undefined,\n labelFontSize: null,\n gridLine: true,\n tickLine: true,\n domainLine: true,\n numTicks: undefined,\n minMaxTicksOnly: false,\n minMaxTicksOnlyWhenWidthIsLess: 250,\n tickTextWidth: undefined,\n tickTextSeparator: undefined,\n tickTextForceWordBreak: false,\n tickTextTrimType: TrimMode.Middle,\n tickTextFitMode: FitMode.Wrap,\n tickTextFontSize: null,\n tickTextAlign: undefined,\n tickTextColor: null,\n tickTextAngle: undefined,\n labelMargin: 8,\n labelColor: null,\n tickFormat: undefined,\n tickValues: undefined,\n fullSize: true,\n tickPadding: 8,\n tickTextHideOverlapping: undefined,\n}\n"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"config.js","sources":["../../../src/components/axis/config.ts"],"sourcesContent":["import { XYComponentConfigInterface, XYComponentDefaultConfig } from 'core/xy-component/config'\n\n// Types\nimport { AxisType } from 'components/axis/types'\nimport { Position } from 'types/position'\nimport { FitMode, TrimMode, TextAlign } from 'types/text'\n\n// We extend partial XY config interface because x and y properties are optional for Axis\nexport interface AxisConfigInterface<Datum> extends Partial<XYComponentConfigInterface<Datum>> {\n /** Axis position: `Position.Top`, `Position.Bottom`, `Position.Right` or `Position.Left`. Default: `undefined` */\n position?: Position | string;\n /** Axis type: `AxisType.X` or `AxisType.Y` */\n type?: AxisType | string;\n /** Extend the axis domain line to be full width or full height. Default: `true` */\n fullSize?: boolean;\n /** Axis label. Default: `undefined` */\n label?: string;\n /** Font size of the axis label as CSS string. Default: `null` */\n labelFontSize?: string | null;\n /** Distance between the axis and the label in pixels. Default: `8` */\n labelMargin?: number;\n /** Label text fit mode: `FitMode.Wrap` or `FitMode.Trim`. Default: `FitMode.Wrap`. */\n labelTextFitMode?: FitMode | string;\n /** Label text trim mode: `TrimMode.Start`, `TrimMode.Middle` or `TrimMode.End`. Default: `TrimMode.Middle` */\n labelTextTrimType?: TrimMode | string;\n /** Font color of the axis label as CSS string. Default: `null` */\n labelColor?: string | null;\n /** Sets whether to draw the grid lines or not. Default: `true` */\n gridLine?: boolean;\n /** Sets whether to draw the tick lines or not. Default: `true` */\n tickLine?: boolean;\n /** Sets whether to draw the domain line or not. Default: `true` */\n domainLine?: boolean;\n /** Draw only the min and max axis ticks. Default: `false` */\n minMaxTicksOnly?: boolean;\n /** Draw only the min and max axis ticks, when the chart\n * width is less than the specified value.\n * Default: `250` */\n minMaxTicksOnlyWhenWidthIsLess?: number;\n /** Tick label formatter function. Default: `undefined` */\n tickFormat?: ((tick: number | Date, i: number, ticks: number[] | Date[]) => string);\n /** Explicitly set tick values. Default: `undefined` */\n tickValues?: number[];\n /** Set the approximate number of axis ticks (will be passed to D3's axis constructor). Default: `undefined` */\n numTicks?: number;\n /** Tick text fit mode: `FitMode.Wrap` or `FitMode.Trim`. Default: `FitMode.Wrap`. */\n tickTextFitMode?: FitMode | string;\n /** Maximum width in pixels for the tick text to be wrapped or trimmed. Default: `undefined` */\n tickTextWidth?: number;\n /** Tick text wrapping separator. String or array of strings. Default: `undefined` */\n tickTextSeparator?: string | string[];\n /** Force word break for ticks when they don't fit. Default: `false` */\n tickTextForceWordBreak?: boolean;\n /** Tick text trim mode: `TrimMode.Start`, `TrimMode.Middle` or `TrimMode.End`. Default: `TrimMode.Middle` */\n tickTextTrimType?: TrimMode | string;\n /** Font size of the tick text as CSS string. Default: `null` */\n tickTextFontSize?: string | null;\n /** Text alignment for ticks: `TextAlign.Left`, `TextAlign.Center` or `TextAlign.Right`. Default: `undefined` */\n tickTextAlign?: TextAlign | string;\n /** Font color of the tick text as CSS string. Default: `null` */\n tickTextColor?: string | null;\n /** Text rotation angle for ticks. Default: `undefined` */\n tickTextAngle?: number;\n /** Hide tick labels that overlap with each other.\n * To define overlapping, a simple bounding box collision detection algorithm is used.\n * Which means the result won't be accurate when `tickTextAngle` is specified.\n * Default: `undefined` */\n tickTextHideOverlapping?: boolean;\n /** The spacing in pixels between the tick and it's label. Default: `8` */\n tickPadding?: number;\n}\n\nexport const AxisDefaultConfig: AxisConfigInterface<unknown> = {\n ...XYComponentDefaultConfig,\n position: undefined,\n type: undefined,\n label: undefined,\n labelFontSize: null,\n labelTextFitMode: FitMode.Wrap,\n labelTextTrimType: TrimMode.Middle,\n gridLine: true,\n tickLine: true,\n domainLine: true,\n numTicks: undefined,\n minMaxTicksOnly: false,\n minMaxTicksOnlyWhenWidthIsLess: 250,\n tickTextWidth: undefined,\n tickTextSeparator: undefined,\n tickTextForceWordBreak: false,\n tickTextTrimType: TrimMode.Middle,\n tickTextFitMode: FitMode.Wrap,\n tickTextFontSize: null,\n tickTextAlign: undefined,\n tickTextColor: null,\n tickTextAngle: undefined,\n labelMargin: 8,\n labelColor: null,\n tickFormat: undefined,\n tickValues: undefined,\n fullSize: true,\n tickPadding: 8,\n tickTextHideOverlapping: undefined,\n}\n"],"names":[],"mappings":";;;AAwEO,MAAM,iBAAiB,GAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACzB,wBAAwB,CAAA,EAAA,EAC3B,QAAQ,EAAE,SAAS,EACnB,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,SAAS,EAChB,aAAa,EAAE,IAAI,EACnB,gBAAgB,EAAE,OAAO,CAAC,IAAI,EAC9B,iBAAiB,EAAE,QAAQ,CAAC,MAAM,EAClC,QAAQ,EAAE,IAAI,EACd,QAAQ,EAAE,IAAI,EACd,UAAU,EAAE,IAAI,EAChB,QAAQ,EAAE,SAAS,EACnB,eAAe,EAAE,KAAK,EACtB,8BAA8B,EAAE,GAAG,EACnC,aAAa,EAAE,SAAS,EACxB,iBAAiB,EAAE,SAAS,EAC5B,sBAAsB,EAAE,KAAK,EAC7B,gBAAgB,EAAE,QAAQ,CAAC,MAAM,EACjC,eAAe,EAAE,OAAO,CAAC,IAAI,EAC7B,gBAAgB,EAAE,IAAI,EACtB,aAAa,EAAE,SAAS,EACxB,aAAa,EAAE,IAAI,EACnB,aAAa,EAAE,SAAS,EACxB,WAAW,EAAE,CAAC,EACd,UAAU,EAAE,IAAI,EAChB,UAAU,EAAE,SAAS,EACrB,UAAU,EAAE,SAAS,EACrB,QAAQ,EAAE,IAAI,EACd,WAAW,EAAE,CAAC,EACd,uBAAuB,EAAE,SAAS;;;;"}
|
package/components/axis/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { XYComponentCore } from '../../core/xy-component/index.js';
|
|
|
5
5
|
import { Position } from '../../types/position.js';
|
|
6
6
|
import { VerticalAlign, FitMode, TextAlign } from '../../types/text.js';
|
|
7
7
|
import { smartTransition } from '../../utils/d3.js';
|
|
8
|
-
import { trimSVGText, renderTextToSvgTextElement } from '../../utils/text.js';
|
|
8
|
+
import { trimSVGText, renderTextToSvgTextElement, wrapSVGText, textAlignToAnchor } from '../../utils/text.js';
|
|
9
9
|
import { isEqual } from '../../utils/data.js';
|
|
10
10
|
import { rectIntersect } from '../../utils/misc.js';
|
|
11
11
|
import { AxisType } from './types.js';
|
|
@@ -295,28 +295,68 @@ class Axis extends XYComponentCore {
|
|
|
295
295
|
}
|
|
296
296
|
_renderAxisLabel(selection = this.axisGroup) {
|
|
297
297
|
var _a;
|
|
298
|
-
const { type, label: label$1, labelMargin, labelFontSize } = this.config;
|
|
298
|
+
const { type, label: label$1, labelMargin, labelFontSize, labelTextFitMode } = this.config;
|
|
299
299
|
// Remove the old label first to calculate the axis size properly
|
|
300
300
|
selection.selectAll(`.${label}`).remove();
|
|
301
|
+
if (!label$1)
|
|
302
|
+
return;
|
|
301
303
|
// Calculate label position and rotation
|
|
302
304
|
const axisPosition = this.getPosition();
|
|
303
305
|
// We always use this.axisRenderHelperGroup to calculate the size of the axis because
|
|
304
306
|
// this.axisGroup will give us incorrect values due to animation
|
|
305
307
|
const { width: axisWidth, height: axisHeight } = (_a = this._axisRawBBox) !== null && _a !== void 0 ? _a : selection.node().getBBox();
|
|
306
|
-
const offsetX = type === AxisType.X ? this._width / 2 : Math.pow((-1), (+(axisPosition === Position.Left))) * axisWidth;
|
|
307
|
-
const offsetY = type === AxisType.X ? Math.pow((-1), (+(axisPosition === Position.Top))) * axisHeight : this._height / 2;
|
|
308
|
-
const marginX = type === AxisType.X ? 0 : Math.pow((-1), (+(axisPosition === Position.Left))) * labelMargin;
|
|
309
|
-
const marginY = type === AxisType.X ? Math.pow((-1), (+(axisPosition === Position.Top))) * labelMargin : 0;
|
|
310
308
|
const rotation = type === AxisType.Y ? -90 : 0;
|
|
311
|
-
//
|
|
312
|
-
selection
|
|
309
|
+
// Create the text element (without transform first)
|
|
310
|
+
const textElement = selection
|
|
313
311
|
.append('text')
|
|
314
312
|
.attr('class', label)
|
|
315
|
-
.text(label$1)
|
|
316
313
|
.attr('dy', `${this._getLabelDY()}em`)
|
|
317
|
-
.attr('transform', `translate(${offsetX + marginX},${offsetY + marginY}) rotate(${rotation})`)
|
|
318
314
|
.style('font-size', labelFontSize)
|
|
319
315
|
.style('fill', this.config.labelColor);
|
|
316
|
+
// Set the text content
|
|
317
|
+
textElement.text(label$1);
|
|
318
|
+
if (labelTextFitMode === FitMode.Wrap) {
|
|
319
|
+
// For Y-axis, use the chart height as the maximum width before rotation
|
|
320
|
+
const maxWidth = type === AxisType.Y ? this._height : this._width;
|
|
321
|
+
wrapSVGText(textElement, maxWidth);
|
|
322
|
+
}
|
|
323
|
+
// Calculate offset after wrapping to get accurate dimensions
|
|
324
|
+
let labelWidth = axisWidth;
|
|
325
|
+
let labelHeight = axisHeight;
|
|
326
|
+
if (labelTextFitMode === FitMode.Wrap) {
|
|
327
|
+
const labelBBox = textElement.node().getBBox();
|
|
328
|
+
labelWidth = labelBBox.width;
|
|
329
|
+
labelHeight = labelBBox.height;
|
|
330
|
+
}
|
|
331
|
+
else {
|
|
332
|
+
const trimWidth = type === AxisType.X ? labelWidth : labelHeight;
|
|
333
|
+
const styleDeclaration = getComputedStyle(textElement.node());
|
|
334
|
+
const fontSize = Number.parseFloat(styleDeclaration.fontSize);
|
|
335
|
+
// Use the default fontWidthToHeightRatio
|
|
336
|
+
trimSVGText(textElement, trimWidth, this.config.labelTextTrimType, true, fontSize);
|
|
337
|
+
const trimmedBBox = textElement.node().getBBox();
|
|
338
|
+
labelWidth = trimmedBBox.width;
|
|
339
|
+
labelHeight = trimmedBBox.height;
|
|
340
|
+
}
|
|
341
|
+
/*
|
|
342
|
+
we need to calculate the offset for the label based on the position and the fit mode
|
|
343
|
+
for offsetX, applying Y label we need to check if it's wrap or trim, then set the offset accordingly.
|
|
344
|
+
Same for offsetY, need to consider x label.
|
|
345
|
+
*/
|
|
346
|
+
const offsetX = type === AxisType.X
|
|
347
|
+
? this._width / 2
|
|
348
|
+
: type === AxisType.Y && labelTextFitMode === FitMode.Wrap
|
|
349
|
+
? (axisPosition === Position.Left) ? -labelHeight / 2 : 0
|
|
350
|
+
: Math.pow((-1), (+(axisPosition === Position.Left))) * axisWidth;
|
|
351
|
+
const offsetY = type === AxisType.Y
|
|
352
|
+
? this._height / 2
|
|
353
|
+
: type === AxisType.X && labelTextFitMode === FitMode.Wrap
|
|
354
|
+
? (axisPosition === Position.Top) ? -axisHeight - labelHeight / 2 : axisHeight
|
|
355
|
+
: Math.pow((-1), (+(axisPosition === Position.Top))) * axisHeight;
|
|
356
|
+
const marginX = type === AxisType.X ? 0 : (labelTextFitMode === FitMode.Wrap ? Math.pow((-1), (+(axisPosition === Position.Left))) * ((labelHeight / 2) + labelMargin * 2) : (axisPosition === Position.Right ? labelMargin : -labelMargin));
|
|
357
|
+
const marginY = type === AxisType.X ? Math.pow((-1), (+(axisPosition === Position.Top))) * labelMargin : 0;
|
|
358
|
+
// Apply transform and rotation after all calculations
|
|
359
|
+
textElement.attr('transform', `translate(${offsetX + marginX},${offsetY + marginY}) rotate(${rotation})`);
|
|
320
360
|
}
|
|
321
361
|
_getLabelDY() {
|
|
322
362
|
const { type, position } = this.config;
|
|
@@ -338,7 +378,7 @@ class Axis extends XYComponentCore {
|
|
|
338
378
|
_alignTickLabels() {
|
|
339
379
|
const { config: { type, tickTextAlign, tickTextAngle, position } } = this;
|
|
340
380
|
const tickText = this.g.selectAll('g.tick > text');
|
|
341
|
-
const textAnchor =
|
|
381
|
+
const textAnchor = textAlignToAnchor(tickTextAlign);
|
|
342
382
|
const translateX = type === AxisType.X
|
|
343
383
|
? 0
|
|
344
384
|
: this._getYTickTextTranslate(tickTextAlign, position);
|
|
@@ -347,14 +387,6 @@ class Axis extends XYComponentCore {
|
|
|
347
387
|
.attr('transform', translateValue)
|
|
348
388
|
.attr('text-anchor', textAnchor);
|
|
349
389
|
}
|
|
350
|
-
_getTickTextAnchor(textAlign) {
|
|
351
|
-
switch (textAlign) {
|
|
352
|
-
case TextAlign.Left: return 'start';
|
|
353
|
-
case TextAlign.Right: return 'end';
|
|
354
|
-
case TextAlign.Center: return 'middle';
|
|
355
|
-
default: return null;
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
390
|
_getYTickTextTranslate(textAlign, axisPosition = Position.Left) {
|
|
359
391
|
const defaultTickTextSpacingPx = 9; // Default in D3
|
|
360
392
|
const width = this._axisRawBBox.width - defaultTickTextSpacingPx;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/axis/index.ts"],"sourcesContent":["import { select, Selection } from 'd3-selection'\nimport { interrupt } from 'd3-transition'\nimport { Axis as D3Axis, axisBottom, axisLeft, axisRight, axisTop } from 'd3-axis'\n\n// Core\nimport { XYComponentCore } from 'core/xy-component'\n\n// Types\nimport { Position } from 'types/position'\nimport { ContinuousScale } from 'types/scale'\nimport { Spacing } from 'types/spacing'\nimport { FitMode, TextAlign, TrimMode, UnovisText, UnovisTextOptions, VerticalAlign } from 'types/text'\n\n// Utils\nimport { smartTransition } from 'utils/d3'\nimport { renderTextToSvgTextElement, trimSVGText } from 'utils/text'\nimport { isEqual } from 'utils/data'\nimport { rectIntersect } from 'utils/misc'\n\n// Local Types\nimport { AxisType } from './types'\n\n// Config\nimport { AxisDefaultConfig, AxisConfigInterface } from './config'\n\n// Styles\nimport * as s from './style'\n\nexport class Axis<Datum> extends XYComponentCore<Datum, AxisConfigInterface<Datum>> {\n static selectors = s\n protected _defaultConfig: AxisConfigInterface<Datum> = AxisDefaultConfig\n public config: AxisConfigInterface<Datum> = this._defaultConfig\n private axisGroup: Selection<SVGGElement, unknown, SVGGElement, unknown>\n private gridGroup: Selection<SVGGElement, unknown, SVGGElement, unknown>\n\n private _axisRawBBox: DOMRect\n private _axisSizeBBox: SVGRect\n private _requiredMargin: Spacing\n private _defaultNumTicks = 3\n private _collideTickLabelsAnimFrameId: ReturnType<typeof requestAnimationFrame>\n\n protected events = {}\n\n constructor (config?: AxisConfigInterface<Datum>) {\n super()\n if (config) this.setConfig(config)\n this.axisGroup = this.g.append('g')\n this.gridGroup = this.g.append('g')\n .attr('class', s.grid)\n }\n\n /** Renders axis to an invisible grouped to calculate automatic chart margins */\n public preRender (): void {\n const { config } = this\n const axisRenderHelperGroup = this.g.append('g').attr('opacity', 0)\n\n this._renderAxis(axisRenderHelperGroup, 0)\n\n // Store axis raw BBox (without the label) for further label positioning (see _renderAxisLabel)\n this._axisRawBBox = axisRenderHelperGroup.node().getBBox()\n\n // Align tick text\n if (config.tickTextAlign) this._alignTickLabels()\n\n // Render label and store total axis size and required margins\n this._renderAxisLabel(axisRenderHelperGroup)\n this._axisSizeBBox = this._getAxisSize(axisRenderHelperGroup)\n this._requiredMargin = this._getRequiredMargin(this._axisSizeBBox)\n\n axisRenderHelperGroup.remove()\n }\n\n public getPosition (): Position {\n const { config: { type, position } } = this\n return (position ?? ((type === AxisType.X) ? Position.Bottom : Position.Left)) as Position\n }\n\n private _getAxisSize (selection: Selection<SVGGElement, unknown, SVGGElement, undefined>): SVGRect {\n const bBox = selection.node().getBBox()\n return bBox\n }\n\n private _getRequiredMargin (axisSize = this._axisSizeBBox): Spacing {\n const { config: { type, position } } = this\n\n switch (type) {\n case AxisType.X: {\n const tolerancePx = 1\n const xEnd = this._axisSizeBBox.x + this._axisSizeBBox.width\n\n const left = this._axisSizeBBox.x < 0 ? Math.abs(this._axisSizeBBox.x) : 0\n const right = (xEnd - this._width) > tolerancePx ? xEnd - this._width : 0\n\n switch (position) {\n case Position.Top: return { top: axisSize.height, left, right }\n case Position.Bottom: default: return { bottom: axisSize.height, left, right }\n }\n }\n case AxisType.Y: {\n const bleedY = axisSize.height > this._height ? (axisSize.height - this._height) / 2 : 0\n const top = bleedY\n const bottom = bleedY\n\n switch (position) {\n case Position.Right: return { right: axisSize.width, top, bottom }\n case Position.Left: default: return { left: axisSize.width, top, bottom }\n }\n }\n }\n }\n\n getRequiredMargin (): Spacing {\n return this._requiredMargin\n }\n\n /** Calculates axis transform:translate offset based on passed container margins */\n getOffset (containerMargin: Spacing): {left: number; top: number} {\n const { config: { type, position } } = this\n\n switch (type) {\n case AxisType.X:\n switch (position) {\n case Position.Top: return { top: containerMargin.top, left: containerMargin.left }\n case Position.Bottom: default: return { top: containerMargin.top + this._height, left: containerMargin.left }\n }\n case AxisType.Y:\n switch (position) {\n case Position.Right: return { top: containerMargin.top, left: containerMargin.left + this._width }\n case Position.Left: default: return { top: containerMargin.top, left: containerMargin.left }\n }\n }\n }\n\n public _render (duration = this.config.duration, selection = this.axisGroup): void {\n const { config } = this\n\n this._renderAxis(selection, duration)\n this._renderAxisLabel(selection)\n\n if (config.gridLine) {\n const gridGen = this._buildGrid().tickFormat(() => '')\n gridGen.tickValues(this._getConfiguredTickValues())\n // Interrupting all active transitions first to prevent them from being stuck.\n // Somehow we see it happening in Angular apps.\n this.gridGroup.selectAll('*').interrupt()\n smartTransition(this.gridGroup, duration).call(gridGen).style('opacity', 1)\n } else {\n smartTransition(this.gridGroup, duration).style('opacity', 0)\n }\n\n if (config.tickTextAlign) this._alignTickLabels()\n\n this._resolveTickLabelOverlap(selection)\n }\n\n private _buildAxis (): D3Axis<any> {\n const { config: { type, position, tickPadding } } = this\n\n const ticks = this._getNumTicks()\n switch (type) {\n case AxisType.X:\n switch (position) {\n case Position.Top: return axisTop(this.xScale).ticks(ticks).tickPadding(tickPadding)\n case Position.Bottom: default: return axisBottom(this.xScale).ticks(ticks).tickPadding(tickPadding)\n }\n case AxisType.Y:\n switch (position) {\n case Position.Right: return axisRight(this.yScale).ticks(ticks).tickPadding(tickPadding)\n case Position.Left: default: return axisLeft(this.yScale).ticks(ticks).tickPadding(tickPadding)\n }\n }\n }\n\n private _buildGrid (): D3Axis<any> {\n const { config: { type, position } } = this\n\n const ticks = this._getNumTicks()\n switch (type) {\n case AxisType.X:\n switch (position) {\n case Position.Top: return axisTop(this.xScale).ticks(ticks * 2).tickSize(-this._height).tickSizeOuter(0)\n case Position.Bottom: default: return axisBottom(this.xScale).ticks(ticks * 2).tickSize(-this._height).tickSizeOuter(0)\n }\n case AxisType.Y:\n switch (position) {\n case Position.Right: return axisRight(this.yScale).ticks(ticks * 2).tickSize(-this._width).tickSizeOuter(0)\n case Position.Left: default: return axisLeft(this.yScale).ticks(ticks * 2).tickSize(-this._width).tickSizeOuter(0)\n }\n }\n }\n\n private _renderAxis (selection = this.axisGroup, duration = this.config.duration): void {\n const { config } = this\n\n const axisGen = this._buildAxis()\n const tickValues: (number[] | Date[]) = this._getConfiguredTickValues() || axisGen.scale<ContinuousScale>().ticks(this._getNumTicks())\n axisGen.tickValues(tickValues)\n\n // Interrupting all active transitions first to prevent them from being stuck.\n // Somehow we see it happening in Angular apps.\n selection.selectAll('*').interrupt()\n smartTransition(selection, duration).call(axisGen)\n\n const ticks = selection.selectAll<SVGGElement, number | Date>('g.tick')\n\n ticks\n .classed(s.tick, true)\n .style('font-size', config.tickTextFontSize)\n\n // Selecting the <text> elements of the ticks to apply formatting. By default, this selection\n // will include exiting elements, so we're filtering them out.\n const tickText = selection.selectAll<SVGTextElement, number | Date>('g.tick > text')\n .filter(tickValue => tickValues.some((t: number | Date) => isEqual(tickValue, t))) // We use isEqual to compare Dates\n .classed(s.tickLabel, true)\n .classed(s.tickLabelHideable, Boolean(config.tickTextHideOverlapping))\n .style('fill', config.tickTextColor) as Selection<SVGTextElement, number, SVGGElement, unknown> | Selection<SVGTextElement, Date, SVGGElement, unknown>\n\n\n // We interrupt the transition on tick's <text> to make it 'wrappable'\n tickText.nodes().forEach(node => interrupt(node))\n\n tickText.each((value: number | Date, i: number, elements: ArrayLike<SVGTextElement>) => {\n let text = config.tickFormat?.(value, i, tickValues) ?? `${value}`\n const textElement = elements[i] as SVGTextElement\n const textMaxWidth = config.tickTextWidth || (config.type === AxisType.X ? this._containerWidth / (ticks.size() + 1) : this._containerWidth / 5)\n const styleDeclaration = getComputedStyle(textElement)\n const fontSize = Number.parseFloat(styleDeclaration.fontSize)\n const fontFamily = styleDeclaration.fontFamily\n const textOptions: UnovisTextOptions = {\n verticalAlign: config.type === AxisType.X ? VerticalAlign.Top : VerticalAlign.Middle,\n width: textMaxWidth,\n textRotationAngle: config.tickTextAngle,\n separator: config.tickTextSeparator,\n wordBreak: config.tickTextForceWordBreak,\n }\n\n if (config.tickTextFitMode === FitMode.Trim) {\n const textElementSelection = select<SVGTextElement, string>(textElement).text(text)\n trimSVGText(textElementSelection, textMaxWidth, config.tickTextTrimType as TrimMode, true, fontSize, 0.58)\n text = select<SVGTextElement, string>(textElement).text()\n }\n\n const textBlock: UnovisText = { text, fontFamily, fontSize }\n renderTextToSvgTextElement(textElement, textBlock, textOptions)\n })\n\n selection\n .classed(s.axis, true)\n .classed(s.hideTickLine, !config.tickLine)\n .classed(s.hideDomain, !config.domainLine)\n\n if (config.fullSize) {\n const path = this._getFullDomainPath(0)\n smartTransition(selection.select('.domain'), duration).attr('d', path)\n }\n }\n\n private _resolveTickLabelOverlap (selection = this.axisGroup): void {\n const { config } = this\n const tickTextSelection = selection.selectAll<SVGTextElement, number | Date>('g.tick > text')\n\n if (!config.tickTextHideOverlapping) {\n tickTextSelection.style('opacity', null)\n return\n }\n\n cancelAnimationFrame(this._collideTickLabelsAnimFrameId)\n // Colliding labels in the next frame to prevent forced reflow\n this._collideTickLabelsAnimFrameId = requestAnimationFrame(() => {\n this._collideTickLabels(tickTextSelection)\n })\n }\n\n private _collideTickLabels (selection: Selection<SVGTextElement, number | Date, SVGGElement, unknown>): void {\n type SVGOverlappingTextElement = SVGTextElement & {\n _visible: boolean;\n }\n\n // Reset visibility of all labels\n selection.each((d, i, elements) => {\n const node = elements[i] as SVGOverlappingTextElement\n node._visible = true\n })\n\n // We do three iterations because not all overlapping labels can be resolved in the first iteration\n const numIterations = 3\n for (let i = 0; i < numIterations; i += 1) {\n // Run collision detection and set labels visibility\n selection.each((d, i, elements) => {\n const label1 = elements[i] as SVGOverlappingTextElement\n const isLabel1Visible = label1._visible\n if (!isLabel1Visible) return\n\n // Calculate bounding rect of point's label\n const label1BoundingRect = label1.getBoundingClientRect()\n\n for (let j = i + 1; j < elements.length; j += 1) {\n if (i === j) continue\n const label2 = elements[j] as SVGOverlappingTextElement\n const isLabel2Visible = label2._visible\n if (isLabel2Visible) {\n const label2BoundingRect = label2.getBoundingClientRect()\n const intersect = rectIntersect(label1BoundingRect, label2BoundingRect, -5)\n if (intersect) {\n label2._visible = false\n break\n }\n }\n }\n })\n }\n\n // Hide the overlapping labels\n selection.each((d, i, elements) => {\n const label = elements[i] as SVGOverlappingTextElement\n select(label).style('opacity', label._visible ? 1 : 0)\n })\n }\n\n private _getNumTicks (): number {\n const { config: { type, numTicks } } = this\n\n if (numTicks) return numTicks\n\n if (type === AxisType.X) {\n const xRange = this.xScale.range() as [number, number]\n const width = xRange[1] - xRange[0]\n return Math.floor(width / 175)\n }\n\n if (type === AxisType.Y) {\n const yRange = this.yScale.range() as [number, number]\n const height = Math.abs(yRange[0] - yRange[1])\n return Math.pow(height, 0.85) / 25\n }\n\n return this._defaultNumTicks\n }\n\n private _getConfiguredTickValues (): number[] | null {\n const { config } = this\n const scale = config.type === AxisType.X ? this.xScale : this.yScale\n const scaleDomain = scale?.domain() as [number, number]\n\n if (config.tickValues) {\n return config.tickValues.filter(v => (v >= scaleDomain[0]) && (v <= scaleDomain[1]))\n }\n\n if (config.minMaxTicksOnly || (config.type === AxisType.X && this._width < config.minMaxTicksOnlyWhenWidthIsLess)) {\n return scaleDomain as number[]\n }\n\n return null\n }\n\n private _getFullDomainPath (tickSize = 0): string {\n const { config: { type } } = this\n switch (type) {\n case AxisType.X: return `M0.5, ${tickSize} V0.5 H${this._width + 0.5} V${tickSize}`\n case AxisType.Y: return `M${-tickSize}, ${this._height + 0.5} H0.5 V0.5 H${-tickSize}`\n }\n }\n\n private _renderAxisLabel (selection = this.axisGroup): void {\n const { type, label, labelMargin, labelFontSize } = this.config\n\n // Remove the old label first to calculate the axis size properly\n selection.selectAll(`.${s.label}`).remove()\n\n // Calculate label position and rotation\n const axisPosition = this.getPosition()\n // We always use this.axisRenderHelperGroup to calculate the size of the axis because\n // this.axisGroup will give us incorrect values due to animation\n const { width: axisWidth, height: axisHeight } = this._axisRawBBox ?? selection.node().getBBox()\n\n const offsetX = type === AxisType.X ? this._width / 2 : (-1) ** (+(axisPosition === Position.Left)) * axisWidth\n const offsetY = type === AxisType.X ? (-1) ** (+(axisPosition === Position.Top)) * axisHeight : this._height / 2\n\n const marginX = type === AxisType.X ? 0 : (-1) ** (+(axisPosition === Position.Left)) * labelMargin\n const marginY = type === AxisType.X ? (-1) ** (+(axisPosition === Position.Top)) * labelMargin : 0\n\n const rotation = type === AxisType.Y ? -90 : 0\n // Append new label\n selection\n .append('text')\n .attr('class', s.label)\n .text(label)\n .attr('dy', `${this._getLabelDY()}em`)\n .attr('transform', `translate(${offsetX + marginX},${offsetY + marginY}) rotate(${rotation})`)\n .style('font-size', labelFontSize)\n .style('fill', this.config.labelColor)\n }\n\n private _getLabelDY (): number {\n const { type, position } = this.config\n switch (type) {\n case AxisType.X:\n switch (position) {\n case Position.Top: return 0\n case Position.Bottom: default: return 0.75\n }\n case AxisType.Y:\n switch (position) {\n case Position.Right: return 0.75\n case Position.Left: default: return -0.25\n }\n }\n }\n\n private _alignTickLabels (): void {\n const { config: { type, tickTextAlign, tickTextAngle, position } } = this\n const tickText = this.g.selectAll('g.tick > text')\n\n const textAnchor = this._getTickTextAnchor(tickTextAlign as TextAlign)\n const translateX = type === AxisType.X\n ? 0\n : this._getYTickTextTranslate(tickTextAlign as TextAlign, position as Position)\n\n const translateValue = tickTextAngle ? `translate(${translateX},0) rotate(${tickTextAngle})` : `translate(${translateX},0)`\n tickText\n .attr('transform', translateValue)\n .attr('text-anchor', textAnchor)\n }\n\n private _getTickTextAnchor (textAlign: TextAlign): string {\n switch (textAlign) {\n case TextAlign.Left: return 'start'\n case TextAlign.Right: return 'end'\n case TextAlign.Center: return 'middle'\n default: return null\n }\n }\n\n private _getYTickTextTranslate (textAlign: TextAlign, axisPosition: Position = Position.Left): number {\n const defaultTickTextSpacingPx = 9 // Default in D3\n const width = this._axisRawBBox.width - defaultTickTextSpacingPx\n\n switch (textAlign) {\n case TextAlign.Left: return axisPosition === Position.Left ? width * -1 : 0\n case TextAlign.Right: return axisPosition === Position.Left ? 0 : width\n case TextAlign.Center: return axisPosition === Position.Left ? width * (-0.5) : width * 0.5\n default: return 0\n }\n }\n}\n"],"names":["s.grid","s.tick","s.tickLabel","s.tickLabelHideable","s.axis","s.hideTickLine","s.hideDomain","label","s.label","s"],"mappings":";;;;;;;;;;;;;;;AA4BM,MAAO,IAAY,SAAQ,eAAkD,CAAA;AAejF,IAAA,WAAA,CAAa,MAAmC,EAAA;AAC9C,QAAA,KAAK,EAAE,CAAA;QAdC,IAAc,CAAA,cAAA,GAA+B,iBAAiB,CAAA;AACjE,QAAA,IAAA,CAAA,MAAM,GAA+B,IAAI,CAAC,cAAc,CAAA;QAOvD,IAAgB,CAAA,gBAAA,GAAG,CAAC,CAAA;QAGlB,IAAM,CAAA,MAAA,GAAG,EAAE,CAAA;AAInB,QAAA,IAAI,MAAM;AAAE,YAAA,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;QAClC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;QACnC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,GAA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,SAAA,GAAGE,KAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/axis/index.ts"],"sourcesContent":["import { select, Selection } from 'd3-selection'\nimport { interrupt } from 'd3-transition'\nimport { Axis as D3Axis, axisBottom, axisLeft, axisRight, axisTop } from 'd3-axis'\n\n// Core\nimport { XYComponentCore } from 'core/xy-component'\n\n// Types\nimport { Position } from 'types/position'\nimport { ContinuousScale } from 'types/scale'\nimport { Spacing } from 'types/spacing'\nimport { FitMode, TextAlign, TrimMode, UnovisText, UnovisTextOptions, VerticalAlign } from 'types/text'\n\n// Utils\nimport { smartTransition } from 'utils/d3'\nimport { renderTextToSvgTextElement, textAlignToAnchor, trimSVGText, wrapSVGText } from 'utils/text'\nimport { isEqual } from 'utils/data'\nimport { rectIntersect } from 'utils/misc'\n\n// Local Types\nimport { AxisType } from './types'\n\n// Config\nimport { AxisDefaultConfig, AxisConfigInterface } from './config'\n\n// Styles\nimport * as s from './style'\n\nexport class Axis<Datum> extends XYComponentCore<Datum, AxisConfigInterface<Datum>> {\n static selectors = s\n protected _defaultConfig: AxisConfigInterface<Datum> = AxisDefaultConfig\n public config: AxisConfigInterface<Datum> = this._defaultConfig\n private axisGroup: Selection<SVGGElement, unknown, SVGGElement, unknown>\n private gridGroup: Selection<SVGGElement, unknown, SVGGElement, unknown>\n\n private _axisRawBBox: DOMRect\n private _axisSizeBBox: SVGRect\n private _requiredMargin: Spacing\n private _defaultNumTicks = 3\n private _collideTickLabelsAnimFrameId: ReturnType<typeof requestAnimationFrame>\n\n protected events = {}\n\n constructor (config?: AxisConfigInterface<Datum>) {\n super()\n if (config) this.setConfig(config)\n this.axisGroup = this.g.append('g')\n this.gridGroup = this.g.append('g')\n .attr('class', s.grid)\n }\n\n /** Renders axis to an invisible grouped to calculate automatic chart margins */\n public preRender (): void {\n const { config } = this\n const axisRenderHelperGroup = this.g.append('g').attr('opacity', 0)\n\n this._renderAxis(axisRenderHelperGroup, 0)\n\n // Store axis raw BBox (without the label) for further label positioning (see _renderAxisLabel)\n this._axisRawBBox = axisRenderHelperGroup.node().getBBox()\n\n // Align tick text\n if (config.tickTextAlign) this._alignTickLabels()\n // Render label and store total axis size and required margins\n this._renderAxisLabel(axisRenderHelperGroup)\n this._axisSizeBBox = this._getAxisSize(axisRenderHelperGroup)\n this._requiredMargin = this._getRequiredMargin(this._axisSizeBBox)\n\n axisRenderHelperGroup.remove()\n }\n\n public getPosition (): Position {\n const { config: { type, position } } = this\n return (position ?? ((type === AxisType.X) ? Position.Bottom : Position.Left)) as Position\n }\n\n private _getAxisSize (selection: Selection<SVGGElement, unknown, SVGGElement, undefined>): SVGRect {\n const bBox = selection.node().getBBox()\n return bBox\n }\n\n private _getRequiredMargin (axisSize = this._axisSizeBBox): Spacing {\n const { config: { type, position } } = this\n\n switch (type) {\n case AxisType.X: {\n const tolerancePx = 1\n const xEnd = this._axisSizeBBox.x + this._axisSizeBBox.width\n\n const left = this._axisSizeBBox.x < 0 ? Math.abs(this._axisSizeBBox.x) : 0\n const right = (xEnd - this._width) > tolerancePx ? xEnd - this._width : 0\n\n switch (position) {\n case Position.Top: return { top: axisSize.height, left, right }\n case Position.Bottom: default: return { bottom: axisSize.height, left, right }\n }\n }\n case AxisType.Y: {\n const bleedY = axisSize.height > this._height ? (axisSize.height - this._height) / 2 : 0\n const top = bleedY\n const bottom = bleedY\n\n switch (position) {\n case Position.Right: return { right: axisSize.width, top, bottom }\n case Position.Left: default: return { left: axisSize.width, top, bottom }\n }\n }\n }\n }\n\n getRequiredMargin (): Spacing {\n return this._requiredMargin\n }\n\n /** Calculates axis transform:translate offset based on passed container margins */\n getOffset (containerMargin: Spacing): {left: number; top: number} {\n const { config: { type, position } } = this\n\n switch (type) {\n case AxisType.X:\n switch (position) {\n case Position.Top: return { top: containerMargin.top, left: containerMargin.left }\n case Position.Bottom: default: return { top: containerMargin.top + this._height, left: containerMargin.left }\n }\n case AxisType.Y:\n switch (position) {\n case Position.Right: return { top: containerMargin.top, left: containerMargin.left + this._width }\n case Position.Left: default: return { top: containerMargin.top, left: containerMargin.left }\n }\n }\n }\n\n public _render (duration = this.config.duration, selection = this.axisGroup): void {\n const { config } = this\n\n this._renderAxis(selection, duration)\n this._renderAxisLabel(selection)\n\n if (config.gridLine) {\n const gridGen = this._buildGrid().tickFormat(() => '')\n gridGen.tickValues(this._getConfiguredTickValues())\n // Interrupting all active transitions first to prevent them from being stuck.\n // Somehow we see it happening in Angular apps.\n this.gridGroup.selectAll('*').interrupt()\n smartTransition(this.gridGroup, duration).call(gridGen).style('opacity', 1)\n } else {\n smartTransition(this.gridGroup, duration).style('opacity', 0)\n }\n\n if (config.tickTextAlign) this._alignTickLabels()\n this._resolveTickLabelOverlap(selection)\n }\n\n private _buildAxis (): D3Axis<any> {\n const { config: { type, position, tickPadding } } = this\n\n const ticks = this._getNumTicks()\n switch (type) {\n case AxisType.X:\n switch (position) {\n case Position.Top: return axisTop(this.xScale).ticks(ticks).tickPadding(tickPadding)\n case Position.Bottom: default: return axisBottom(this.xScale).ticks(ticks).tickPadding(tickPadding)\n }\n case AxisType.Y:\n switch (position) {\n case Position.Right: return axisRight(this.yScale).ticks(ticks).tickPadding(tickPadding)\n case Position.Left: default: return axisLeft(this.yScale).ticks(ticks).tickPadding(tickPadding)\n }\n }\n }\n\n private _buildGrid (): D3Axis<any> {\n const { config: { type, position } } = this\n\n const ticks = this._getNumTicks()\n switch (type) {\n case AxisType.X:\n switch (position) {\n case Position.Top: return axisTop(this.xScale).ticks(ticks * 2).tickSize(-this._height).tickSizeOuter(0)\n case Position.Bottom: default: return axisBottom(this.xScale).ticks(ticks * 2).tickSize(-this._height).tickSizeOuter(0)\n }\n case AxisType.Y:\n switch (position) {\n case Position.Right: return axisRight(this.yScale).ticks(ticks * 2).tickSize(-this._width).tickSizeOuter(0)\n case Position.Left: default: return axisLeft(this.yScale).ticks(ticks * 2).tickSize(-this._width).tickSizeOuter(0)\n }\n }\n }\n\n private _renderAxis (selection = this.axisGroup, duration = this.config.duration): void {\n const { config } = this\n\n const axisGen = this._buildAxis()\n const tickValues: (number[] | Date[]) = this._getConfiguredTickValues() || axisGen.scale<ContinuousScale>().ticks(this._getNumTicks())\n axisGen.tickValues(tickValues)\n\n // Interrupting all active transitions first to prevent them from being stuck.\n // Somehow we see it happening in Angular apps.\n selection.selectAll('*').interrupt()\n smartTransition(selection, duration).call(axisGen)\n\n const ticks = selection.selectAll<SVGGElement, number | Date>('g.tick')\n\n ticks\n .classed(s.tick, true)\n .style('font-size', config.tickTextFontSize)\n\n // Selecting the <text> elements of the ticks to apply formatting. By default, this selection\n // will include exiting elements, so we're filtering them out.\n const tickText = selection.selectAll<SVGTextElement, number | Date>('g.tick > text')\n .filter(tickValue => tickValues.some((t: number | Date) => isEqual(tickValue, t))) // We use isEqual to compare Dates\n .classed(s.tickLabel, true)\n .classed(s.tickLabelHideable, Boolean(config.tickTextHideOverlapping))\n .style('fill', config.tickTextColor) as Selection<SVGTextElement, number, SVGGElement, unknown> | Selection<SVGTextElement, Date, SVGGElement, unknown>\n\n\n // We interrupt the transition on tick's <text> to make it 'wrappable'\n tickText.nodes().forEach(node => interrupt(node))\n\n tickText.each((value: number | Date, i: number, elements: ArrayLike<SVGTextElement>) => {\n let text = config.tickFormat?.(value, i, tickValues) ?? `${value}`\n const textElement = elements[i] as SVGTextElement\n const textMaxWidth = config.tickTextWidth || (config.type === AxisType.X ? this._containerWidth / (ticks.size() + 1) : this._containerWidth / 5)\n const styleDeclaration = getComputedStyle(textElement)\n const fontSize = Number.parseFloat(styleDeclaration.fontSize)\n const fontFamily = styleDeclaration.fontFamily\n const textOptions: UnovisTextOptions = {\n verticalAlign: config.type === AxisType.X ? VerticalAlign.Top : VerticalAlign.Middle,\n width: textMaxWidth,\n textRotationAngle: config.tickTextAngle,\n separator: config.tickTextSeparator,\n wordBreak: config.tickTextForceWordBreak,\n }\n\n if (config.tickTextFitMode === FitMode.Trim) {\n const textElementSelection = select<SVGTextElement, string>(textElement).text(text)\n trimSVGText(textElementSelection, textMaxWidth, config.tickTextTrimType as TrimMode, true, fontSize, 0.58)\n text = select<SVGTextElement, string>(textElement).text()\n }\n\n const textBlock: UnovisText = { text, fontFamily, fontSize }\n renderTextToSvgTextElement(textElement, textBlock, textOptions)\n })\n\n selection\n .classed(s.axis, true)\n .classed(s.hideTickLine, !config.tickLine)\n .classed(s.hideDomain, !config.domainLine)\n\n if (config.fullSize) {\n const path = this._getFullDomainPath(0)\n smartTransition(selection.select('.domain'), duration).attr('d', path)\n }\n }\n\n private _resolveTickLabelOverlap (selection = this.axisGroup): void {\n const { config } = this\n const tickTextSelection = selection.selectAll<SVGTextElement, number | Date>('g.tick > text')\n\n if (!config.tickTextHideOverlapping) {\n tickTextSelection.style('opacity', null)\n return\n }\n\n cancelAnimationFrame(this._collideTickLabelsAnimFrameId)\n // Colliding labels in the next frame to prevent forced reflow\n this._collideTickLabelsAnimFrameId = requestAnimationFrame(() => {\n this._collideTickLabels(tickTextSelection)\n })\n }\n\n private _collideTickLabels (selection: Selection<SVGTextElement, number | Date, SVGGElement, unknown>): void {\n type SVGOverlappingTextElement = SVGTextElement & {\n _visible: boolean;\n }\n\n // Reset visibility of all labels\n selection.each((d, i, elements) => {\n const node = elements[i] as SVGOverlappingTextElement\n node._visible = true\n })\n\n // We do three iterations because not all overlapping labels can be resolved in the first iteration\n const numIterations = 3\n for (let i = 0; i < numIterations; i += 1) {\n // Run collision detection and set labels visibility\n selection.each((d, i, elements) => {\n const label1 = elements[i] as SVGOverlappingTextElement\n const isLabel1Visible = label1._visible\n if (!isLabel1Visible) return\n\n // Calculate bounding rect of point's label\n const label1BoundingRect = label1.getBoundingClientRect()\n\n for (let j = i + 1; j < elements.length; j += 1) {\n if (i === j) continue\n const label2 = elements[j] as SVGOverlappingTextElement\n const isLabel2Visible = label2._visible\n if (isLabel2Visible) {\n const label2BoundingRect = label2.getBoundingClientRect()\n const intersect = rectIntersect(label1BoundingRect, label2BoundingRect, -5)\n if (intersect) {\n label2._visible = false\n break\n }\n }\n }\n })\n }\n\n // Hide the overlapping labels\n selection.each((d, i, elements) => {\n const label = elements[i] as SVGOverlappingTextElement\n select(label).style('opacity', label._visible ? 1 : 0)\n })\n }\n\n private _getNumTicks (): number {\n const { config: { type, numTicks } } = this\n\n if (numTicks) return numTicks\n\n if (type === AxisType.X) {\n const xRange = this.xScale.range() as [number, number]\n const width = xRange[1] - xRange[0]\n return Math.floor(width / 175)\n }\n\n if (type === AxisType.Y) {\n const yRange = this.yScale.range() as [number, number]\n const height = Math.abs(yRange[0] - yRange[1])\n return Math.pow(height, 0.85) / 25\n }\n\n return this._defaultNumTicks\n }\n\n private _getConfiguredTickValues (): number[] | null {\n const { config } = this\n const scale = config.type === AxisType.X ? this.xScale : this.yScale\n const scaleDomain = scale?.domain() as [number, number]\n\n if (config.tickValues) {\n return config.tickValues.filter(v => (v >= scaleDomain[0]) && (v <= scaleDomain[1]))\n }\n\n if (config.minMaxTicksOnly || (config.type === AxisType.X && this._width < config.minMaxTicksOnlyWhenWidthIsLess)) {\n return scaleDomain as number[]\n }\n\n return null\n }\n\n private _getFullDomainPath (tickSize = 0): string {\n const { config: { type } } = this\n switch (type) {\n case AxisType.X: return `M0.5, ${tickSize} V0.5 H${this._width + 0.5} V${tickSize}`\n case AxisType.Y: return `M${-tickSize}, ${this._height + 0.5} H0.5 V0.5 H${-tickSize}`\n }\n }\n\n private _renderAxisLabel (selection = this.axisGroup): void {\n const { type, label, labelMargin, labelFontSize, labelTextFitMode } = this.config\n\n // Remove the old label first to calculate the axis size properly\n selection.selectAll(`.${s.label}`).remove()\n\n if (!label) return\n\n // Calculate label position and rotation\n const axisPosition = this.getPosition()\n // We always use this.axisRenderHelperGroup to calculate the size of the axis because\n // this.axisGroup will give us incorrect values due to animation\n const { width: axisWidth, height: axisHeight } = this._axisRawBBox ?? selection.node().getBBox()\n\n const rotation = type === AxisType.Y ? -90 : 0\n\n // Create the text element (without transform first)\n const textElement = selection\n .append('text')\n .attr('class', s.label)\n .attr('dy', `${this._getLabelDY()}em`)\n .style('font-size', labelFontSize)\n .style('fill', this.config.labelColor)\n\n // Set the text content\n textElement.text(label)\n if (labelTextFitMode === FitMode.Wrap) {\n // For Y-axis, use the chart height as the maximum width before rotation\n const maxWidth = type === AxisType.Y ? this._height : this._width\n wrapSVGText(textElement, maxWidth)\n }\n\n // Calculate offset after wrapping to get accurate dimensions\n let labelWidth = axisWidth\n let labelHeight = axisHeight\n if (labelTextFitMode === FitMode.Wrap) {\n const labelBBox = textElement.node().getBBox()\n labelWidth = labelBBox.width\n labelHeight = labelBBox.height\n } else {\n const trimWidth = type === AxisType.X ? labelWidth : labelHeight\n const styleDeclaration = getComputedStyle(textElement.node())\n const fontSize = Number.parseFloat(styleDeclaration.fontSize)\n // Use the default fontWidthToHeightRatio\n trimSVGText(\n textElement,\n trimWidth,\n this.config.labelTextTrimType as TrimMode,\n true,\n fontSize\n )\n const trimmedBBox = textElement.node().getBBox()\n labelWidth = trimmedBBox.width\n labelHeight = trimmedBBox.height\n }\n\n /*\n we need to calculate the offset for the label based on the position and the fit mode\n for offsetX, applying Y label we need to check if it's wrap or trim, then set the offset accordingly.\n Same for offsetY, need to consider x label.\n */\n const offsetX = type === AxisType.X\n ? this._width / 2\n : type === AxisType.Y && labelTextFitMode === FitMode.Wrap\n ? (axisPosition === Position.Left) ? -labelHeight / 2 : 0\n : (-1) ** (+(axisPosition === Position.Left)) * axisWidth\n const offsetY = type === AxisType.Y\n ? this._height / 2\n : type === AxisType.X && labelTextFitMode === FitMode.Wrap\n ? (axisPosition === Position.Top) ? -axisHeight - labelHeight / 2 : axisHeight\n : (-1) ** (+(axisPosition === Position.Top)) * axisHeight\n\n const marginX = type === AxisType.X ? 0 : (labelTextFitMode === FitMode.Wrap ? (-1) ** (+(axisPosition === Position.Left)) * ((labelHeight / 2) + labelMargin * 2) : (axisPosition === Position.Right ? labelMargin : -labelMargin))\n const marginY = type === AxisType.X ? (-1) ** (+(axisPosition === Position.Top)) * labelMargin : 0\n\n // Apply transform and rotation after all calculations\n textElement.attr('transform', `translate(${offsetX + marginX},${offsetY + marginY}) rotate(${rotation})`)\n }\n\n private _getLabelDY (): number {\n const { type, position } = this.config\n switch (type) {\n case AxisType.X:\n switch (position) {\n case Position.Top: return 0\n case Position.Bottom: default: return 0.75\n }\n case AxisType.Y:\n switch (position) {\n case Position.Right: return 0.75\n case Position.Left: default: return -0.25\n }\n }\n }\n\n private _alignTickLabels (): void {\n const { config: { type, tickTextAlign, tickTextAngle, position } } = this\n const tickText = this.g.selectAll('g.tick > text')\n\n const textAnchor = textAlignToAnchor(tickTextAlign as TextAlign)\n const translateX = type === AxisType.X\n ? 0\n : this._getYTickTextTranslate(tickTextAlign as TextAlign, position as Position)\n\n const translateValue = tickTextAngle ? `translate(${translateX},0) rotate(${tickTextAngle})` : `translate(${translateX},0)`\n tickText\n .attr('transform', translateValue)\n .attr('text-anchor', textAnchor)\n }\n\n private _getYTickTextTranslate (textAlign: TextAlign, axisPosition: Position = Position.Left): number {\n const defaultTickTextSpacingPx = 9 // Default in D3\n const width = this._axisRawBBox.width - defaultTickTextSpacingPx\n\n switch (textAlign) {\n case TextAlign.Left: return axisPosition === Position.Left ? width * -1 : 0\n case TextAlign.Right: return axisPosition === Position.Left ? 0 : width\n case TextAlign.Center: return axisPosition === Position.Left ? width * (-0.5) : width * 0.5\n default: return 0\n }\n }\n}\n"],"names":["s.grid","s.tick","s.tickLabel","s.tickLabelHideable","s.axis","s.hideTickLine","s.hideDomain","label","s.label","s"],"mappings":";;;;;;;;;;;;;;;AA4BM,MAAO,IAAY,SAAQ,eAAkD,CAAA;AAejF,IAAA,WAAA,CAAa,MAAmC,EAAA;AAC9C,QAAA,KAAK,EAAE,CAAA;QAdC,IAAc,CAAA,cAAA,GAA+B,iBAAiB,CAAA;AACjE,QAAA,IAAA,CAAA,MAAM,GAA+B,IAAI,CAAC,cAAc,CAAA;QAOvD,IAAgB,CAAA,gBAAA,GAAG,CAAC,CAAA;QAGlB,IA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,QAAQ,SAAS;YACf,KAAK,SAAS,CAAC,IAAI,EAAE,OAAO,YAAY,KAAK,QAAQ,CAAC,IAAI,GAAG,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,CAAA;AAC3E,YAAA,KAAK,SAAS,CAAC,KAAK,EAAE,OAAO,YAAY,KAAK,QAAQ,CAAC,IAAI,GAAG,CAAC,GAAG,KAAK,CAAA;YACvE,KAAK,SAAS,CAAC,MAAM,EAAE,OAAO,YAAY,KAAK,QAAQ,CAAC,IAAI,GAAG,KAAK,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,GAAG,GAAG,CAAA;AAC3F,YAAA,SAAS,OAAO,CAAC,CAAA;AAClB,SAAA;KACF;;AApcM,IAAS,CAAA,SAAA,GAAGE,KAAC;;;;"}
|
|
@@ -1,5 +1,44 @@
|
|
|
1
1
|
export declare const root: string;
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const cssVarDefaults: {
|
|
3
|
+
'--vis-axis-tick-color': string;
|
|
4
|
+
'--vis-axis-grid-color': string;
|
|
5
|
+
'--vis-axis-grid-line-width': string;
|
|
6
|
+
'--vis-axis-grid-line-dasharray': string;
|
|
7
|
+
'--vis-axis-label-font-size': string;
|
|
8
|
+
'--vis-axis-label-color': string;
|
|
9
|
+
'--vis-axis-label-weight': string;
|
|
10
|
+
'--vis-axis-tick-label-color': string;
|
|
11
|
+
'--vis-axis-tick-label-font-size': string;
|
|
12
|
+
'--vis-axis-tick-label-weight': string;
|
|
13
|
+
'--vis-axis-tick-label-cursor': string;
|
|
14
|
+
'--vis-axis-tick-label-text-decoration': string;
|
|
15
|
+
'--vis-axis-tick-line-width': string;
|
|
16
|
+
'--vis-axis-tick-label-hide-transition': string;
|
|
17
|
+
'--vis-dark-axis-tick-color': string;
|
|
18
|
+
'--vis-dark-axis-tick-label-color': string;
|
|
19
|
+
'--vis-dark-axis-grid-color': string;
|
|
20
|
+
'--vis-dark-axis-label-color': string;
|
|
21
|
+
};
|
|
22
|
+
export declare const variables: {
|
|
23
|
+
axisTickColor: "--vis-axis-tick-color";
|
|
24
|
+
axisGridColor: "--vis-axis-grid-color";
|
|
25
|
+
axisGridLineWidth: "--vis-axis-grid-line-width";
|
|
26
|
+
axisGridLineDasharray: "--vis-axis-grid-line-dasharray";
|
|
27
|
+
axisLabelFontSize: "--vis-axis-label-font-size";
|
|
28
|
+
axisLabelColor: "--vis-axis-label-color";
|
|
29
|
+
axisLabelWeight: "--vis-axis-label-weight";
|
|
30
|
+
axisTickLabelColor: "--vis-axis-tick-label-color";
|
|
31
|
+
axisTickLabelFontSize: "--vis-axis-tick-label-font-size";
|
|
32
|
+
axisTickLabelWeight: "--vis-axis-tick-label-weight";
|
|
33
|
+
axisTickLabelCursor: "--vis-axis-tick-label-cursor";
|
|
34
|
+
axisTickLabelTextDecoration: "--vis-axis-tick-label-text-decoration";
|
|
35
|
+
axisTickLineWidth: "--vis-axis-tick-line-width";
|
|
36
|
+
axisTickLabelHideTransition: "--vis-axis-tick-label-hide-transition";
|
|
37
|
+
darkAxisTickColor: "--vis-dark-axis-tick-color";
|
|
38
|
+
darkAxisTickLabelColor: "--vis-dark-axis-tick-label-color";
|
|
39
|
+
darkAxisGridColor: "--vis-dark-axis-grid-color";
|
|
40
|
+
darkAxisLabelColor: "--vis-dark-axis-label-color";
|
|
41
|
+
};
|
|
3
42
|
export declare const hideTickLine: string;
|
|
4
43
|
export declare const hideDomain: string;
|
|
5
44
|
export declare const axis: string;
|
package/components/axis/style.js
CHANGED
|
@@ -1,41 +1,36 @@
|
|
|
1
|
-
import { css
|
|
1
|
+
import { css } from '@emotion/css';
|
|
2
|
+
import { getCssVarNames, injectGlobalCssVariables } from '../../utils/style.js';
|
|
2
3
|
|
|
3
4
|
const root = css `
|
|
4
5
|
label: axis-component;
|
|
5
6
|
`;
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
--vis-axis-
|
|
11
|
-
|
|
12
|
-
--vis-axis-grid-
|
|
13
|
-
--vis-axis-
|
|
14
|
-
--vis-axis-
|
|
15
|
-
--vis-axis-
|
|
16
|
-
--vis-axis-
|
|
17
|
-
--vis-axis-tick-label-
|
|
18
|
-
--vis-axis-label-font-size:
|
|
19
|
-
--vis-axis-tick-
|
|
20
|
-
--vis-axis-tick-label-
|
|
21
|
-
--vis-axis-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
--vis-
|
|
25
|
-
|
|
26
|
-
--vis-dark-axis-
|
|
27
|
-
--vis-dark-axis-
|
|
28
|
-
--vis-dark-axis-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
--vis-axis-domain-color: var(--vis-dark-axis-domain-color);
|
|
34
|
-
--vis-axis-tick-label-color: var(--vis-dark-axis-tick-label-color);
|
|
35
|
-
--vis-axis-grid-color: var(--vis-dark-axis-grid-color);
|
|
36
|
-
--vis-axis-label-color: var(--vis-dark-axis-label-color);
|
|
37
|
-
}
|
|
38
|
-
`;
|
|
7
|
+
const cssVarDefaults = {
|
|
8
|
+
// Undefined by default to allow proper fallback to var(--vis-font-family)
|
|
9
|
+
/* --vis-axis-font-family: */
|
|
10
|
+
'--vis-axis-tick-color': '#e8e9ef',
|
|
11
|
+
/* --vis-axis-domain-color: // Undefined by default to allow fallback to var(--vis-axis-tick-color) */
|
|
12
|
+
'--vis-axis-grid-color': '#e8e9ef',
|
|
13
|
+
'--vis-axis-grid-line-width': '1px',
|
|
14
|
+
'--vis-axis-grid-line-dasharray': 'none',
|
|
15
|
+
'--vis-axis-label-font-size': '14px',
|
|
16
|
+
'--vis-axis-label-color': '#6c778c',
|
|
17
|
+
'--vis-axis-label-weight': '500',
|
|
18
|
+
'--vis-axis-tick-label-color': '#6c778c',
|
|
19
|
+
'--vis-axis-tick-label-font-size': '12px',
|
|
20
|
+
'--vis-axis-tick-label-weight': '500',
|
|
21
|
+
'--vis-axis-tick-label-cursor': 'default',
|
|
22
|
+
'--vis-axis-tick-label-text-decoration': 'none',
|
|
23
|
+
'--vis-axis-tick-line-width': '1px',
|
|
24
|
+
'--vis-axis-tick-label-hide-transition': 'opacity 400ms ease-in-out',
|
|
25
|
+
/* --vis-axis-domain-line-width: // Undefined by default to allow fallback to var(--vis-axis-grid-line-width) */
|
|
26
|
+
'--vis-dark-axis-tick-color': '#6c778c',
|
|
27
|
+
/* --vis-dark-axis-domain-color: // Undefined by default to allow fallback to var(--vis-dark-axis-tick-color) */
|
|
28
|
+
'--vis-dark-axis-tick-label-color': '#e8e9ef',
|
|
29
|
+
'--vis-dark-axis-grid-color': '#6c778c',
|
|
30
|
+
'--vis-dark-axis-label-color': '#fefefe',
|
|
31
|
+
};
|
|
32
|
+
const variables = getCssVarNames(cssVarDefaults);
|
|
33
|
+
injectGlobalCssVariables(cssVarDefaults, root);
|
|
39
34
|
const hideTickLine = css `
|
|
40
35
|
label: hide-tick-line;
|
|
41
36
|
`;
|
|
@@ -50,6 +45,7 @@ const axis = css `
|
|
|
50
45
|
.domain {
|
|
51
46
|
stroke: var(--vis-axis-domain-color, var(--vis-axis-tick-color));
|
|
52
47
|
stroke-width: var(--vis-axis-domain-line-width, var(--vis-axis-grid-line-width));
|
|
48
|
+
stroke-dasharray: var(--vis-axis-domain-line-dasharray, var(--vis-axis-grid-line-dasharray));
|
|
53
49
|
}
|
|
54
50
|
|
|
55
51
|
&${`.${hideTickLine}`} {
|
|
@@ -74,6 +70,7 @@ const grid = css `
|
|
|
74
70
|
line {
|
|
75
71
|
stroke: var(--vis-axis-grid-color);
|
|
76
72
|
stroke-width: var(--vis-axis-grid-line-width);
|
|
73
|
+
stroke-dasharray: var(--vis-axis-grid-line-dasharray);
|
|
77
74
|
}
|
|
78
75
|
`;
|
|
79
76
|
const tick = css `
|
|
@@ -81,6 +78,7 @@ const tick = css `
|
|
|
81
78
|
|
|
82
79
|
stroke: none;
|
|
83
80
|
font-size: var(--vis-axis-tick-label-font-size);
|
|
81
|
+
font-weight: var(--vis-axis-tick-label-weight);
|
|
84
82
|
|
|
85
83
|
line {
|
|
86
84
|
stroke: var(--vis-axis-tick-color);
|
|
@@ -99,6 +97,7 @@ const label = css `
|
|
|
99
97
|
label: label;
|
|
100
98
|
fill: var(--vis-axis-label-color);
|
|
101
99
|
font-size: var(--vis-axis-label-font-size);
|
|
100
|
+
font-weight: var(--vis-axis-label-weight);
|
|
102
101
|
font-family: var(--vis-axis-font-family, var(--vis-font-family));
|
|
103
102
|
text-anchor: middle;
|
|
104
103
|
`;
|
|
@@ -111,5 +110,5 @@ const tickLabelHideable = css `
|
|
|
111
110
|
transition: var(--vis-axis-tick-label-hide-transition);
|
|
112
111
|
`;
|
|
113
112
|
|
|
114
|
-
export { axis,
|
|
113
|
+
export { axis, cssVarDefaults, grid, hideDomain, hideTickLine, label, root, tick, tickLabel, tickLabelHideable, variables };
|
|
115
114
|
//# sourceMappingURL=style.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.js","sources":["../../../src/components/axis/style.ts"],"sourcesContent":["import { css
|
|
1
|
+
{"version":3,"file":"style.js","sources":["../../../src/components/axis/style.ts"],"sourcesContent":["import { css } from '@emotion/css'\nimport { getCssVarNames, injectGlobalCssVariables } from 'utils/style'\n\nexport const root = css`\n label: axis-component;\n`\n\nexport const cssVarDefaults = {\n // Undefined by default to allow proper fallback to var(--vis-font-family)\n /* --vis-axis-font-family: */\n '--vis-axis-tick-color': '#e8e9ef',\n /* --vis-axis-domain-color: // Undefined by default to allow fallback to var(--vis-axis-tick-color) */\n '--vis-axis-grid-color': '#e8e9ef',\n '--vis-axis-grid-line-width': '1px',\n '--vis-axis-grid-line-dasharray': 'none',\n\n '--vis-axis-label-font-size': '14px',\n '--vis-axis-label-color': '#6c778c',\n '--vis-axis-label-weight': '500',\n\n '--vis-axis-tick-label-color': '#6c778c',\n '--vis-axis-tick-label-font-size': '12px',\n '--vis-axis-tick-label-weight': '500',\n '--vis-axis-tick-label-cursor': 'default',\n '--vis-axis-tick-label-text-decoration': 'none',\n\n '--vis-axis-tick-line-width': '1px',\n '--vis-axis-tick-label-hide-transition': 'opacity 400ms ease-in-out',\n\n /* --vis-axis-domain-line-width: // Undefined by default to allow fallback to var(--vis-axis-grid-line-width) */\n\n '--vis-dark-axis-tick-color': '#6c778c',\n /* --vis-dark-axis-domain-color: // Undefined by default to allow fallback to var(--vis-dark-axis-tick-color) */\n '--vis-dark-axis-tick-label-color': '#e8e9ef',\n '--vis-dark-axis-grid-color': '#6c778c',\n '--vis-dark-axis-label-color': '#fefefe',\n}\n\nexport const variables = getCssVarNames(cssVarDefaults)\ninjectGlobalCssVariables(cssVarDefaults, root)\n\nexport const hideTickLine = css`\n label: hide-tick-line;\n`\n\nexport const hideDomain = css`\n label: hide-domain;\n`\n\nexport const axis = css`\n label: axis;\n\n user-select: none;\n\n .domain {\n stroke: var(--vis-axis-domain-color, var(--vis-axis-tick-color));\n stroke-width: var(--vis-axis-domain-line-width, var(--vis-axis-grid-line-width));\n stroke-dasharray: var(--vis-axis-domain-line-dasharray, var(--vis-axis-grid-line-dasharray));\n }\n\n &${`.${hideTickLine}`} {\n .tick > line {\n opacity: 0;\n }\n }\n\n &${`.${hideDomain}`} {\n .domain {\n opacity: 0;\n }\n }\n`\n\nexport const grid = css`\n label: grid;\n\n .domain {\n opacity: 0;\n }\n\n line {\n stroke: var(--vis-axis-grid-color);\n stroke-width: var(--vis-axis-grid-line-width);\n stroke-dasharray: var(--vis-axis-grid-line-dasharray);\n }\n`\n\nexport const tick = css`\n label: tick;\n\n stroke: none;\n font-size: var(--vis-axis-tick-label-font-size);\n font-weight: var(--vis-axis-tick-label-weight);\n\n line {\n stroke: var(--vis-axis-tick-color);\n stroke-width: var(--vis-axis-tick-line-width);\n }\n\n text {\n fill: var(--vis-axis-tick-label-color);\n cursor: var(--vis-axis-tick-label-cursor);\n font-family: var(--vis-axis-font-family, var(--vis-font-family));\n text-decoration: var(--vis-axis-tick-label-text-decoration);\n stroke: none;\n }\n`\n\nexport const label = css`\n label: label;\n fill: var(--vis-axis-label-color);\n font-size: var(--vis-axis-label-font-size);\n font-weight: var(--vis-axis-label-weight);\n font-family: var(--vis-axis-font-family, var(--vis-font-family));\n text-anchor: middle;\n`\n\nexport const tickLabel = css`\n label: tick-label;\n`\n\nexport const tickLabelHideable = css`\n label: tick-label-hideable;\n opacity: 0;\n transition: var(--vis-axis-tick-label-hide-transition);\n`\n"],"names":[],"mappings":";;;AAGO,MAAM,IAAI,GAAG,GAAG,CAAA,CAAA;;EAEtB;AAEY,MAAA,cAAc,GAAG;;;AAG5B,IAAA,uBAAuB,EAAE,SAAS;;AAElC,IAAA,uBAAuB,EAAE,SAAS;AAClC,IAAA,4BAA4B,EAAE,KAAK;AACnC,IAAA,gCAAgC,EAAE,MAAM;AAExC,IAAA,4BAA4B,EAAE,MAAM;AACpC,IAAA,wBAAwB,EAAE,SAAS;AACnC,IAAA,yBAAyB,EAAE,KAAK;AAEhC,IAAA,6BAA6B,EAAE,SAAS;AACxC,IAAA,iCAAiC,EAAE,MAAM;AACzC,IAAA,8BAA8B,EAAE,KAAK;AACrC,IAAA,8BAA8B,EAAE,SAAS;AACzC,IAAA,uCAAuC,EAAE,MAAM;AAE/C,IAAA,4BAA4B,EAAE,KAAK;AACnC,IAAA,uCAAuC,EAAE,2BAA2B;;AAIpE,IAAA,4BAA4B,EAAE,SAAS;;AAEvC,IAAA,kCAAkC,EAAE,SAAS;AAC7C,IAAA,4BAA4B,EAAE,SAAS;AACvC,IAAA,6BAA6B,EAAE,SAAS;EACzC;MAEY,SAAS,GAAG,cAAc,CAAC,cAAc,EAAC;AACvD,wBAAwB,CAAC,cAAc,EAAE,IAAI,CAAC,CAAA;AAEvC,MAAM,YAAY,GAAG,GAAG,CAAA,CAAA;;EAE9B;AAEM,MAAM,UAAU,GAAG,GAAG,CAAA,CAAA;;EAE5B;AAEM,MAAM,IAAI,GAAG,GAAG,CAAA,CAAA;;;;;;;;;;;AAWlB,GAAA,EAAA,CAAA,CAAA,EAAI,YAAY,CAAE,CAAA,CAAA;;;;;;AAMlB,GAAA,EAAA,CAAA,CAAA,EAAI,UAAU,CAAE,CAAA,CAAA;;;;;EAKpB;AAEM,MAAM,IAAI,GAAG,GAAG,CAAA,CAAA;;;;;;;;;;;;EAYtB;AAEM,MAAM,IAAI,GAAG,GAAG,CAAA,CAAA;;;;;;;;;;;;;;;;;;;EAmBtB;AAEM,MAAM,KAAK,GAAG,GAAG,CAAA,CAAA;;;;;;;EAOvB;AAEM,MAAM,SAAS,GAAG,GAAG,CAAA,CAAA;;EAE3B;AAEM,MAAM,iBAAiB,GAAG,GAAG,CAAA,CAAA;;;;;;;;"}
|
|
@@ -25,7 +25,7 @@ export interface BrushConfigInterface<Datum> extends Partial<XYComponentConfigIn
|
|
|
25
25
|
/** Allow dragging the selected area as a whole in order to change the selected range. Default: `false` */
|
|
26
26
|
draggable?: boolean;
|
|
27
27
|
/** Position of the handle: `Arrangement.Inside` or `Arrangement.Outside`. Default: `Arrangement.Inside` */
|
|
28
|
-
handlePosition?: Arrangement | string;
|
|
28
|
+
handlePosition?: Arrangement.Inside | Arrangement.Outside | string;
|
|
29
29
|
/** Constraint Brush selection to a minimal length in data units. Default: `undefined` */
|
|
30
30
|
selectionMinLength?: number;
|
|
31
31
|
}
|