@unovis/ts 1.1.2-beta.7 → 1.1.2-beta.9
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/axis/config.d.ts +2 -2
- package/components/axis/config.js +1 -1
- package/components/axis/config.js.map +1 -1
- package/components/axis/index.js +5 -2
- package/components/axis/index.js.map +1 -1
- package/components/axis/style.d.ts +1 -1
- package/components/axis/style.js +8 -4
- package/components/axis/style.js.map +1 -1
- package/components/leaflet-map/config.d.ts +5 -0
- package/components/leaflet-map/config.js +1 -0
- package/components/leaflet-map/config.js.map +1 -1
- package/components/leaflet-map/index.d.ts +1 -0
- package/components/leaflet-map/index.js +6 -2
- package/components/leaflet-map/index.js.map +1 -1
- package/components/nested-donut/index.js +30 -19
- package/components/nested-donut/index.js.map +1 -1
- package/components/nested-donut/style.js +1 -1
- package/components/nested-donut/style.js.map +1 -1
- package/components/nested-donut/types.d.ts +1 -1
- package/components/nested-donut/types.js +2 -6
- package/components/nested-donut/types.js.map +1 -1
- package/core/container/config.d.ts +5 -0
- package/core/container/config.js +1 -0
- package/core/container/config.js.map +1 -1
- package/core/container/index.js +13 -4
- package/core/container/index.js.map +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
- package/styles/index.d.ts +1 -0
- package/styles/index.js +2 -1
- package/styles/index.js.map +1 -1
- package/types.js +1 -1
- package/utils/resize-observer.js +1 -1
- package/utils/resize-observer.js.map +1 -1
- package/utils/text.js +17 -9
- package/utils/text.js.map +1 -1
|
@@ -33,7 +33,7 @@ export interface AxisConfigInterface<Datum> extends Partial<XYComponentConfigInt
|
|
|
33
33
|
tickTextFitMode?: FitMode | string;
|
|
34
34
|
/** Maximum width in pixels for the tick text to be wrapped or trimmed. Default: `undefined` */
|
|
35
35
|
tickTextWidth?: number;
|
|
36
|
-
/** Tick text wrapping separator. String or array of strings. Default: `
|
|
36
|
+
/** Tick text wrapping separator. String or array of strings. Default: `undefined` */
|
|
37
37
|
tickTextSeparator?: string | string[];
|
|
38
38
|
/** Force word break for ticks when they don't fit. Default: `false` */
|
|
39
39
|
tickTextForceWordBreak?: boolean;
|
|
@@ -57,7 +57,7 @@ export declare class AxisConfig<Datum> extends XYComponentConfig<Datum> implemen
|
|
|
57
57
|
numTicks: any;
|
|
58
58
|
minMaxTicksOnly: boolean;
|
|
59
59
|
tickTextWidth: any;
|
|
60
|
-
tickTextSeparator:
|
|
60
|
+
tickTextSeparator: any;
|
|
61
61
|
tickTextForceWordBreak: boolean;
|
|
62
62
|
tickTextTrimType: TrimMode;
|
|
63
63
|
tickTextFitMode: FitMode;
|
|
@@ -14,7 +14,7 @@ class AxisConfig extends XYComponentConfig {
|
|
|
14
14
|
this.numTicks = undefined;
|
|
15
15
|
this.minMaxTicksOnly = false;
|
|
16
16
|
this.tickTextWidth = undefined;
|
|
17
|
-
this.tickTextSeparator =
|
|
17
|
+
this.tickTextSeparator = undefined;
|
|
18
18
|
this.tickTextForceWordBreak = false;
|
|
19
19
|
this.tickTextTrimType = TrimMode.Middle;
|
|
20
20
|
this.tickTextFitMode = FitMode.Wrap;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sources":["../../../src/components/axis/config.ts"],"sourcesContent":["import { XYComponentConfigInterface, XYComponentConfig } 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 /** 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 the min and max axis ticks only. Default: `false` */\n minMaxTicksOnly?: boolean;\n /** Tick label formatter function. Default: `undefined` */\n tickFormat?: ((tick: number, i: number, ticks: number[]) => string) | ((tick: Date, i: number, ticks: 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: `
|
|
1
|
+
{"version":3,"file":"config.js","sources":["../../../src/components/axis/config.ts"],"sourcesContent":["import { XYComponentConfigInterface, XYComponentConfig } 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 /** 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 the min and max axis ticks only. Default: `false` */\n minMaxTicksOnly?: boolean;\n /** Tick label formatter function. Default: `undefined` */\n tickFormat?: ((tick: number, i: number, ticks: number[]) => string) | ((tick: Date, i: number, ticks: 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 /** The spacing in pixels between the tick and it's label. Default: `8` */\n tickPadding?: number;\n}\n\nexport class AxisConfig<Datum> extends XYComponentConfig<Datum> implements AxisConfigInterface<Datum> {\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 tickTextWidth = undefined\n tickTextSeparator = undefined\n tickTextForceWordBreak = false\n tickTextTrimType = TrimMode.Middle\n tickTextFitMode = FitMode.Wrap\n tickTextFontSize = null\n tickTextAlign = undefined\n labelMargin = 8\n tickFormat = undefined\n tickValues = undefined\n fullSize = true\n tickPadding = 8\n}\n"],"names":[],"mappings":";;;AAqDM,MAAO,UAAkB,SAAQ,iBAAwB,CAAA;AAA/D,IAAA,WAAA,GAAA;;QACE,IAAQ,CAAA,QAAA,GAAG,SAAS,CAAA;QACpB,IAAI,CAAA,IAAA,GAAG,SAAS,CAAA;QAChB,IAAK,CAAA,KAAA,GAAG,SAAS,CAAA;QACjB,IAAa,CAAA,aAAA,GAAG,IAAI,CAAA;QACpB,IAAQ,CAAA,QAAA,GAAG,IAAI,CAAA;QACf,IAAQ,CAAA,QAAA,GAAG,IAAI,CAAA;QACf,IAAU,CAAA,UAAA,GAAG,IAAI,CAAA;QACjB,IAAQ,CAAA,QAAA,GAAG,SAAS,CAAA;QACpB,IAAe,CAAA,eAAA,GAAG,KAAK,CAAA;QACvB,IAAa,CAAA,aAAA,GAAG,SAAS,CAAA;QACzB,IAAiB,CAAA,iBAAA,GAAG,SAAS,CAAA;QAC7B,IAAsB,CAAA,sBAAA,GAAG,KAAK,CAAA;AAC9B,QAAA,IAAA,CAAA,gBAAgB,GAAG,QAAQ,CAAC,MAAM,CAAA;AAClC,QAAA,IAAA,CAAA,eAAe,GAAG,OAAO,CAAC,IAAI,CAAA;QAC9B,IAAgB,CAAA,gBAAA,GAAG,IAAI,CAAA;QACvB,IAAa,CAAA,aAAA,GAAG,SAAS,CAAA;QACzB,IAAW,CAAA,WAAA,GAAG,CAAC,CAAA;QACf,IAAU,CAAA,UAAA,GAAG,SAAS,CAAA;QACtB,IAAU,CAAA,UAAA,GAAG,SAAS,CAAA;QACtB,IAAQ,CAAA,QAAA,GAAG,IAAI,CAAA;QACf,IAAW,CAAA,WAAA,GAAG,CAAC,CAAA;KAChB;AAAA;;;;"}
|
package/components/axis/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import { isEqual } from '../../utils/data.js';
|
|
|
10
10
|
import { AxisType } from './types.js';
|
|
11
11
|
import { AxisConfig } from './config.js';
|
|
12
12
|
import * as style from './style.js';
|
|
13
|
-
import { grid, tick, axis, hideTickLine, hideDomain, label } from './style.js';
|
|
13
|
+
import { grid, tick, tickLabel, axis, hideTickLine, hideDomain, label } from './style.js';
|
|
14
14
|
|
|
15
15
|
class Axis extends XYComponentCore {
|
|
16
16
|
constructor(config) {
|
|
@@ -166,7 +166,8 @@ class Axis extends XYComponentCore {
|
|
|
166
166
|
// Selecting the <text> elements of the ticks to apply formatting. By default, this selection
|
|
167
167
|
// will include exiting elements, so we're filtering them out.
|
|
168
168
|
const tickText = selection.selectAll('g.tick > text')
|
|
169
|
-
.filter(tickValue => tickValues.some(t => isEqual(tickValue, t)))
|
|
169
|
+
.filter(tickValue => tickValues.some(t => isEqual(tickValue, t))) // We use isEqual to compare Dates
|
|
170
|
+
.classed(tickLabel, true);
|
|
170
171
|
// We interrupt the transition on tick's <text> to make it 'wrappable'
|
|
171
172
|
tickText.nodes().forEach(node => interrupt(node));
|
|
172
173
|
tickText.each((value, i, elements) => {
|
|
@@ -186,6 +187,8 @@ class Axis extends XYComponentCore {
|
|
|
186
187
|
const textOptions = {
|
|
187
188
|
verticalAlign: config.type === AxisType.X ? VerticalAlign.Top : VerticalAlign.Middle,
|
|
188
189
|
width: textMaxWidth,
|
|
190
|
+
separator: config.tickTextSeparator,
|
|
191
|
+
wordBreak: config.tickTextForceWordBreak,
|
|
189
192
|
};
|
|
190
193
|
renderTextToSvgTextElement(textElement, textBlock, textOptions);
|
|
191
194
|
}
|
|
@@ -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, 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'\n\n// Local Types\nimport { AxisType } from './types'\n\n// Config\nimport { AxisConfig, AxisConfigInterface } from './config'\n\n// Styles\nimport * as s from './style'\n\nexport class Axis<Datum> extends XYComponentCore<Datum, AxisConfig<Datum>, AxisConfigInterface<Datum>> {\n static selectors = s\n config: AxisConfig<Datum> = new AxisConfig<Datum>()\n axisGroup: Selection<SVGGElement, unknown, SVGGElement, unknown>\n 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 _minMaxTicksOnlyEnforceWidth = 250\n\n events = {}\n\n constructor (config?: AxisConfigInterface<Datum>) {\n super()\n if (config) this.config.init(config)\n\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 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 getPosition (): Position {\n const { config: { type, position } } = this\n return (position ?? ((type === AxisType.X) ? Position.Bottom : Position.Left)) as Position\n }\n\n _getAxisSize (selection: Selection<SVGGElement, unknown, SVGGElement, undefined>): SVGRect {\n const bBox = selection.node().getBBox()\n return bBox\n }\n\n _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 _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\n _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 _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 _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 => isEqual(tickValue, t))) // We use isEqual to compare Dates\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, i, elements) => {\n const text = config.tickFormat?.(value, i, tickValues) ?? `${value}`\n const textElement = elements[i]\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\n if (config.tickTextFitMode === FitMode.Trim) {\n const textElementSelection = select<SVGTextElement, string>(textElement).text(text)\n trimSVGText(textElementSelection, textMaxWidth, config.tickTextTrimType, true, fontSize, 0.58)\n } else {\n const textBlock: UnovisText = { text, fontFamily, fontSize }\n const textOptions: UnovisTextOptions = {\n verticalAlign: config.type === AxisType.X ? VerticalAlign.Top : VerticalAlign.Middle,\n width: textMaxWidth,\n }\n renderTextToSvgTextElement(textElement, textBlock, textOptions)\n }\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 _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 _getConfiguredTickValues (): number[] | null {\n const { config: { tickValues, type, minMaxTicksOnly } } = this\n const scale = type === AxisType.X ? this.xScale : this.yScale\n const scaleDomain = scale?.domain()\n\n if (tickValues) {\n return tickValues.filter(v => (v >= scaleDomain[0]) && (v <= scaleDomain[1]))\n }\n\n if (minMaxTicksOnly || (type === AxisType.X && this._width < this._minMaxTicksOnlyEnforceWidth)) {\n return scaleDomain as number[]\n }\n\n return null\n }\n\n _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 _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\n // Append new label\n selection\n .append('text')\n .attr('class', s.label)\n .text(label)\n .style('font-size', labelFontSize)\n .attr('dy', `${this._getLabelDY()}em`)\n .attr('transform', `translate(${offsetX + marginX},${offsetY + marginY}) rotate(${rotation})`)\n }\n\n _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 _alignTickLabels (): void {\n const { config: { type, tickTextAlign, position } } = this\n\n const tickText = this.g.selectAll('g.tick > text')\n const textAnchor = this._getTickTextAnchor(tickTextAlign)\n const translateX = type === AxisType.X ? 0 : this._getYTickTextTranslate(tickTextAlign, position)\n\n tickText\n .attr('text-anchor', textAnchor)\n .attr('transform', `translate(${translateX},0)`)\n }\n\n _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 _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.axis","s.hideTickLine","s.hideDomain","label","s.label","s"],"mappings":";;;;;;;;;;;;;;AA2BM,MAAO,IAAY,SAAQ,eAAqE,CAAA;AAcpG,IAAA,WAAA,CAAa,MAAmC,EAAA;AAC9C,QAAA,KAAK,EAAE,CAAA;AAbT,QAAA,IAAA,CAAA,MAAM,GAAsB,IAAI,UAAU,EAAS,CAAA;QAO3C,IAAgB,CAAA,gBAAA,GAAG,CAAC,CAAA;QACpB,IAA4B,CAAA,4BAAA,GAAG,GAAG,CAAA;QAE1C,IAAM,CAAA,MAAA,GAAG,EAAE,CAAA;AAIT,QAAA,IAAI,MAAM;AAAE,YAAA,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QAEpC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;QACnC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;AAChC,aAAA,IAAI,CAAC,OAAO,EAAEA,IAAM,CAAC,CAAA;KACzB;;IAGD,SAAS,GAAA;AACP,QAAA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,EAAE,OAAO,KAAK,CAAA;AAClC,YAAA,KAAK,SAAS,CAAC,MAAM,EAAE,OAAO,QAAQ,CAAA;AACtC,YAAA,SAAS,OAAO,IAAI,CAAA;AACrB,SAAA;KACF;AAED,IAAA,sBAAsB,CAAE,SAAoB,EAAE,YAAyB,GAAA,QAAQ,CAAC,IAAI,EAAA;AAClF,QAAA,MAAM,wBAAwB,GAAG,CAAC,CAAA;QAClC,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC,KAAK,GAAG,wBAAwB,CAAA;AAEhE,QAAA,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;;AAnVM,IAAS,CAAA,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, 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'\n\n// Local Types\nimport { AxisType } from './types'\n\n// Config\nimport { AxisConfig, AxisConfigInterface } from './config'\n\n// Styles\nimport * as s from './style'\n\nexport class Axis<Datum> extends XYComponentCore<Datum, AxisConfig<Datum>, AxisConfigInterface<Datum>> {\n static selectors = s\n config: AxisConfig<Datum> = new AxisConfig<Datum>()\n axisGroup: Selection<SVGGElement, unknown, SVGGElement, unknown>\n 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 _minMaxTicksOnlyEnforceWidth = 250\n\n events = {}\n\n constructor (config?: AxisConfigInterface<Datum>) {\n super()\n if (config) this.config.init(config)\n\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 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 getPosition (): Position {\n const { config: { type, position } } = this\n return (position ?? ((type === AxisType.X) ? Position.Bottom : Position.Left)) as Position\n }\n\n _getAxisSize (selection: Selection<SVGGElement, unknown, SVGGElement, undefined>): SVGRect {\n const bBox = selection.node().getBBox()\n return bBox\n }\n\n _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 _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\n _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 _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 _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 => isEqual(tickValue, t))) // We use isEqual to compare Dates\n .classed(s.tickLabel, true)\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, i, elements) => {\n const text = config.tickFormat?.(value, i, tickValues) ?? `${value}`\n const textElement = elements[i]\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\n if (config.tickTextFitMode === FitMode.Trim) {\n const textElementSelection = select<SVGTextElement, string>(textElement).text(text)\n trimSVGText(textElementSelection, textMaxWidth, config.tickTextTrimType, true, fontSize, 0.58)\n } else {\n const textBlock: UnovisText = { text, fontFamily, fontSize }\n const textOptions: UnovisTextOptions = {\n verticalAlign: config.type === AxisType.X ? VerticalAlign.Top : VerticalAlign.Middle,\n width: textMaxWidth,\n separator: config.tickTextSeparator,\n wordBreak: config.tickTextForceWordBreak,\n }\n renderTextToSvgTextElement(textElement, textBlock, textOptions)\n }\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 _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 _getConfiguredTickValues (): number[] | null {\n const { config: { tickValues, type, minMaxTicksOnly } } = this\n const scale = type === AxisType.X ? this.xScale : this.yScale\n const scaleDomain = scale?.domain()\n\n if (tickValues) {\n return tickValues.filter(v => (v >= scaleDomain[0]) && (v <= scaleDomain[1]))\n }\n\n if (minMaxTicksOnly || (type === AxisType.X && this._width < this._minMaxTicksOnlyEnforceWidth)) {\n return scaleDomain as number[]\n }\n\n return null\n }\n\n _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 _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\n // Append new label\n selection\n .append('text')\n .attr('class', s.label)\n .text(label)\n .style('font-size', labelFontSize)\n .attr('dy', `${this._getLabelDY()}em`)\n .attr('transform', `translate(${offsetX + marginX},${offsetY + marginY}) rotate(${rotation})`)\n }\n\n _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 _alignTickLabels (): void {\n const { config: { type, tickTextAlign, position } } = this\n\n const tickText = this.g.selectAll('g.tick > text')\n const textAnchor = this._getTickTextAnchor(tickTextAlign)\n const translateX = type === AxisType.X ? 0 : this._getYTickTextTranslate(tickTextAlign, position)\n\n tickText\n .attr('text-anchor', textAnchor)\n .attr('transform', `translate(${translateX},0)`)\n }\n\n _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 _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.axis","s.hideTickLine","s.hideDomain","label","s.label","s"],"mappings":";;;;;;;;;;;;;;AA2BM,MAAO,IAAY,SAAQ,eAAqE,CAAA;AAcpG,IAAA,WAAA,CAAa,MAAmC,EAAA;AAC9C,QAAA,KAAK,EAAE,CAAA;AAbT,QAAA,IAAA,CAAA,MAAM,GAAsB,IAAI,UAAU,EAAS,CAAA;QAO3C,IAAgB,CAAA,gBAAA,GAAG,CAAC,CAAA;QACpB,IAA4B,CAAA,4BAAA,GAAG,GAAG,CAAA;QAE1C,IAAM,CAAA,MAAA,GAAG,EAAE,CAAA;AAIT,QAAA,IAAI,MAAM;AAAE,YAAA,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QAEpC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;QACnC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;AAChC,aAAA,IAAI,CAAC,OAAO,EAAEA,IAAM,CAAC,CAAA;KACzB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AAED,IAAA,kBAAkB,CAAE,SAAoB,EAAA;AACtC,QAAA,QAAQ,SAAS;AACf,YAAA,KAAK,SAAS,CAAC,IAAI,EAAE,OAAO,OAAO,CAAA;AACnC,YAAA,KAAK,SAAS,CAAC,KAAK,EAAE,OAAO,KAAK,CAAA;AAClC,YAAA,KAAK,SAAS,CAAC,MAAM,EAAE,OAAO,QAAQ,CAAA;AACtC,YAAA,SAAS,OAAO,IAAI,CAAA;AACrB,SAAA;KACF;AAED,IAAA,sBAAsB,CAAE,SAAoB,EAAE,YAAyB,GAAA,QAAQ,CAAC,IAAI,EAAA;AAClF,QAAA,MAAM,wBAAwB,GAAG,CAAC,CAAA;QAClC,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC,KAAK,GAAG,wBAAwB,CAAA;AAEhE,QAAA,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;;AAtVM,IAAS,CAAA,SAAA,GAAGE,KAAC;;;;"}
|
package/components/axis/style.js
CHANGED
|
@@ -9,10 +9,12 @@ const globalStyles = injectGlobal `
|
|
|
9
9
|
/* --vis-axis-font-family: */
|
|
10
10
|
--vis-axis-tick-color: #e8e9ef;
|
|
11
11
|
/* --vis-axis-domain-color: // Undefined by default to allow fallback to var(--vis-axis-tick-color) */
|
|
12
|
-
--vis-axis-tick-label-color: #6c778c;
|
|
13
12
|
--vis-axis-grid-color: #e8e9ef;
|
|
14
13
|
--vis-axis-label-color: #6c778c;
|
|
14
|
+
--vis-axis-tick-label-color: #6c778c;
|
|
15
15
|
--vis-axis-tick-label-font-size: 12px;
|
|
16
|
+
--vis-axis-tick-label-cursor: default;
|
|
17
|
+
--vis-axis-tick-label-text-decoration: none;
|
|
16
18
|
--vis-axis-label-font-size: 14px;
|
|
17
19
|
--vis-axis-tick-line-width: 1px;
|
|
18
20
|
--vis-axis-grid-line-width: 1px;
|
|
@@ -87,6 +89,8 @@ const tick = css `
|
|
|
87
89
|
text, tspan {
|
|
88
90
|
fill: var(--vis-axis-tick-label-color);
|
|
89
91
|
font-family: var(--vis-axis-font-family, var(--vis-font-family));
|
|
92
|
+
cursor: var(--vis-axis-tick-label-cursor);
|
|
93
|
+
text-decoration: var(--vis-axis-tick-label-text-decoration);
|
|
90
94
|
stroke: none;
|
|
91
95
|
}
|
|
92
96
|
`;
|
|
@@ -97,9 +101,9 @@ const label = css `
|
|
|
97
101
|
font-family: var(--vis-axis-font-family, var(--vis-font-family));
|
|
98
102
|
text-anchor: middle;
|
|
99
103
|
`;
|
|
100
|
-
const
|
|
101
|
-
label: tick-
|
|
104
|
+
const tickLabel = css `
|
|
105
|
+
label: tick-label;
|
|
102
106
|
`;
|
|
103
107
|
|
|
104
|
-
export { axis, globalStyles, grid, hideDomain, hideTickLine, label, root, tick,
|
|
108
|
+
export { axis, globalStyles, grid, hideDomain, hideTickLine, label, root, tick, tickLabel };
|
|
105
109
|
//# sourceMappingURL=style.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.js","sources":["../../../src/components/axis/style.ts"],"sourcesContent":["import { css, injectGlobal } from '@emotion/css'\n\nexport const root = css`\n label: axis-component;\n`\n\nexport const globalStyles = injectGlobal`\n :root {\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-
|
|
1
|
+
{"version":3,"file":"style.js","sources":["../../../src/components/axis/style.ts"],"sourcesContent":["import { css, injectGlobal } from '@emotion/css'\n\nexport const root = css`\n label: axis-component;\n`\n\nexport const globalStyles = injectGlobal`\n :root {\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-label-color: #6c778c;\n --vis-axis-tick-label-color: #6c778c;\n --vis-axis-tick-label-font-size: 12px;\n --vis-axis-tick-label-cursor: default;\n --vis-axis-tick-label-text-decoration: none;\n --vis-axis-label-font-size: 14px;\n --vis-axis-tick-line-width: 1px;\n --vis-axis-grid-line-width: 1px;\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\n body.theme-dark ${`.${root}`} {\n --vis-axis-tick-color: var(--vis-dark-axis-tick-color);\n --vis-axis-domain-color: var(--vis-dark-axis-domain-color);\n --vis-axis-tick-label-color: var(--vis-dark-axis-tick-label-color);\n --vis-axis-grid-color: var(--vis-dark-axis-grid-color);\n --vis-axis-label-color: var(--vis-dark-axis-label-color);\n }\n`\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 }\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 }\n`\n\nexport const tick = css`\n label: tick;\n\n stroke: none;\n font-size: var(--vis-axis-tick-label-font-size);\n\n line {\n stroke: var(--vis-axis-tick-color);\n stroke-width: var(--vis-axis-tick-line-width);\n }\n\n text, tspan {\n fill: var(--vis-axis-tick-label-color);\n font-family: var(--vis-axis-font-family, var(--vis-font-family));\n cursor: var(--vis-axis-tick-label-cursor);\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-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"],"names":[],"mappings":";;AAEO,MAAM,IAAI,GAAG,GAAG,CAAA,CAAA;;EAEtB;AAEM,MAAM,YAAY,GAAG,YAAY,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;AAwBpB,kBAAA,EAAA,CAAA,CAAA,EAAI,IAAI,CAAE,CAAA,CAAA;;;;;;;EAO7B;AAEM,MAAM,YAAY,GAAG,GAAG,CAAA,CAAA;;EAE9B;AAEM,MAAM,UAAU,GAAG,GAAG,CAAA,CAAA;;EAE5B;AAEM,MAAM,IAAI,GAAG,GAAG,CAAA,CAAA;;;;;;;;;;AAUlB,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;;;;;;;;;;;EAWtB;AAEM,MAAM,IAAI,GAAG,GAAG,CAAA,CAAA;;;;;;;;;;;;;;;;;;EAkBtB;AAEM,MAAM,KAAK,GAAG,GAAG,CAAA,CAAA;;;;;;EAMvB;AAEM,MAAM,SAAS,GAAG,GAAG,CAAA,CAAA;;;;;;"}
|
|
@@ -135,6 +135,10 @@ export interface LeafletMapConfigInterface<Datum extends GenericDataRecord> exte
|
|
|
135
135
|
};
|
|
136
136
|
/** Tooltip component. Default: `undefined` */
|
|
137
137
|
tooltip?: Tooltip;
|
|
138
|
+
/** Alternative text description of the chart for accessibility purposes. It will be applied as an
|
|
139
|
+
* `aria-label` attribute to the div element containing your chart. Default: `undefined`.
|
|
140
|
+
*/
|
|
141
|
+
ariaLabel?: string | null | undefined;
|
|
138
142
|
}
|
|
139
143
|
export declare class LeafletMapConfig<Datum extends GenericDataRecord> extends ComponentConfig implements LeafletMapConfigInterface<Datum> {
|
|
140
144
|
width: any;
|
|
@@ -190,4 +194,5 @@ export declare class LeafletMapConfig<Datum extends GenericDataRecord> extends C
|
|
|
190
194
|
strokeProperty: any;
|
|
191
195
|
};
|
|
192
196
|
tooltip: any;
|
|
197
|
+
ariaLabel: any;
|
|
193
198
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sources":["../../../src/components/leaflet-map/config.ts"],"sourcesContent":["/* eslint-disable dot-notation, no-irregular-whitespace */\n\n// Core\nimport { ComponentConfig, ComponentConfigInterface } from 'core/component/config'\nimport { Tooltip } from 'components/tooltip'\n\n// Types\nimport { ColorAccessor, GenericAccessor, NumericAccessor, StringAccessor } from 'types/accessor'\nimport { GenericDataRecord } from 'types/data'\n\n// Local Types\nimport {\n Bounds,\n LeafletMapPointStyles,\n MapZoomState,\n LeafletMapPointDatum,\n LeafletMapPointShape,\n LeafletMapClusterDatum,\n LeafletMapRenderer,\n} from './types'\n\n// Renderer settings\nimport { MapLibreStyleSpecs } from './renderer/map-style'\n\nexport interface LeafletMapConfigInterface<Datum extends GenericDataRecord> extends ComponentConfigInterface {\n // General\n /** Width in pixels or in CSS units. By default, the map will automatically fit to the size of the parent element. Default: `undefined`. */\n width?: number | string;\n /** Height in pixels or in CSS units. By default, the map will automatically fit to the size of the parent element. Default: `undefined`. */\n height?: number | string;\n /** Animation duration when the map is automatically panning or zooming to a point or area. Default: `1500` ms */\n flyToDuration?: number;\n /** Padding to be used when the `fitView` function has been called. The value is in pixels, [topLeft, bottomRight]. Default: `[150, 150]` */\n fitViewPadding?: [number, number];\n /** Animation duration for the `setZoom` function. Default: `800` ms */\n zoomDuration?: number;\n /** Default bounds that will be applied on the first map render if the bounds property is not set. Default: `undefined` */\n initialBounds?: Bounds;\n /** Force set map bounds on config and data updates. Default: `undefined` */\n fitBoundsOnUpdate?: Bounds;\n /** Fit the view to contain the data points on map initialization. Default: `true` */\n fitViewOnInit?: boolean;\n /** Fit the view to contain the data points on map config and data updates. Default: `false` */\n fitViewOnUpdate?: boolean;\n /** MapLibre `StyleSpecification` settings, or a URL to it. When renderer is set to`LeafletMapRenderer.Raster`, provide a template URL. Default: `undefined` */\n style: MapLibreStyleSpecs | string | undefined;\n /** MapLibre `StyleSpecification` settings or URL for dark theme. Default: `undefined` */\n styleDarkTheme?: MapLibreStyleSpecs | string | undefined;\n /** Tile server access token or API key. Default: `''` */\n accessToken?: string;\n /** Array of attribution labels. Default: `['<a href=\"https://www.openstreetmap.org/copyright\" target=\"_blank\">OpenStreetMap contributors</a>']` */\n attribution?: string[];\n /** Rendering mode for map's tile layer. For raster files, use `LeafletMapRenderer.Raster`. Default: `LeafletMapRenderer.MapLibre` */\n renderer?: LeafletMapRenderer | string;\n\n // Map events\n /** Function to be called after the map's async initialization is done. Default: `undefined` */\n onMapInitialized?: (() => void);\n /** Map Move / Zoom unified callback function. Default: `undefined` */\n onMapMoveZoom?: (({ mapCenter, zoomLevel, bounds }: MapZoomState) => void);\n /** Map Move Start callback function. Default: `undefined` */\n onMapMoveStart?: (({ mapCenter, zoomLevel, bounds }: MapZoomState) => void);\n /** Map Move End callback function. Default: `undefined` */\n onMapMoveEnd?: (({ mapCenter, zoomLevel, bounds }: MapZoomState) => void);\n /** Map Zoom Start callback function. Default: `undefined` */\n onMapZoomStart?: (({ mapCenter, zoomLevel, bounds }: MapZoomState) => void);\n /** Map Zoom End callback function. Default: `undefined` */\n onMapZoomEnd?: (({ mapCenter, zoomLevel, bounds }: MapZoomState) => void);\n /** Map Zoom Click callback function. Default: `undefined` */\n onMapClick?: (({ mapCenter, zoomLevel, bounds }: MapZoomState) => void);\n\n // Point\n /** Point longitude accessor function. Default: `d => d.longitude` */\n pointLongitude?: NumericAccessor<Datum>;\n /** Point latitude accessor function. Default: `d => d.latitude` */\n pointLatitude?: NumericAccessor<Datum>;\n /** Point id accessor function or constant value. Default: `d => d.id` */\n pointId?: StringAccessor<Datum>;\n /** Point shape accessor function or constant value. Default: `d => d.shape` */\n pointShape?: GenericAccessor<LeafletMapPointShape | string, Datum>;\n /** Point color accessor function or constant value. Default: `d => d.color` */\n pointColor?: ColorAccessor<Datum>;\n /** Point radius accessor function or constant value. Default: `undefined` */\n pointRadius?: NumericAccessor<LeafletMapPointDatum<Datum>>;\n /** Point inner label accessor function. Default: `undefined` */\n pointLabel?: StringAccessor<LeafletMapPointDatum<Datum>>;\n /** Point inner label color accessor function or constant value.\n * By default, the label color will be set, depending on the point brightness, either to\n * `--vis-map-point-inner-label-text-color-light` or to `--vis-map-point-inner-label-text-color-dark` CSS variable.\n * Default: `undefined`\n */\n pointLabelColor?: StringAccessor<LeafletMapPointDatum<Datum>>;\n /** Point bottom label accessor function. Default: `''` */\n pointBottomLabel?: StringAccessor<LeafletMapPointDatum<Datum>>;\n /** Point cursor value or accessor function. Default: `null` */\n pointCursor?: StringAccessor<LeafletMapPointDatum<Datum>>;\n /** The width of the ring when a point has a `LeafletMapPointShape.Ring` shape. Default: `1.25` */\n pointRingWidth?: number;\n /** Set selected point by its unique id. Default: `undefined` */\n selectedPointId?: string;\n\n // Cluster\n /** Cluster color accessor function or constant value. Default: `undefined` */\n clusterColor?: ColorAccessor<Datum>;\n /** Cluster radius accessor function or constant value. Default: `undefined` */\n clusterRadius?: NumericAccessor<LeafletMapClusterDatum<Datum>>;\n /** Cluster inner label accessor function. Default: `d => d.point_count` */\n clusterLabel?: StringAccessor<LeafletMapClusterDatum<Datum>>;\n /** Cluster inner label color accessor function or constant value.\n * By default, the label color will be set, depending on the point brightness, either to\n * `--vis-map-cluster-inner-label-text-color-light` or to `--vis-map-cluster-inner-label-text-color-dark` CSS variable.\n * Default: `undefined`\n */\n clusterLabelColor?: StringAccessor<LeafletMapClusterDatum<Datum>>;\n /** Cluster bottom label accessor function. Default: `''` */\n clusterBottomLabel?: StringAccessor<LeafletMapClusterDatum<Datum>>;\n /** The width of the cluster point ring. Default: `1.25` */\n clusterRingWidth?: number;\n /** When cluster is expanded, show a background circle to better separate points from the base map. Default: `true` */\n clusterBackground?: boolean;\n /** Defines whether the cluster should expand on click or not. Default: `true` */\n clusterExpandOnClick?: boolean;\n /** Clustering distance in pixels. This value will be passed to Supercluster as the `radius` property https://github.com/mapbox/supercluster. Default: `55` */\n clusteringDistance?: number;\n /** A single map point can have multiple properties displayed as a small pie chart (or a donut chart for a cluster of points).\n * By setting the colorMap configuration you can specify data properties that should be mapped to various pie / donut segments.\n *\n * ```\n * {\n * [key in keyof Datum]?: { color: string, className?: string }\n * }\n * ```\n * e.g.:\n * ```\n * {\n * healthy: { color: 'green' },\n * warning: { color: 'orange' },\n * danger: { color: 'red' }\n * }\n * ```\n * where every data point has the `healthy`, `warning` and `danger` numerical or boolean property.\n */\n colorMap?: LeafletMapPointStyles<Datum>;\n\n // TopoJSON overlay\n /** A TopoJSON Geometry layer to be displayed on top of the map. Supports fill and stroke */\n topoJSONLayer?: {\n /** The TopoJSON.Topology object. Default: `undefined` */\n sources: any;\n /** Name of the geometry feature to be displayed. Default: `undefined` */\n featureName?: string;\n /** Name of the property to be used for defining the fill color of the geometry. Default: `undefined` */\n fillProperty?: string;\n /** Name of the property to be used for defining the stroke color of the geometry. Default: `undefined` */\n strokeProperty?: string;\n /** Geometry fill opacity value. Default: `0.6` */\n fillOpacity?: number;\n /** Geometry stroke opacity value. Default: `0.8` */\n strokeOpacity?: number;\n /** Geometry stroke width. Default: `2` */\n strokeWidth?: number;\n };\n\n // Misc\n /** Tooltip component. Default: `undefined` */\n tooltip?: Tooltip;\n}\n\nexport class LeafletMapConfig<Datum extends GenericDataRecord> extends ComponentConfig implements LeafletMapConfigInterface<Datum> {\n // General\n width = undefined\n height = undefined\n flyToDuration = 1500\n fitViewPadding = [150, 150] as [number, number]\n zoomDuration = 800\n initialBounds = undefined\n fitBoundsOnUpdate = undefined\n fitViewOnInit = true\n fitViewOnUpdate = false\n attribution = ['<a href=\"https://www.openstreetmap.org/copyright\" target=\"_blank\">OpenStreetMap contributors</a>']\n accessToken = ''\n style = undefined\n styleDarkTheme = undefined\n renderer = LeafletMapRenderer.MapLibre\n\n // Map events\n onMapInitialized = undefined\n onMapMoveZoom = undefined\n onMapMoveStart = undefined\n onMapMoveEnd = undefined\n onMapZoomStart = undefined\n onMapZoomEnd = undefined\n onMapClick = undefined\n\n // Point\n pointLongitude = (d: Datum): number => d['longitude'] as number\n pointLatitude = (d: Datum): number => d['latitude'] as number\n pointId = (d: Datum): string => d['id'] as string\n pointShape = (d: Datum): string => d['shape'] as string\n pointColor = (d: Datum): string => d['color'] as string\n pointRadius = undefined\n pointLabel = undefined\n pointLabelColor = undefined\n pointBottomLabel = ''\n pointCursor = null\n pointRingWidth = 1.25\n selectedPointId = undefined\n\n // Cluster\n clusterColor = undefined\n clusterRadius = undefined\n clusterLabel = (d: LeafletMapClusterDatum<Datum>): string => `${d.point_count}`\n clusterLabelColor = undefined\n clusterBottomLabel = ''\n clusterRingWidth = 1.25\n clusterBackground = true\n clusterExpandOnClick = true\n clusteringDistance = 55\n colorMap = {} as LeafletMapPointStyles<Datum>\n\n // TopoJSON Overlay\n topoJSONLayer = {\n sources: undefined,\n fillOpacity: 0.6,\n strokeOpacity: 0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A,aAAa,EAAE,GAAG;AAClB,YAAA,WAAW,EAAE,CAAC;AACd,YAAA,WAAW,EAAE,SAAS;AACtB,YAAA,YAAY,EAAE,SAAS;AACvB,YAAA,cAAc,EAAE,SAAS;SAC1B,CAAA;;QAGD,IAAO,CAAA,OAAA,GAAG,SAAS,CAAA;KACpB;AAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"config.js","sources":["../../../src/components/leaflet-map/config.ts"],"sourcesContent":["/* eslint-disable dot-notation, no-irregular-whitespace */\n\n// Core\nimport { ComponentConfig, ComponentConfigInterface } from 'core/component/config'\nimport { Tooltip } from 'components/tooltip'\n\n// Types\nimport { ColorAccessor, GenericAccessor, NumericAccessor, StringAccessor } from 'types/accessor'\nimport { GenericDataRecord } from 'types/data'\n\n// Local Types\nimport {\n Bounds,\n LeafletMapPointStyles,\n MapZoomState,\n LeafletMapPointDatum,\n LeafletMapPointShape,\n LeafletMapClusterDatum,\n LeafletMapRenderer,\n} from './types'\n\n// Renderer settings\nimport { MapLibreStyleSpecs } from './renderer/map-style'\n\nexport interface LeafletMapConfigInterface<Datum extends GenericDataRecord> extends ComponentConfigInterface {\n // General\n /** Width in pixels or in CSS units. By default, the map will automatically fit to the size of the parent element. Default: `undefined`. */\n width?: number | string;\n /** Height in pixels or in CSS units. By default, the map will automatically fit to the size of the parent element. Default: `undefined`. */\n height?: number | string;\n /** Animation duration when the map is automatically panning or zooming to a point or area. Default: `1500` ms */\n flyToDuration?: number;\n /** Padding to be used when the `fitView` function has been called. The value is in pixels, [topLeft, bottomRight]. Default: `[150, 150]` */\n fitViewPadding?: [number, number];\n /** Animation duration for the `setZoom` function. Default: `800` ms */\n zoomDuration?: number;\n /** Default bounds that will be applied on the first map render if the bounds property is not set. Default: `undefined` */\n initialBounds?: Bounds;\n /** Force set map bounds on config and data updates. Default: `undefined` */\n fitBoundsOnUpdate?: Bounds;\n /** Fit the view to contain the data points on map initialization. Default: `true` */\n fitViewOnInit?: boolean;\n /** Fit the view to contain the data points on map config and data updates. Default: `false` */\n fitViewOnUpdate?: boolean;\n /** MapLibre `StyleSpecification` settings, or a URL to it. When renderer is set to`LeafletMapRenderer.Raster`, provide a template URL. Default: `undefined` */\n style: MapLibreStyleSpecs | string | undefined;\n /** MapLibre `StyleSpecification` settings or URL for dark theme. Default: `undefined` */\n styleDarkTheme?: MapLibreStyleSpecs | string | undefined;\n /** Tile server access token or API key. Default: `''` */\n accessToken?: string;\n /** Array of attribution labels. Default: `['<a href=\"https://www.openstreetmap.org/copyright\" target=\"_blank\">OpenStreetMap contributors</a>']` */\n attribution?: string[];\n /** Rendering mode for map's tile layer. For raster files, use `LeafletMapRenderer.Raster`. Default: `LeafletMapRenderer.MapLibre` */\n renderer?: LeafletMapRenderer | string;\n\n // Map events\n /** Function to be called after the map's async initialization is done. Default: `undefined` */\n onMapInitialized?: (() => void);\n /** Map Move / Zoom unified callback function. Default: `undefined` */\n onMapMoveZoom?: (({ mapCenter, zoomLevel, bounds }: MapZoomState) => void);\n /** Map Move Start callback function. Default: `undefined` */\n onMapMoveStart?: (({ mapCenter, zoomLevel, bounds }: MapZoomState) => void);\n /** Map Move End callback function. Default: `undefined` */\n onMapMoveEnd?: (({ mapCenter, zoomLevel, bounds }: MapZoomState) => void);\n /** Map Zoom Start callback function. Default: `undefined` */\n onMapZoomStart?: (({ mapCenter, zoomLevel, bounds }: MapZoomState) => void);\n /** Map Zoom End callback function. Default: `undefined` */\n onMapZoomEnd?: (({ mapCenter, zoomLevel, bounds }: MapZoomState) => void);\n /** Map Zoom Click callback function. Default: `undefined` */\n onMapClick?: (({ mapCenter, zoomLevel, bounds }: MapZoomState) => void);\n\n // Point\n /** Point longitude accessor function. Default: `d => d.longitude` */\n pointLongitude?: NumericAccessor<Datum>;\n /** Point latitude accessor function. Default: `d => d.latitude` */\n pointLatitude?: NumericAccessor<Datum>;\n /** Point id accessor function or constant value. Default: `d => d.id` */\n pointId?: StringAccessor<Datum>;\n /** Point shape accessor function or constant value. Default: `d => d.shape` */\n pointShape?: GenericAccessor<LeafletMapPointShape | string, Datum>;\n /** Point color accessor function or constant value. Default: `d => d.color` */\n pointColor?: ColorAccessor<Datum>;\n /** Point radius accessor function or constant value. Default: `undefined` */\n pointRadius?: NumericAccessor<LeafletMapPointDatum<Datum>>;\n /** Point inner label accessor function. Default: `undefined` */\n pointLabel?: StringAccessor<LeafletMapPointDatum<Datum>>;\n /** Point inner label color accessor function or constant value.\n * By default, the label color will be set, depending on the point brightness, either to\n * `--vis-map-point-inner-label-text-color-light` or to `--vis-map-point-inner-label-text-color-dark` CSS variable.\n * Default: `undefined`\n */\n pointLabelColor?: StringAccessor<LeafletMapPointDatum<Datum>>;\n /** Point bottom label accessor function. Default: `''` */\n pointBottomLabel?: StringAccessor<LeafletMapPointDatum<Datum>>;\n /** Point cursor value or accessor function. Default: `null` */\n pointCursor?: StringAccessor<LeafletMapPointDatum<Datum>>;\n /** The width of the ring when a point has a `LeafletMapPointShape.Ring` shape. Default: `1.25` */\n pointRingWidth?: number;\n /** Set selected point by its unique id. Default: `undefined` */\n selectedPointId?: string;\n\n // Cluster\n /** Cluster color accessor function or constant value. Default: `undefined` */\n clusterColor?: ColorAccessor<Datum>;\n /** Cluster radius accessor function or constant value. Default: `undefined` */\n clusterRadius?: NumericAccessor<LeafletMapClusterDatum<Datum>>;\n /** Cluster inner label accessor function. Default: `d => d.point_count` */\n clusterLabel?: StringAccessor<LeafletMapClusterDatum<Datum>>;\n /** Cluster inner label color accessor function or constant value.\n * By default, the label color will be set, depending on the point brightness, either to\n * `--vis-map-cluster-inner-label-text-color-light` or to `--vis-map-cluster-inner-label-text-color-dark` CSS variable.\n * Default: `undefined`\n */\n clusterLabelColor?: StringAccessor<LeafletMapClusterDatum<Datum>>;\n /** Cluster bottom label accessor function. Default: `''` */\n clusterBottomLabel?: StringAccessor<LeafletMapClusterDatum<Datum>>;\n /** The width of the cluster point ring. Default: `1.25` */\n clusterRingWidth?: number;\n /** When cluster is expanded, show a background circle to better separate points from the base map. Default: `true` */\n clusterBackground?: boolean;\n /** Defines whether the cluster should expand on click or not. Default: `true` */\n clusterExpandOnClick?: boolean;\n /** Clustering distance in pixels. This value will be passed to Supercluster as the `radius` property https://github.com/mapbox/supercluster. Default: `55` */\n clusteringDistance?: number;\n /** A single map point can have multiple properties displayed as a small pie chart (or a donut chart for a cluster of points).\n * By setting the colorMap configuration you can specify data properties that should be mapped to various pie / donut segments.\n *\n * ```\n * {\n * [key in keyof Datum]?: { color: string, className?: string }\n * }\n * ```\n * e.g.:\n * ```\n * {\n * healthy: { color: 'green' },\n * warning: { color: 'orange' },\n * danger: { color: 'red' }\n * }\n * ```\n * where every data point has the `healthy`, `warning` and `danger` numerical or boolean property.\n */\n colorMap?: LeafletMapPointStyles<Datum>;\n\n // TopoJSON overlay\n /** A TopoJSON Geometry layer to be displayed on top of the map. Supports fill and stroke */\n topoJSONLayer?: {\n /** The TopoJSON.Topology object. Default: `undefined` */\n sources: any;\n /** Name of the geometry feature to be displayed. Default: `undefined` */\n featureName?: string;\n /** Name of the property to be used for defining the fill color of the geometry. Default: `undefined` */\n fillProperty?: string;\n /** Name of the property to be used for defining the stroke color of the geometry. Default: `undefined` */\n strokeProperty?: string;\n /** Geometry fill opacity value. Default: `0.6` */\n fillOpacity?: number;\n /** Geometry stroke opacity value. Default: `0.8` */\n strokeOpacity?: number;\n /** Geometry stroke width. Default: `2` */\n strokeWidth?: number;\n };\n\n // Misc\n /** Tooltip component. Default: `undefined` */\n tooltip?: Tooltip;\n\n /** Alternative text description of the chart for accessibility purposes. It will be applied as an\n * `aria-label` attribute to the div element containing your chart. Default: `undefined`.\n */\n ariaLabel?: string | null | undefined;\n}\n\nexport class LeafletMapConfig<Datum extends GenericDataRecord> extends ComponentConfig implements LeafletMapConfigInterface<Datum> {\n // General\n width = undefined\n height = undefined\n flyToDuration = 1500\n fitViewPadding = [150, 150] as [number, number]\n zoomDuration = 800\n initialBounds = undefined\n fitBoundsOnUpdate = undefined\n fitViewOnInit = true\n fitViewOnUpdate = false\n attribution = ['<a href=\"https://www.openstreetmap.org/copyright\" target=\"_blank\">OpenStreetMap contributors</a>']\n accessToken = ''\n style = undefined\n styleDarkTheme = undefined\n renderer = LeafletMapRenderer.MapLibre\n\n // Map events\n onMapInitialized = undefined\n onMapMoveZoom = undefined\n onMapMoveStart = undefined\n onMapMoveEnd = undefined\n onMapZoomStart = undefined\n onMapZoomEnd = undefined\n onMapClick = undefined\n\n // Point\n pointLongitude = (d: Datum): number => d['longitude'] as number\n pointLatitude = (d: Datum): number => d['latitude'] as number\n pointId = (d: Datum): string => d['id'] as string\n pointShape = (d: Datum): string => d['shape'] as string\n pointColor = (d: Datum): string => d['color'] as string\n pointRadius = undefined\n pointLabel = undefined\n pointLabelColor = undefined\n pointBottomLabel = ''\n pointCursor = null\n pointRingWidth = 1.25\n selectedPointId = undefined\n\n // Cluster\n clusterColor = undefined\n clusterRadius = undefined\n clusterLabel = (d: LeafletMapClusterDatum<Datum>): string => `${d.point_count}`\n clusterLabelColor = undefined\n clusterBottomLabel = ''\n clusterRingWidth = 1.25\n clusterBackground = true\n clusterExpandOnClick = true\n clusteringDistance = 55\n colorMap = {} as LeafletMapPointStyles<Datum>\n\n // TopoJSON Overlay\n topoJSONLayer = {\n sources: undefined,\n fillOpacity: 0.6,\n strokeOpacity: 0.8,\n strokeWidth: 1,\n featureName: undefined,\n fillProperty: undefined,\n strokeProperty: undefined,\n }\n\n // Misc\n tooltip = undefined\n ariaLabel = undefined\n}\n"],"names":[],"mappings":";;;AAAA;AA6KM,MAAO,gBAAkD,SAAQ,eAAe,CAAA;AAAtF,IAAA,WAAA,GAAA;;;QAEE,IAAK,CAAA,KAAA,GAAG,SAAS,CAAA;QACjB,IAAM,CAAA,MAAA,GAAG,SAAS,CAAA;QAClB,IAAa,CAAA,aAAA,GAAG,IAAI,CAAA;AACpB,QAAA,IAAA,CAAA,cAAc,GAAG,CAAC,GAAG,EAAE,GAAG,CAAqB,CAAA;QAC/C,IAAY,CAAA,Y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,CAAA;QACtB,IAAe,CAAA,eAAA,GAAG,SAAS,CAAA;QAC3B,IAAgB,CAAA,gBAAA,GAAG,EAAE,CAAA;QACrB,IAAW,CAAA,WAAA,GAAG,IAAI,CAAA;QAClB,IAAc,CAAA,cAAA,GAAG,IAAI,CAAA;QACrB,IAAe,CAAA,eAAA,GAAG,SAAS,CAAA;;QAG3B,IAAY,CAAA,YAAA,GAAG,SAAS,CAAA;QACxB,IAAa,CAAA,aAAA,GAAG,SAAS,CAAA;QACzB,IAAY,CAAA,YAAA,GAAG,CAAC,CAAgC,KAAa,CAAA,EAAG,CAAC,CAAC,WAAW,CAAA,CAAE,CAAA;QAC/E,IAAiB,CAAA,iBAAA,GAAG,SAAS,CAAA;QAC7B,IAAkB,CAAA,kBAAA,GAAG,EAAE,CAAA;QACvB,IAAgB,CAAA,gBAAA,GAAG,IAAI,CAAA;QACvB,IAAiB,CAAA,iBAAA,GAAG,IAAI,CAAA;QACxB,IAAoB,CAAA,oBAAA,GAAG,IAAI,CAAA;QAC3B,IAAkB,CAAA,kBAAA,GAAG,EAAE,CAAA;QACvB,IAAQ,CAAA,QAAA,GAAG,EAAkC,CAAA;;AAG7C,QAAA,IAAA,CAAA,aAAa,GAAG;AACd,YAAA,OAAO,EAAE,SAAS;AAClB,YAAA,WAAW,EAAE,GAAG;AAChB,YAAA,aAAa,EAAE,GAAG;AAClB,YAAA,WAAW,EAAE,CAAC;AACd,YAAA,WAAW,EAAE,SAAS;AACtB,YAAA,YAAY,EAAE,SAAS;AACvB,YAAA,cAAc,EAAE,SAAS;SAC1B,CAAA;;QAGD,IAAO,CAAA,OAAA,GAAG,SAAS,CAAA;QACnB,IAAS,CAAA,SAAA,GAAG,SAAS,CAAA;KACtB;AAAA;;;;"}
|
|
@@ -43,6 +43,7 @@ export declare class LeafletMap<Datum extends GenericDataRecord> extends Compone
|
|
|
43
43
|
darkMapPointBottomLabelTextColor: "--vis-dark-map-point-bottom-label-text-color";
|
|
44
44
|
darkMapClusterExpandedBackgroundFillColor: "--vis-dark-map-cluster-expanded-background-fill-color";
|
|
45
45
|
};
|
|
46
|
+
g: Selection<HTMLElement, unknown, null, undefined>;
|
|
46
47
|
type: ComponentType;
|
|
47
48
|
element: HTMLElement;
|
|
48
49
|
config: LeafletMapConfig<Datum>;
|
|
@@ -48,9 +48,11 @@ class LeafletMap extends ComponentCore {
|
|
|
48
48
|
},
|
|
49
49
|
};
|
|
50
50
|
this._container = container;
|
|
51
|
-
this._containerSelection = select(this._container);
|
|
51
|
+
this._containerSelection = select(this._container).attr('role', 'figure');
|
|
52
52
|
this._container.appendChild(this.element);
|
|
53
|
-
this.g
|
|
53
|
+
this.g
|
|
54
|
+
.attr('class', root)
|
|
55
|
+
.attr('aria-hidden', true);
|
|
54
56
|
if (config)
|
|
55
57
|
this.setConfig(config);
|
|
56
58
|
if (!this._container.clientWidth) {
|
|
@@ -155,6 +157,8 @@ class LeafletMap extends ComponentCore {
|
|
|
155
157
|
this.config.tooltip.setComponents([this]);
|
|
156
158
|
this.config.tooltip.update();
|
|
157
159
|
}
|
|
160
|
+
// Apply the `aria-label` attribute
|
|
161
|
+
this._containerSelection.attr('aria-label', config.ariaLabel);
|
|
158
162
|
}
|
|
159
163
|
setData(data) {
|
|
160
164
|
const { config, datamodel } = this;
|