@unovis/ts 1.3.0-beta.0 → 1.3.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/area/config.d.ts +10 -6
- package/components/area/config.js +12 -3
- package/components/area/config.js.map +1 -1
- package/components/area/index.d.ts +6 -5
- package/components/area/index.js +9 -10
- package/components/area/index.js.map +1 -1
- package/components/axis/config.d.ts +27 -3
- package/components/axis/config.js +30 -3
- package/components/axis/config.js.map +1 -1
- package/components/axis/index.d.ts +3 -4
- package/components/axis/index.js +4 -7
- package/components/axis/index.js.map +1 -1
- package/components/brush/config.d.ts +12 -2
- package/components/brush/config.js +20 -11
- package/components/brush/config.js.map +1 -1
- package/components/brush/index.d.ts +3 -4
- package/components/brush/index.js +3 -4
- package/components/brush/index.js.map +1 -1
- package/components/bullet-legend/config.d.ts +10 -1
- package/components/bullet-legend/config.js +14 -11
- package/components/bullet-legend/config.js.map +1 -1
- package/components/bullet-legend/index.d.ts +3 -4
- package/components/bullet-legend/index.js +2 -5
- package/components/bullet-legend/index.js.map +1 -1
- package/components/bullet-legend/modules/shape.js +7 -6
- package/components/bullet-legend/modules/shape.js.map +1 -1
- package/components/bullet-legend/style.js +4 -0
- package/components/bullet-legend/style.js.map +1 -1
- package/components/chord-diagram/config.d.ts +23 -7
- package/components/chord-diagram/config.js +22 -3
- package/components/chord-diagram/config.js.map +1 -1
- package/components/chord-diagram/index.d.ts +3 -4
- package/components/chord-diagram/index.js +6 -7
- package/components/chord-diagram/index.js.map +1 -1
- package/components/chord-diagram/modules/label.d.ts +3 -3
- package/components/chord-diagram/modules/label.js +1 -1
- package/components/chord-diagram/modules/label.js.map +1 -1
- package/components/chord-diagram/modules/link.d.ts +2 -2
- package/components/chord-diagram/modules/link.js.map +1 -1
- package/components/chord-diagram/modules/node.d.ts +2 -2
- package/components/chord-diagram/modules/node.js.map +1 -1
- package/components/chord-diagram/types.d.ts +2 -3
- package/components/chord-diagram/types.js.map +1 -1
- package/components/crosshair/config.d.ts +22 -7
- package/components/crosshair/config.js +16 -3
- package/components/crosshair/config.js.map +1 -1
- package/components/crosshair/index.d.ts +3 -4
- package/components/crosshair/index.js +3 -4
- package/components/crosshair/index.js.map +1 -1
- package/components/donut/config.d.ts +19 -2
- package/components/donut/config.js +24 -5
- package/components/donut/config.js.map +1 -1
- package/components/donut/index.d.ts +3 -4
- package/components/donut/index.js +4 -5
- package/components/donut/index.js.map +1 -1
- package/components/donut/modules/arc.d.ts +3 -3
- package/components/donut/modules/arc.js.map +1 -1
- package/components/flow-legend/config.d.ts +11 -1
- package/components/flow-legend/config.js +16 -11
- package/components/flow-legend/config.js.map +1 -1
- package/components/flow-legend/index.d.ts +3 -4
- package/components/flow-legend/index.js +2 -5
- package/components/flow-legend/index.js.map +1 -1
- package/components/free-brush/config.d.ts +12 -2
- package/components/free-brush/config.js +20 -11
- package/components/free-brush/config.js.map +1 -1
- package/components/free-brush/index.d.ts +3 -4
- package/components/free-brush/index.js +5 -6
- package/components/free-brush/index.js.map +1 -1
- package/components/graph/config.d.ts +75 -3
- package/components/graph/config.js +78 -12
- package/components/graph/config.js.map +1 -1
- package/components/graph/index.d.ts +7 -8
- package/components/graph/index.js +4 -5
- package/components/graph/index.js.map +1 -1
- package/components/graph/modules/layout.d.ts +7 -7
- package/components/graph/modules/layout.js.map +1 -1
- package/components/graph/modules/link/helper.d.ts +5 -5
- package/components/graph/modules/link/helper.js.map +1 -1
- package/components/graph/modules/link/index.d.ts +6 -6
- package/components/graph/modules/link/index.js.map +1 -1
- package/components/graph/modules/node/index.d.ts +6 -6
- package/components/graph/modules/node/index.js +2 -2
- package/components/graph/modules/node/index.js.map +1 -1
- package/components/graph/modules/panel/helper.d.ts +4 -4
- package/components/graph/modules/panel/helper.js.map +1 -1
- package/components/graph/modules/panel/index.d.ts +3 -3
- package/components/graph/modules/panel/index.js.map +1 -1
- package/components/grouped-bar/config.d.ts +13 -5
- package/components/grouped-bar/config.js +16 -5
- package/components/grouped-bar/config.js.map +1 -1
- package/components/grouped-bar/index.d.ts +3 -4
- package/components/grouped-bar/index.js +3 -4
- package/components/grouped-bar/index.js.map +1 -1
- package/components/leaflet-flow-map/config.d.ts +16 -2
- package/components/leaflet-flow-map/config.js +21 -3
- package/components/leaflet-flow-map/config.js.map +1 -1
- package/components/leaflet-flow-map/index.d.ts +3 -4
- package/components/leaflet-flow-map/index.js +2 -3
- package/components/leaflet-flow-map/index.js.map +1 -1
- package/components/leaflet-map/config.d.ts +59 -4
- package/components/leaflet-map/config.js +67 -23
- package/components/leaflet-map/config.js.map +1 -1
- package/components/leaflet-map/index.d.ts +3 -4
- package/components/leaflet-map/index.js +3 -4
- package/components/leaflet-map/index.js.map +1 -1
- package/components/leaflet-map/modules/map.d.ts +3 -3
- package/components/leaflet-map/modules/map.js.map +1 -1
- package/components/leaflet-map/modules/utils.d.ts +4 -4
- package/components/leaflet-map/modules/utils.js +2 -6
- package/components/leaflet-map/modules/utils.js.map +1 -1
- package/components/leaflet-map/renderer/mapboxgl-layer.d.ts +2 -2
- package/components/leaflet-map/renderer/mapboxgl-layer.js.map +1 -1
- package/components/line/config.d.ts +11 -6
- package/components/line/config.js +13 -3
- package/components/line/config.js.map +1 -1
- package/components/line/index.d.ts +3 -4
- package/components/line/index.js +4 -5
- package/components/line/index.js.map +1 -1
- package/components/nested-donut/config.d.ts +21 -2
- package/components/nested-donut/config.js +24 -3
- package/components/nested-donut/config.js.map +1 -1
- package/components/nested-donut/index.d.ts +3 -4
- package/components/nested-donut/index.js +3 -4
- package/components/nested-donut/index.js.map +1 -1
- package/components/nested-donut/modules/arc.d.ts +3 -3
- package/components/nested-donut/modules/arc.js.map +1 -1
- package/components/nested-donut/modules/label.d.ts +2 -2
- package/components/nested-donut/modules/label.js.map +1 -1
- package/components/sankey/config.d.ts +47 -2
- package/components/sankey/config.js +57 -10
- package/components/sankey/config.js.map +1 -1
- package/components/sankey/index.d.ts +3 -4
- package/components/sankey/index.js +2 -3
- package/components/sankey/index.js.map +1 -1
- package/components/sankey/modules/label.d.ts +7 -7
- package/components/sankey/modules/label.js.map +1 -1
- package/components/sankey/modules/link.d.ts +2 -2
- package/components/sankey/modules/link.js.map +1 -1
- package/components/sankey/modules/node.d.ts +7 -7
- package/components/sankey/modules/node.js +1 -1
- package/components/sankey/modules/node.js.map +1 -1
- package/components/scatter/config.d.ts +16 -4
- package/components/scatter/config.js +19 -5
- package/components/scatter/config.js.map +1 -1
- package/components/scatter/index.d.ts +3 -4
- package/components/scatter/index.js +5 -5
- package/components/scatter/index.js.map +1 -1
- package/components/scatter/modules/point.d.ts +2 -2
- package/components/scatter/modules/point.js.map +1 -1
- package/components/scatter/modules/utils.d.ts +2 -2
- package/components/scatter/modules/utils.js.map +1 -1
- package/components/stacked-bar/config.d.ts +13 -5
- package/components/stacked-bar/config.js +16 -5
- package/components/stacked-bar/config.js.map +1 -1
- package/components/stacked-bar/index.d.ts +3 -4
- package/components/stacked-bar/index.js +3 -4
- package/components/stacked-bar/index.js.map +1 -1
- package/components/timeline/config.d.ts +16 -5
- package/components/timeline/config.js +21 -9
- package/components/timeline/config.js.map +1 -1
- package/components/timeline/index.d.ts +3 -4
- package/components/timeline/index.js +3 -4
- package/components/timeline/index.js.map +1 -1
- package/components/tooltip/config.d.ts +15 -1
- package/components/tooltip/config.js +16 -12
- package/components/tooltip/config.js.map +1 -1
- package/components/tooltip/index.d.ts +3 -4
- package/components/tooltip/index.js +3 -5
- package/components/tooltip/index.js.map +1 -1
- package/components/topojson-map/config.d.ts +36 -4
- package/components/topojson-map/config.js +38 -3
- package/components/topojson-map/config.js.map +1 -1
- package/components/topojson-map/index.d.ts +3 -4
- package/components/topojson-map/index.js +4 -4
- package/components/topojson-map/index.js.map +1 -1
- package/components/vis-controls/config.d.ts +5 -1
- package/components/vis-controls/config.js +9 -6
- package/components/vis-controls/config.js.map +1 -1
- package/components/vis-controls/index.d.ts +2 -3
- package/components/vis-controls/index.js +2 -5
- package/components/vis-controls/index.js.map +1 -1
- package/components/xy-labels/config.d.ts +16 -4
- package/components/xy-labels/config.js +20 -5
- package/components/xy-labels/config.js.map +1 -1
- package/components/xy-labels/index.d.ts +3 -4
- package/components/xy-labels/index.js +2 -3
- package/components/xy-labels/index.js.map +1 -1
- package/components/xy-labels/modules/label.d.ts +3 -3
- package/components/xy-labels/modules/label.js +1 -1
- package/components/xy-labels/modules/label.js.map +1 -1
- package/containers/single-container/config.d.ts +4 -2
- package/containers/single-container/config.js +8 -3
- package/containers/single-container/config.js.map +1 -1
- package/containers/single-container/index.d.ts +3 -4
- package/containers/single-container/index.js +4 -2
- package/containers/single-container/index.js.map +1 -1
- package/containers/xy-container/config.d.ts +23 -3
- package/containers/xy-container/config.js +26 -3
- package/containers/xy-container/config.js.map +1 -1
- package/containers/xy-container/index.d.ts +2 -4
- package/containers/xy-container/index.js +5 -5
- package/containers/xy-container/index.js.map +1 -1
- package/core/component/config.d.ts +6 -1
- package/core/component/config.js +12 -6
- package/core/component/config.js.map +1 -1
- package/core/component/index.d.ts +5 -7
- package/core/component/index.js +7 -8
- package/core/component/index.js.map +1 -1
- package/core/config/index.d.ts +3 -0
- package/core/config/index.js +16 -0
- package/core/config/index.js.map +1 -0
- package/core/container/config.d.ts +21 -1
- package/core/container/config.js +25 -21
- package/core/container/config.js.map +1 -1
- package/core/container/index.d.ts +5 -5
- package/core/container/index.js +4 -4
- package/core/container/index.js.map +1 -1
- package/core/xy-component/config.d.ts +10 -2
- package/core/xy-component/config.js +16 -7
- package/core/xy-component/config.js.map +1 -1
- package/core/xy-component/index.d.ts +4 -5
- package/core/xy-component/index.js +0 -2
- package/core/xy-component/index.js.map +1 -1
- package/data-models/map-graph.d.ts +1 -1
- package/data-models/map-graph.js +1 -1
- package/data-models/map-graph.js.map +1 -1
- package/package.json +1 -1
- package/styles/index.js +26 -1
- package/styles/index.js.map +1 -1
- package/styles/patterns.d.ts +17 -0
- package/styles/patterns.js +53 -0
- package/styles/patterns.js.map +1 -0
- package/types/accessor.d.ts +1 -1
- package/utils/data.d.ts +1 -1
- package/utils/data.js.map +1 -1
|
@@ -8,15 +8,14 @@ import { smartTransition } from '../../utils/d3.js';
|
|
|
8
8
|
import { getColor } from '../../utils/color.js';
|
|
9
9
|
import { Direction } from '../../types/direction.js';
|
|
10
10
|
import { Orientation } from '../../types/position.js';
|
|
11
|
-
import {
|
|
11
|
+
import { GroupedBarConfig } from './config.js';
|
|
12
12
|
import * as style from './style.js';
|
|
13
13
|
import { barGroup, barGroupExit, bar } from './style.js';
|
|
14
14
|
|
|
15
15
|
class GroupedBar extends XYComponentCore {
|
|
16
16
|
constructor(config) {
|
|
17
17
|
super();
|
|
18
|
-
this.
|
|
19
|
-
this.config = this._defaultConfig;
|
|
18
|
+
this.config = new GroupedBarConfig();
|
|
20
19
|
this.getAccessors = () => isArray(this.config.y) ? this.config.y : [this.config.y];
|
|
21
20
|
this.events = {
|
|
22
21
|
[GroupedBar.selectors.barGroup]: {
|
|
@@ -28,7 +27,7 @@ class GroupedBar extends XYComponentCore {
|
|
|
28
27
|
};
|
|
29
28
|
this._barData = [];
|
|
30
29
|
if (config)
|
|
31
|
-
this.
|
|
30
|
+
this.config.init(config);
|
|
32
31
|
}
|
|
33
32
|
get bleed() {
|
|
34
33
|
this._barData = this._getVisibleData();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/grouped-bar/index.ts"],"sourcesContent":["import { scaleBand } from 'd3-scale'\nimport { min, max, range } from 'd3-array'\nimport { select } from 'd3'\n\n// Core\nimport { XYComponentCore } from 'core/xy-component'\n\n// Utils\nimport { clamp, getExtent, getMax, getMin, getNumber, getString, isArray, isEmpty, isNumber } from 'utils/data'\nimport { roundedRectPath } from 'utils/path'\nimport { smartTransition } from 'utils/d3'\nimport { getColor } from 'utils/color'\n\n// Types\nimport { NumericAccessor } from 'types/accessor'\nimport { Spacing } from 'types/spacing'\nimport { Direction } from 'types/direction'\nimport { Orientation } from 'types/position'\nimport { ContinuousScale } from 'types/scale'\n\n// Config\nimport { GroupedBarDefaultConfig, GroupedBarConfigInterface } from './config'\n\n// Styles\nimport * as s from './style'\n\nexport class GroupedBar<Datum> extends XYComponentCore<Datum, GroupedBarConfigInterface<Datum>> {\n static selectors = s\n protected _defaultConfig = GroupedBarDefaultConfig as GroupedBarConfigInterface<Datum>\n public config: GroupedBarConfigInterface<Datum> = this._defaultConfig\n\n getAccessors = (): NumericAccessor<Datum>[] =>\n isArray(this.config.y) ? this.config.y : [this.config.y]\n\n events = {\n [GroupedBar.selectors.barGroup]: {\n mouseover: this._raiseSelection,\n },\n [GroupedBar.selectors.bar]: {\n mouseover: this._raiseSelection,\n },\n }\n\n private _barData: Datum[] = []\n\n constructor (config?: GroupedBarConfigInterface<Datum>) {\n super()\n if (config) this.setConfig(config)\n }\n\n get bleed (): Spacing {\n this._barData = this._getVisibleData()\n if (this._barData.length === 0) return { top: 0, bottom: 0, left: 0, right: 0 }\n\n // By default, horizontal orientation is \"flipped\", i.e. the `yDirection` of `XYContainer` is set to `Direction.North`\n const isHorizontalAndFlipped = !this.isVertical() && (this.dataScale.range()[0] > this.dataScale.range()[1])\n const dataDomain = this.dataScale.domain()\n const halfGroupWidth = this._getGroupWidth() / 2\n\n const dataScaleValues = this._barData.map((d, i) => getNumber(d, this.config.x, i))\n const firstDataValue = min(dataScaleValues)\n const lastDataValue = max(dataScaleValues)\n const firstValuePx = this.dataScale(firstDataValue)\n const lastValuePx = this.dataScale(lastDataValue)\n\n const dataDomainRequiredStart = this.dataScale.invert(firstValuePx + (isHorizontalAndFlipped ? halfGroupWidth : -halfGroupWidth))\n const dataDomainRequiredEnd = this.dataScale.invert(lastValuePx + (isHorizontalAndFlipped ? -halfGroupWidth : halfGroupWidth))\n const bleedPxStart = dataDomainRequiredStart <= dataDomain[0] ? this.dataScale(dataDomain[0]) - this.dataScale(dataDomainRequiredStart) : 0\n const bleedPxEnd = dataDomainRequiredEnd > dataDomain[1] ? this.dataScale(dataDomainRequiredEnd) - this.dataScale(dataDomain[1]) : 0\n\n return {\n top: this.isVertical() ? 0 : (isHorizontalAndFlipped ? -bleedPxEnd : bleedPxStart),\n bottom: this.isVertical() ? 0 : (isHorizontalAndFlipped ? -bleedPxStart : bleedPxEnd),\n left: this.isVertical() ? bleedPxStart : 0,\n right: this.isVertical() ? bleedPxEnd : 0,\n }\n }\n\n private get dataScale (): ContinuousScale {\n return this.isVertical() ? this.xScale : this.yScale\n }\n\n private get valueScale (): ContinuousScale {\n return this.isVertical() ? this.yScale : this.xScale\n }\n\n private isVertical (): boolean {\n return this.config.orientation === Orientation.Vertical\n }\n\n _render (customDuration?: number): void {\n const { config } = this\n const duration = isNumber(customDuration)\n ? customDuration\n : config.duration\n const groupWidth = this._getGroupWidth()\n\n const yAccessors = this.getAccessors()\n const innerBandScaleRange = [-groupWidth / 2, groupWidth / 2] as [\n number,\n number,\n ]\n const innerBandScale = scaleBand<number>()\n .domain(range(yAccessors.length))\n .range(innerBandScaleRange)\n .paddingInner(config.barPadding)\n .paddingOuter(config.barPadding)\n\n const barGroups = this.g\n .selectAll<SVGGElement, Datum>(`.${s.barGroup}`)\n .data(this._barData, (d, i) => `${getString(d, config.id, i) ?? i}`)\n\n const getBarGroupsTransform = (d: Datum, i: number): string => {\n const v = this.dataScale(getNumber(d, config.x, i))\n const x = this.isVertical() ? v : 0\n const y = this.isVertical() ? 0 : v\n return `translate(${x},${y})`\n }\n\n const barGroupsEnter = barGroups\n .enter()\n .append('g')\n .attr('class', s.barGroup)\n .attr('transform', getBarGroupsTransform)\n .style('opacity', 1)\n\n const barGroupsMerged = barGroupsEnter.merge(barGroups)\n smartTransition(barGroupsMerged, duration)\n .attr('transform', getBarGroupsTransform)\n .style('opacity', 1)\n\n const barGroupExit = barGroups.exit().attr('class', s.barGroupExit)\n smartTransition(barGroupExit, duration).style('opacity', 0).remove()\n\n // Animate exiting bars going down\n smartTransition(barGroupExit.selectAll<SVGPathElement, Datum>(`.${s.bar}`), duration)\n .attr('transform', (d, i, e) => {\n return this.isVertical()\n ? `translate(0,${this.yScale(0)}) scale(1,0)`\n : `translate(${this.xScale(0)},0) scale(0,1)`\n })\n\n const barWidth = innerBandScale.bandwidth()\n const bars = barGroupsMerged\n .selectAll<SVGPathElement, Datum>(`.${s.bar}`)\n .data((d) => yAccessors.map(() => d))\n\n const valueAxisDirection = this._getValueAxisDirection()\n const barsEnter = bars\n .enter()\n .append('path')\n .attr('class', s.bar)\n .attr('d', (d, i) => {\n const x = innerBandScale(i)\n const y = this.valueScale(0)\n const width = barWidth\n const height = 0\n return this._getBarPath(x, y, width, height, false, valueAxisDirection)\n })\n .style('fill', (d, i) => getColor(d, config.color, i))\n\n const barsMerged = barsEnter.merge(bars)\n smartTransition(barsMerged, duration)\n .attr('d', (d, j) => {\n const x = innerBandScale(j)\n const width = barWidth\n\n // Todo: Find a way to pass the datum index to `getNumber` below\n const value = getNumber(d, yAccessors[j])\n const isNegative = value < 0\n let y = isNegative ? this.valueScale(0) : this.valueScale(value || 0)\n let height = Math.abs(this.valueScale(0) - this.valueScale(value)) || 0\n\n // Optionally set minimum bar height\n if (height < config.barMinHeight) {\n const dir = valueAxisDirection === Direction.North ? -1 : 1\n y = this.valueScale(0) + dir * config.barMinHeight\n height = config.barMinHeight\n }\n return this._getBarPath(x, y, width, height, isNegative, valueAxisDirection)\n })\n .style('fill', (d, i) => getColor(d, config.color, i))\n .style('cursor', (d, i) => getString(d, config.cursor, i))\n\n smartTransition(bars.exit(), duration).remove()\n }\n\n _getValueAxisDirection (): Direction.North | Direction.South {\n return this.valueScale.range()[0] > this.valueScale.range()[1]\n ? Direction.North\n : Direction.South\n }\n\n _getVisibleData (): Datum[] {\n const {\n config,\n datamodel: { data },\n } = this\n const groupWidth = this._getGroupWidth()\n const halfGroupWidth = data.length < 2 ? 0 : groupWidth / 2\n\n const dataScale = this.dataScale\n const xHalfGroupWidth = Math.abs(\n (dataScale.invert(halfGroupWidth) as number) -\n (dataScale.invert(0) as number)\n )\n const filtered = data?.filter((d, i) => {\n const v = getNumber(d, config.x, i)\n const domain: number[] | Date[] = dataScale.domain()\n const domainMin = +domain[0]\n const domainMax = +domain[1]\n return (\n v >= domainMin - xHalfGroupWidth && v <= domainMax + xHalfGroupWidth\n )\n })\n\n return filtered\n }\n\n _getBarPath (\n x: number,\n y: number,\n width: number,\n height: number,\n isNegative: boolean,\n direction: Direction.North | Direction.South\n ): string {\n const { config } = this\n\n const cornerRadius = config.roundedCorners\n ? isNumber(config.roundedCorners)\n ? +config.roundedCorners\n : width / 2\n : 0\n const cornerRadiusClamped = clamp(\n cornerRadius,\n 0,\n Math.min(height, width) / 2\n )\n\n const isNorthDirected = direction === Direction.North\n const roundedTop = this.isVertical() && isNegative !== isNorthDirected\n const roundedBottom = this.isVertical() && isNegative === isNorthDirected\n const roundedLeft = !this.isVertical() && isNegative\n const roundedRight = !this.isVertical() && !isNegative\n\n return roundedRectPath({\n x: this.isVertical() ? x : y + (isNorthDirected ? 0 : -height),\n y: this.isVertical() ? y + (isNorthDirected ? 0 : -height) : x,\n w: this.isVertical() ? width : height,\n h: this.isVertical() ? height : width,\n tl: roundedTop || roundedLeft,\n tr: roundedTop || roundedRight,\n bl: roundedBottom || roundedLeft,\n br: roundedBottom || roundedRight,\n r: cornerRadiusClamped,\n })\n }\n\n _getGroupWidth (): number {\n const {\n config,\n datamodel: { data },\n } = this\n if (isEmpty(data)) return 0\n if (config.groupWidth) { return min([config.groupWidth, config.groupMaxWidth]) }\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n const isOrdinal = this.dataScale.bandwidth\n const domain = (\n this.dataScale.domain ? this.dataScale.domain() : []\n ) as number[]\n const domainLength = isOrdinal ? domain.length : domain[1] - domain[0]\n\n // If the dataStep property is provided the amount of data elements is calculates as domainLength / dataStep\n // otherwise we get the number of data elements within the domain range\n // Or if the scale is ordinal we use data.length\n let dataSize =\n 1 + domainLength / config.dataStep ||\n (!isOrdinal &&\n data.filter((d, i) => {\n const value = getNumber(d, config.x, i)\n return value >= domain[0] && value <= domain[1]\n }).length) ||\n data.length\n\n // We increase the dataSize by 1 to take into account possible additional domain space\n if (!isOrdinal && dataSize >= 2) dataSize += 1\n\n const c = dataSize < 2 ? 1 : 1 - config.groupPadding\n const groupWidth =\n (c * (this.isVertical() ? this._width : this._height)) / dataSize\n return min([groupWidth, config.groupMaxWidth])\n }\n\n getValueScaleExtent (scaleByVisibleData: boolean): number[] {\n const { datamodel } = this\n const yAccessors = this.getAccessors()\n\n const data = scaleByVisibleData ? this._getVisibleData() : datamodel.data\n const min = getMin(data, ...yAccessors)\n const max = getMax(data, ...yAccessors)\n return [min > 0 ? 0 : min, max < 0 ? 0 : max]\n }\n\n _raiseSelection (d, i, els): void {\n select(els[i]).raise()\n }\n\n getDataScaleExtent (): number[] {\n const { config, datamodel } = this\n return getExtent(datamodel.data, config.x)\n }\n\n getYDataExtent (scaleByVisibleData: boolean): number[] {\n return this.isVertical()\n ? this.getValueScaleExtent(scaleByVisibleData)\n : this.getDataScaleExtent()\n }\n\n getXDataExtent (): number[] {\n return this.isVertical()\n ? this.getDataScaleExtent()\n : this.getValueScaleExtent(false)\n }\n}\n"],"names":["s.barGroup","barGroupExit","s.barGroupExit","s.bar","s"],"mappings":";;;;;;;;;;;;;;AA0BM,MAAO,UAAkB,SAAQ,eAAwD,CAAA;AAmB7F,IAAA,WAAA,CAAa,MAAyC,EAAA;AACpD,QAAA,KAAK,EAAE,CAAA;QAlBC,IAAc,CAAA,cAAA,GAAG,uBAA2D,CAAA;AAC/E,QAAA,IAAA,CAAA,MAAM,GAAqC,IAAI,CAAC,cAAc,CAAA;AAErE,QAAA,IAAA,CAAA,YAAY,GAAG,MACb,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;AAE1D,QAAA,IAAA,CAAA,MAAM,GAAG;A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AAS,CAAC,IAAI,CAAA;QACzE,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,EAAE,GAAG,UAAU,CAAC,CAAA;QACvC,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,EAAE,GAAG,UAAU,CAAC,CAAA;QACvC,OAAO,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,GAAG,EAAE,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,CAAA;KAC9C;AAED,IAAA,eAAe,CAAE,CAAC,EAAE,CAAC,EAAE,GAAG,EAAA;QACxB,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAA;KACvB;IAED,kBAAkB,GAAA;AAChB,QAAA,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,CAAA;QAClC,OAAO,SAAS,CAAC,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAA;KAC3C;AAED,IAAA,cAAc,CAAE,kBAA2B,EAAA;QACzC,OAAO,IAAI,CAAC,UAAU,EAAE;AACtB,cAAE,IAAI,CAAC,mBAAmB,CAAC,kBAAkB,CAAC;AAC9C,cAAE,IAAI,CAAC,kBAAkB,EAAE,CAAA;KAC9B;IAED,cAAc,GAAA;QACZ,OAAO,IAAI,CAAC,UAAU,EAAE;AACtB,cAAE,IAAI,CAAC,kBAAkB,EAAE;AAC3B,cAAE,IAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAA;KACpC;;AA1SM,UAAS,CAAA,SAAA,GAAGC,KAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/grouped-bar/index.ts"],"sourcesContent":["import { scaleBand } from 'd3-scale'\nimport { min, max, range } from 'd3-array'\nimport { select } from 'd3'\n\n// Core\nimport { XYComponentCore } from 'core/xy-component'\n\n// Utils\nimport { clamp, getExtent, getMax, getMin, getNumber, getString, isArray, isEmpty, isNumber } from 'utils/data'\nimport { roundedRectPath } from 'utils/path'\nimport { smartTransition } from 'utils/d3'\nimport { getColor } from 'utils/color'\n\n// Types\nimport { NumericAccessor } from 'types/accessor'\nimport { Spacing } from 'types/spacing'\nimport { Direction } from 'types/direction'\nimport { Orientation } from 'types/position'\nimport { ContinuousScale } from 'types/scale'\n\n// Config\nimport { GroupedBarConfig, GroupedBarConfigInterface } from './config'\n\n// Styles\nimport * as s from './style'\n\nexport class GroupedBar<Datum> extends XYComponentCore<Datum, GroupedBarConfig<Datum>, GroupedBarConfigInterface<Datum>> {\n static selectors = s\n config: GroupedBarConfig<Datum> = new GroupedBarConfig()\n getAccessors = (): NumericAccessor<Datum>[] =>\n isArray(this.config.y) ? this.config.y : [this.config.y]\n\n events = {\n [GroupedBar.selectors.barGroup]: {\n mouseover: this._raiseSelection,\n },\n [GroupedBar.selectors.bar]: {\n mouseover: this._raiseSelection,\n },\n }\n\n private _barData: Datum[] = []\n\n constructor (config?: GroupedBarConfigInterface<Datum>) {\n super()\n if (config) this.config.init(config)\n }\n\n get bleed (): Spacing {\n this._barData = this._getVisibleData()\n if (this._barData.length === 0) return { top: 0, bottom: 0, left: 0, right: 0 }\n\n // By default, horizontal orientation is \"flipped\", i.e. the `yDirection` of `XYContainer` is set to `Direction.North`\n const isHorizontalAndFlipped = !this.isVertical() && (this.dataScale.range()[0] > this.dataScale.range()[1])\n const dataDomain = this.dataScale.domain()\n const halfGroupWidth = this._getGroupWidth() / 2\n\n const dataScaleValues = this._barData.map((d, i) => getNumber(d, this.config.x, i))\n const firstDataValue = min(dataScaleValues)\n const lastDataValue = max(dataScaleValues)\n const firstValuePx = this.dataScale(firstDataValue)\n const lastValuePx = this.dataScale(lastDataValue)\n\n const dataDomainRequiredStart = this.dataScale.invert(firstValuePx + (isHorizontalAndFlipped ? halfGroupWidth : -halfGroupWidth))\n const dataDomainRequiredEnd = this.dataScale.invert(lastValuePx + (isHorizontalAndFlipped ? -halfGroupWidth : halfGroupWidth))\n const bleedPxStart = dataDomainRequiredStart <= dataDomain[0] ? this.dataScale(dataDomain[0]) - this.dataScale(dataDomainRequiredStart) : 0\n const bleedPxEnd = dataDomainRequiredEnd > dataDomain[1] ? this.dataScale(dataDomainRequiredEnd) - this.dataScale(dataDomain[1]) : 0\n\n return {\n top: this.isVertical() ? 0 : (isHorizontalAndFlipped ? -bleedPxEnd : bleedPxStart),\n bottom: this.isVertical() ? 0 : (isHorizontalAndFlipped ? -bleedPxStart : bleedPxEnd),\n left: this.isVertical() ? bleedPxStart : 0,\n right: this.isVertical() ? bleedPxEnd : 0,\n }\n }\n\n private get dataScale (): ContinuousScale {\n return this.isVertical() ? this.xScale : this.yScale\n }\n\n private get valueScale (): ContinuousScale {\n return this.isVertical() ? this.yScale : this.xScale\n }\n\n private isVertical (): boolean {\n return this.config.orientation === Orientation.Vertical\n }\n\n _render (customDuration?: number): void {\n const { config } = this\n const duration = isNumber(customDuration)\n ? customDuration\n : config.duration\n const groupWidth = this._getGroupWidth()\n\n const yAccessors = this.getAccessors()\n const innerBandScaleRange = [-groupWidth / 2, groupWidth / 2] as [\n number,\n number,\n ]\n const innerBandScale = scaleBand<number>()\n .domain(range(yAccessors.length))\n .range(innerBandScaleRange)\n .paddingInner(config.barPadding)\n .paddingOuter(config.barPadding)\n\n const barGroups = this.g\n .selectAll<SVGGElement, Datum>(`.${s.barGroup}`)\n .data(this._barData, (d, i) => `${getString(d, config.id, i) ?? i}`)\n\n const getBarGroupsTransform = (d: Datum, i: number): string => {\n const v = this.dataScale(getNumber(d, config.x, i))\n const x = this.isVertical() ? v : 0\n const y = this.isVertical() ? 0 : v\n return `translate(${x},${y})`\n }\n\n const barGroupsEnter = barGroups\n .enter()\n .append('g')\n .attr('class', s.barGroup)\n .attr('transform', getBarGroupsTransform)\n .style('opacity', 1)\n\n const barGroupsMerged = barGroupsEnter.merge(barGroups)\n smartTransition(barGroupsMerged, duration)\n .attr('transform', getBarGroupsTransform)\n .style('opacity', 1)\n\n const barGroupExit = barGroups.exit().attr('class', s.barGroupExit)\n smartTransition(barGroupExit, duration).style('opacity', 0).remove()\n\n // Animate exiting bars going down\n smartTransition(barGroupExit.selectAll<SVGPathElement, Datum>(`.${s.bar}`), duration)\n .attr('transform', (d, i, e) => {\n return this.isVertical()\n ? `translate(0,${this.yScale(0)}) scale(1,0)`\n : `translate(${this.xScale(0)},0) scale(0,1)`\n })\n\n const barWidth = innerBandScale.bandwidth()\n const bars = barGroupsMerged\n .selectAll<SVGPathElement, Datum>(`.${s.bar}`)\n .data((d) => yAccessors.map(() => d))\n\n const valueAxisDirection = this._getValueAxisDirection()\n const barsEnter = bars\n .enter()\n .append('path')\n .attr('class', s.bar)\n .attr('d', (d, i) => {\n const x = innerBandScale(i)\n const y = this.valueScale(0)\n const width = barWidth\n const height = 0\n return this._getBarPath(x, y, width, height, false, valueAxisDirection)\n })\n .style('fill', (d, i) => getColor(d, config.color, i))\n\n const barsMerged = barsEnter.merge(bars)\n smartTransition(barsMerged, duration)\n .attr('d', (d, j) => {\n const x = innerBandScale(j)\n const width = barWidth\n\n // Todo: Find a way to pass the datum index to `getNumber` below\n const value = getNumber(d, yAccessors[j])\n const isNegative = value < 0\n let y = isNegative ? this.valueScale(0) : this.valueScale(value || 0)\n let height = Math.abs(this.valueScale(0) - this.valueScale(value)) || 0\n\n // Optionally set minimum bar height\n if (height < config.barMinHeight) {\n const dir = valueAxisDirection === Direction.North ? -1 : 1\n y = this.valueScale(0) + dir * config.barMinHeight\n height = config.barMinHeight\n }\n return this._getBarPath(x, y, width, height, isNegative, valueAxisDirection)\n })\n .style('fill', (d, i) => getColor(d, config.color, i))\n .style('cursor', (d, i) => getString(d, config.cursor, i))\n\n smartTransition(bars.exit(), duration).remove()\n }\n\n _getValueAxisDirection (): Direction.North | Direction.South {\n return this.valueScale.range()[0] > this.valueScale.range()[1]\n ? Direction.North\n : Direction.South\n }\n\n _getVisibleData (): Datum[] {\n const {\n config,\n datamodel: { data },\n } = this\n const groupWidth = this._getGroupWidth()\n const halfGroupWidth = data.length < 2 ? 0 : groupWidth / 2\n\n const dataScale = this.dataScale\n const xHalfGroupWidth = Math.abs(\n (dataScale.invert(halfGroupWidth) as number) -\n (dataScale.invert(0) as number)\n )\n const filtered = data?.filter((d, i) => {\n const v = getNumber(d, config.x, i)\n const domain: number[] | Date[] = dataScale.domain()\n const domainMin = +domain[0]\n const domainMax = +domain[1]\n return (\n v >= domainMin - xHalfGroupWidth && v <= domainMax + xHalfGroupWidth\n )\n })\n\n return filtered\n }\n\n _getBarPath (\n x: number,\n y: number,\n width: number,\n height: number,\n isNegative: boolean,\n direction: Direction.North | Direction.South\n ): string {\n const { config } = this\n\n const cornerRadius = config.roundedCorners\n ? isNumber(config.roundedCorners)\n ? +config.roundedCorners\n : width / 2\n : 0\n const cornerRadiusClamped = clamp(\n cornerRadius,\n 0,\n Math.min(height, width) / 2\n )\n\n const isNorthDirected = direction === Direction.North\n const roundedTop = this.isVertical() && isNegative !== isNorthDirected\n const roundedBottom = this.isVertical() && isNegative === isNorthDirected\n const roundedLeft = !this.isVertical() && isNegative\n const roundedRight = !this.isVertical() && !isNegative\n\n return roundedRectPath({\n x: this.isVertical() ? x : y + (isNorthDirected ? 0 : -height),\n y: this.isVertical() ? y + (isNorthDirected ? 0 : -height) : x,\n w: this.isVertical() ? width : height,\n h: this.isVertical() ? height : width,\n tl: roundedTop || roundedLeft,\n tr: roundedTop || roundedRight,\n bl: roundedBottom || roundedLeft,\n br: roundedBottom || roundedRight,\n r: cornerRadiusClamped,\n })\n }\n\n _getGroupWidth (): number {\n const {\n config,\n datamodel: { data },\n } = this\n if (isEmpty(data)) return 0\n if (config.groupWidth) { return min([config.groupWidth, config.groupMaxWidth]) }\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n const isOrdinal = this.dataScale.bandwidth\n const domain = (\n this.dataScale.domain ? this.dataScale.domain() : []\n ) as number[]\n const domainLength = isOrdinal ? domain.length : domain[1] - domain[0]\n\n // If the dataStep property is provided the amount of data elements is calculates as domainLength / dataStep\n // otherwise we get the number of data elements within the domain range\n // Or if the scale is ordinal we use data.length\n let dataSize =\n 1 + domainLength / config.dataStep ||\n (!isOrdinal &&\n data.filter((d, i) => {\n const value = getNumber(d, config.x, i)\n return value >= domain[0] && value <= domain[1]\n }).length) ||\n data.length\n\n // We increase the dataSize by 1 to take into account possible additional domain space\n if (!isOrdinal && dataSize >= 2) dataSize += 1\n\n const c = dataSize < 2 ? 1 : 1 - config.groupPadding\n const groupWidth =\n (c * (this.isVertical() ? this._width : this._height)) / dataSize\n return min([groupWidth, config.groupMaxWidth])\n }\n\n getValueScaleExtent (scaleByVisibleData: boolean): number[] {\n const { datamodel } = this\n const yAccessors = this.getAccessors()\n\n const data = scaleByVisibleData ? this._getVisibleData() : datamodel.data\n const min = getMin(data, ...yAccessors)\n const max = getMax(data, ...yAccessors)\n return [min > 0 ? 0 : min, max < 0 ? 0 : max]\n }\n\n _raiseSelection (d, i, els): void {\n select(els[i]).raise()\n }\n\n getDataScaleExtent (): number[] {\n const { config, datamodel } = this\n return getExtent(datamodel.data, config.x)\n }\n\n getYDataExtent (scaleByVisibleData: boolean): number[] {\n return this.isVertical()\n ? this.getValueScaleExtent(scaleByVisibleData)\n : this.getDataScaleExtent()\n }\n\n getXDataExtent (): number[] {\n return this.isVertical()\n ? this.getDataScaleExtent()\n : this.getValueScaleExtent(false)\n }\n}\n"],"names":["s.barGroup","barGroupExit","s.barGroupExit","s.bar","s"],"mappings":";;;;;;;;;;;;;;AA0BM,MAAO,UAAkB,SAAQ,eAAiF,CAAA;AAiBtH,IAAA,WAAA,CAAa,MAAyC,EAAA;AACpD,QAAA,KAAK,EAAE,CAAA;AAhBT,QAAA,IAAA,CAAA,MAAM,GAA4B,IAAI,gBAAgB,EAAE,CAAA;AACxD,QAAA,IAAA,CAAA,YAAY,GAAG,MACb,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,I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Y,EAAE,CAAA;AAEtC,QAAA,MAAM,IAAI,GAAG,kBAAkB,GAAG,IAAI,CAAC,eAAe,EAAE,GAAG,SAAS,CAAC,IAAI,CAAA;QACzE,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,EAAE,GAAG,UAAU,CAAC,CAAA;QACvC,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,EAAE,GAAG,UAAU,CAAC,CAAA;QACvC,OAAO,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,GAAG,EAAE,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,CAAA;KAC9C;AAED,IAAA,eAAe,CAAE,CAAC,EAAE,CAAC,EAAE,GAAG,EAAA;QACxB,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAA;KACvB;IAED,kBAAkB,GAAA;AAChB,QAAA,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,CAAA;QAClC,OAAO,SAAS,CAAC,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAA;KAC3C;AAED,IAAA,cAAc,CAAE,kBAA2B,EAAA;QACzC,OAAO,IAAI,CAAC,UAAU,EAAE;AACtB,cAAE,IAAI,CAAC,mBAAmB,CAAC,kBAAkB,CAAC;AAC9C,cAAE,IAAI,CAAC,kBAAkB,EAAE,CAAA;KAC9B;IAED,cAAc,GAAA;QACZ,OAAO,IAAI,CAAC,UAAU,EAAE;AACtB,cAAE,IAAI,CAAC,kBAAkB,EAAE;AAC3B,cAAE,IAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAA;KACpC;;AAxSM,UAAS,CAAA,SAAA,GAAGC,KAAC;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LeafletMapConfigInterface } from "../leaflet-map/config";
|
|
1
|
+
import { LeafletMapConfig, LeafletMapConfigInterface } from "../leaflet-map/config";
|
|
2
2
|
import { ColorAccessor, NumericAccessor } from "../../types/accessor";
|
|
3
3
|
import { GenericDataRecord } from "../../types/data";
|
|
4
4
|
export interface LeafletFlowMapConfigInterface<PointDatum extends GenericDataRecord, FlowDatum extends GenericDataRecord> extends LeafletMapConfigInterface<PointDatum> {
|
|
@@ -29,4 +29,18 @@ export interface LeafletFlowMapConfigInterface<PointDatum extends GenericDataRec
|
|
|
29
29
|
/** Flow source point mouse leave callback function. Default: `undefined` */
|
|
30
30
|
onSourcePointMouseLeave?: (f: FlowDatum, event: MouseEvent) => void;
|
|
31
31
|
}
|
|
32
|
-
export declare
|
|
32
|
+
export declare class LeafletFlowMapConfig<PointDatum extends GenericDataRecord = GenericDataRecord, FlowDatum extends GenericDataRecord = GenericDataRecord> extends LeafletMapConfig<PointDatum> implements LeafletFlowMapConfigInterface<PointDatum, FlowDatum> {
|
|
33
|
+
sourceLongitude: (f: FlowDatum) => number;
|
|
34
|
+
sourceLatitude: (f: FlowDatum) => number;
|
|
35
|
+
targetLongitude: (f: FlowDatum) => number;
|
|
36
|
+
targetLatitude: (f: FlowDatum) => number;
|
|
37
|
+
sourcePointRadius: number;
|
|
38
|
+
sourcePointColor: string;
|
|
39
|
+
flowParticleColor: string;
|
|
40
|
+
flowParticleRadius: number;
|
|
41
|
+
flowParticleSpeed: number;
|
|
42
|
+
flowParticleDensity: number;
|
|
43
|
+
onSourcePointClick: any;
|
|
44
|
+
onSourcePointMouseEnter: any;
|
|
45
|
+
onSourcePointMouseLeave: any;
|
|
46
|
+
}
|
|
@@ -1,7 +1,25 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LeafletMapConfig } from '../leaflet-map/config.js';
|
|
2
2
|
|
|
3
3
|
/* eslint-disable dot-notation */
|
|
4
|
-
|
|
4
|
+
class LeafletFlowMapConfig extends LeafletMapConfig {
|
|
5
|
+
constructor() {
|
|
6
|
+
super(...arguments);
|
|
7
|
+
this.sourceLongitude = (f) => f['sourceLongitude'];
|
|
8
|
+
this.sourceLatitude = (f) => f['sourceLatitude'];
|
|
9
|
+
this.targetLongitude = (f) => f['targetLongitude'];
|
|
10
|
+
this.targetLatitude = (f) => f['targetLatitude'];
|
|
11
|
+
this.sourcePointRadius = 3;
|
|
12
|
+
this.sourcePointColor = '#88919f';
|
|
13
|
+
this.flowParticleColor = '#949dad';
|
|
14
|
+
this.flowParticleRadius = 1.1;
|
|
15
|
+
this.flowParticleSpeed = 0.07;
|
|
16
|
+
this.flowParticleDensity = 0.6;
|
|
17
|
+
// Events
|
|
18
|
+
this.onSourcePointClick = undefined;
|
|
19
|
+
this.onSourcePointMouseEnter = undefined;
|
|
20
|
+
this.onSourcePointMouseLeave = undefined;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
5
23
|
|
|
6
|
-
export {
|
|
24
|
+
export { LeafletFlowMapConfig };
|
|
7
25
|
//# sourceMappingURL=config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sources":["../../../src/components/leaflet-flow-map/config.ts"],"sourcesContent":["/* eslint-disable dot-notation */\n\n// Config\nimport {
|
|
1
|
+
{"version":3,"file":"config.js","sources":["../../../src/components/leaflet-flow-map/config.ts"],"sourcesContent":["/* eslint-disable dot-notation */\n\n// Config\nimport { LeafletMapConfig, LeafletMapConfigInterface } from 'components/leaflet-map/config'\n\n// Types\nimport { ColorAccessor, NumericAccessor } from 'types/accessor'\nimport { GenericDataRecord } from 'types/data'\n\nexport interface LeafletFlowMapConfigInterface<PointDatum extends GenericDataRecord, FlowDatum extends GenericDataRecord> extends LeafletMapConfigInterface<PointDatum> {\n /** Flow source point longitude accessor function or value. Default:.`f => f.sourceLongitude` */\n sourceLongitude?: NumericAccessor<FlowDatum>;\n /** Flow source point latitude accessor function or value. Default: `f => f.sourceLatitude` */\n sourceLatitude?: NumericAccessor<FlowDatum>;\n /** Flow target point longitude accessor function or value. Default: `f => f.targetLongitude` */\n targetLongitude?: NumericAccessor<FlowDatum>;\n /** Flow target point latitude accessor function or value. Default: `f => f.targetLatitude` */\n targetLatitude?: NumericAccessor<FlowDatum>;\n /** Flow source point radius accessor function or value. Default: `3` */\n sourcePointRadius?: NumericAccessor<FlowDatum>;\n /** Source point color accessor function or value. Default: `'#88919f'` */\n sourcePointColor?: ColorAccessor<FlowDatum>;\n /** Flow particle color accessor function or value. Default: `'#949dad'` */\n flowParticleColor?: ColorAccessor<FlowDatum>;\n /** Flow particle radius accessor function or value. Default: `1.1` */\n flowParticleRadius?: NumericAccessor<FlowDatum>;\n /** Flow particle speed accessor function or value. The unit is arbitrary, recommended range is 0 – 0.2. Default: `0.07` */\n flowParticleSpeed?: NumericAccessor<FlowDatum>;\n /** Flow particle density accessor function or value on the range of [0, 1]. Default: `0.6` */\n flowParticleDensity?: NumericAccessor<FlowDatum>;\n\n // Events\n /** Flow source point click callback function. Default: `undefined` */\n onSourcePointClick?: (f: FlowDatum, x: number, y: number, event: MouseEvent) => void;\n /** Flow source point mouse over callback function. Default: `undefined` */\n onSourcePointMouseEnter?: (f: FlowDatum, x: number, y: number, event: MouseEvent) => void;\n /** Flow source point mouse leave callback function. Default: `undefined` */\n onSourcePointMouseLeave?: (f: FlowDatum, event: MouseEvent) => void;\n}\n\nexport class LeafletFlowMapConfig<\n PointDatum extends GenericDataRecord = GenericDataRecord,\n FlowDatum extends GenericDataRecord = GenericDataRecord,\n> extends LeafletMapConfig<PointDatum> implements LeafletFlowMapConfigInterface<PointDatum, FlowDatum> {\n sourceLongitude = (f: FlowDatum): number => f['sourceLongitude'] as number\n sourceLatitude = (f: FlowDatum): number => f['sourceLatitude'] as number\n targetLongitude = (f: FlowDatum): number => f['targetLongitude'] as number\n targetLatitude = (f: FlowDatum): number => f['targetLatitude'] as number\n sourcePointRadius = 3\n sourcePointColor = '#88919f'\n flowParticleColor = '#949dad'\n flowParticleRadius = 1.1\n flowParticleSpeed = 0.07\n flowParticleDensity = 0.6\n\n // Events\n onSourcePointClick = undefined\n onSourcePointMouseEnter = undefined\n onSourcePointMouseLeave = undefined\n}\n"],"names":[],"mappings":";;AAAA;AAwCM,MAAO,oBAGX,SAAQ,gBAA4B,CAAA;AAHtC,IAAA,WAAA,GAAA;;QAIE,IAAe,CAAA,eAAA,GAAG,CAAC,CAAY,KAAa,CAAC,CAAC,iBAAiB,CAAW,CAAA;QAC1E,IAAc,CAAA,cAAA,GAAG,CAAC,CAAY,KAAa,CAAC,CAAC,gBAAgB,CAAW,CAAA;QACxE,IAAe,CAAA,eAAA,GAAG,CAAC,CAAY,KAAa,CAAC,CAAC,iBAAiB,CAAW,CAAA;QAC1E,IAAc,CAAA,cAAA,GAAG,CAAC,CAAY,KAAa,CAAC,CAAC,gBAAgB,CAAW,CAAA;QACxE,IAAiB,CAAA,iBAAA,GAAG,CAAC,CAAA;QACrB,IAAgB,CAAA,gBAAA,GAAG,SAAS,CAAA;QAC5B,IAAiB,CAAA,iBAAA,GAAG,SAAS,CAAA;QAC7B,IAAkB,CAAA,kBAAA,GAAG,GAAG,CAAA;QACxB,IAAiB,CAAA,iBAAA,GAAG,IAAI,CAAA;QACxB,IAAmB,CAAA,mBAAA,GAAG,GAAG,CAAA;;QAGzB,IAAkB,CAAA,kBAAA,GAAG,SAAS,CAAA;QAC9B,IAAuB,CAAA,uBAAA,GAAG,SAAS,CAAA;QACnC,IAAuB,CAAA,uBAAA,GAAG,SAAS,CAAA;KACpC;AAAA;;;;"}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { ComponentCore } from "../../core/component";
|
|
2
2
|
import { ComponentType } from "../../types/component";
|
|
3
3
|
import { GenericDataRecord } from "../../types/data";
|
|
4
|
-
import { LeafletFlowMapConfigInterface } from './config';
|
|
4
|
+
import { LeafletFlowMapConfig, LeafletFlowMapConfigInterface } from './config';
|
|
5
5
|
import { Particle } from './types';
|
|
6
6
|
export declare class LeafletFlowMap<PointDatum extends GenericDataRecord, FlowDatum extends GenericDataRecord> extends ComponentCore<{
|
|
7
7
|
points: PointDatum[];
|
|
8
8
|
flows?: FlowDatum[];
|
|
9
|
-
}, LeafletFlowMapConfigInterface<PointDatum, FlowDatum>> {
|
|
9
|
+
}, LeafletFlowMapConfig<PointDatum, FlowDatum>, LeafletFlowMapConfigInterface<PointDatum, FlowDatum>> {
|
|
10
10
|
static selectors: typeof import("../leaflet-map/style");
|
|
11
|
-
protected _defaultConfig: LeafletFlowMapConfigInterface<PointDatum, FlowDatum>;
|
|
12
|
-
config: LeafletFlowMapConfigInterface<PointDatum, FlowDatum>;
|
|
13
11
|
type: ComponentType;
|
|
14
12
|
private leafletMap;
|
|
15
13
|
private leafletMapInstance;
|
|
@@ -19,6 +17,7 @@ export declare class LeafletFlowMap<PointDatum extends GenericDataRecord, FlowDa
|
|
|
19
17
|
private onCanvasMouseMoveBound;
|
|
20
18
|
private onCanvasClickBound;
|
|
21
19
|
private canvasElement;
|
|
20
|
+
config: LeafletFlowMapConfig<PointDatum, FlowDatum>;
|
|
22
21
|
private panningOffset;
|
|
23
22
|
private resizeObserver;
|
|
24
23
|
private renderer;
|
|
@@ -6,19 +6,18 @@ import { throttle, getNumber } from '../../utils/data.js';
|
|
|
6
6
|
import { getDataLatLngBounds } from '../../utils/map.js';
|
|
7
7
|
import { getColor } from '../../utils/color.js';
|
|
8
8
|
import { LeafletMap } from '../leaflet-map/index.js';
|
|
9
|
-
import {
|
|
9
|
+
import { LeafletFlowMapConfig } from './config.js';
|
|
10
10
|
|
|
11
11
|
class LeafletFlowMap extends ComponentCore {
|
|
12
12
|
constructor(container, config, data) {
|
|
13
13
|
var _a;
|
|
14
14
|
super(ComponentType.HTML);
|
|
15
|
-
this._defaultConfig = LeafletFlowMapDefaultConfig;
|
|
16
|
-
this.config = this._defaultConfig;
|
|
17
15
|
this.type = ComponentType.HTML;
|
|
18
16
|
this.flows = [];
|
|
19
17
|
this.points = [];
|
|
20
18
|
this.onCanvasMouseMoveBound = throttle(this.onCanvasMouseMove.bind(this), 60);
|
|
21
19
|
this.onCanvasClickBound = this.onCanvasClick.bind(this);
|
|
20
|
+
this.config = new LeafletFlowMapConfig();
|
|
22
21
|
this.panningOffset = { x: 0, y: 0 };
|
|
23
22
|
this.particles = [];
|
|
24
23
|
this.leafletMap = new LeafletMap(container, config, (_a = data === null || data === void 0 ? void 0 : data.points) !== null && _a !== void 0 ? _a : []);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/leaflet-flow-map/index.ts"],"sourcesContent":["import { select } from 'd3-selection'\n\nimport { ComponentCore } from 'core/component'\nimport { ComponentType } from 'types/component'\n\n// Utils\nimport { ResizeObserver } from 'utils/resize-observer'\nimport { getNumber, throttle } from 'utils/data'\nimport { getDataLatLngBounds } from 'utils/map'\nimport { getColor } from 'utils/color'\n\n// Components\nimport { LeafletMap } from 'components/leaflet-map'\n\n// Types\nimport { Bounds } from 'components/leaflet-map/types'\nimport { GenericDataRecord } from 'types/data'\n\n// Config\nimport { LeafletFlowMapDefaultConfig, LeafletFlowMapConfigInterface } from './config'\n\n// Local Types\nimport { LatLon, Particle } from './types'\n\n// Renderer\nimport { PointRenderer as PointRendererType } from './renderer'\n\nexport class LeafletFlowMap<\n PointDatum extends GenericDataRecord,\n FlowDatum extends GenericDataRecord,\n> extends ComponentCore<\n { points: PointDatum[]; flows?: FlowDatum[] },\n LeafletFlowMapConfigInterface<PointDatum, FlowDatum>\n > {\n static selectors = LeafletMap.selectors\n protected _defaultConfig = LeafletFlowMapDefaultConfig as LeafletFlowMapConfigInterface<PointDatum, FlowDatum>\n public config: LeafletFlowMapConfigInterface<PointDatum, FlowDatum> = this._defaultConfig\n\n type = ComponentType.HTML\n private leafletMap: LeafletMap<PointDatum>\n private leafletMapInstance: L.Map\n private flows: FlowDatum[] = []\n private points: PointDatum[] = []\n private hoveredSourcePoint: FlowDatum | undefined\n private onCanvasMouseMoveBound = throttle(this.onCanvasMouseMove.bind(this), 60)\n private onCanvasClickBound = this.onCanvasClick.bind(this)\n private canvasElement: HTMLCanvasElement | undefined\n private panningOffset = { x: 0, y: 0 }\n\n private resizeObserver: ResizeObserver | undefined\n private renderer: PointRendererType | undefined\n particles: Particle[] = []\n\n constructor (container: HTMLDivElement, config?: LeafletFlowMapConfigInterface<PointDatum, FlowDatum>, data?: { points: PointDatum[]; flows?: FlowDatum[] }) {\n super(ComponentType.HTML)\n\n this.leafletMap = new LeafletMap<PointDatum>(container, config, data?.points ?? [])\n\n const rendererImportPromise = import('./renderer')\n Promise.all([rendererImportPromise, this.leafletMap.getLeafletInstancePromise()])\n .then((imports) => {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n const [{ PointRenderer }, leaflet] = imports\n\n this.leafletMapInstance = leaflet\n const canvasContainer = this.leafletMapInstance.getPanes().overlayPane as HTMLDivElement\n\n // Initialize renderer\n const canvas = select(canvasContainer).insert('canvas', ':first-child')\n this.canvasElement = canvas.node()\n this.renderer = new PointRenderer(canvasContainer, container.offsetWidth, container.offsetHeight, this.canvasElement)\n this.canvasElement.addEventListener('mousemove', this.onCanvasMouseMoveBound)\n this.canvasElement.addEventListener('click', this.onCanvasClickBound)\n\n this.leafletMap._onMapMoveEndInternal = this.onMapMove.bind(this)\n\n // Update renderer size on container resize\n this.resizeObserver = new ResizeObserver(() => {\n this.renderer.setSize(container.offsetWidth, container.offsetHeight)\n })\n this.resizeObserver.observe(container)\n\n if (config) this.setConfig(config)\n if (data) this.setData(data)\n this.animate()\n })\n }\n\n setConfig (config: LeafletFlowMapConfigInterface<PointDatum, FlowDatum>): void {\n super.setConfig(config)\n this.leafletMap.setConfig({ ...config, clusteringDistance: 0 })\n }\n\n setData (data: { points: PointDatum[]; flows?: FlowDatum[] }): void {\n super.setData(data)\n this.flows = data.flows\n this.points = data.points\n this.initParticles()\n this.leafletMap.setData(this.points)\n this.render()\n }\n\n render (): void {\n super.render()\n }\n\n initParticles (): void {\n this.clearParticles()\n for (const flow of this.flows) {\n const source = {\n lat: getNumber(flow, this.config.sourceLatitude),\n lon: getNumber(flow, this.config.sourceLongitude),\n }\n\n const target = {\n lat: getNumber(flow, this.config.targetLatitude),\n lon: getNumber(flow, this.config.targetLongitude),\n }\n\n // Add source particle, showing the origin of the flow\n const sourcePointRadius = getNumber(flow, this.config.sourcePointRadius)\n const sourcePointColor = getColor(flow, this.config.sourcePointColor)\n this.addParticle(source, source, source, 0, sourcePointRadius, sourcePointColor)\n\n // Add flow particles\n const dist = Math.sqrt((target.lat - source.lat) ** 2 + (target.lon - source.lon) ** 2)\n const numParticles = Math.round(dist * getNumber(flow, this.config.flowParticleDensity))\n const velocity = getNumber(flow, this.config.flowParticleSpeed)\n const r = getNumber(flow, this.config.flowParticleRadius)\n const color = getColor(flow, this.config.flowParticleColor)\n for (let i = 0; i < numParticles; i += 1) {\n const location = {\n lat: source.lat + (target.lat - source.lat) * i / numParticles,\n lon: source.lon + (target.lon - source.lon) * i / numParticles,\n }\n this.addParticle(source, target, location, velocity, r, color)\n }\n }\n\n this.renderer?.update(this.particles)\n }\n\n private addParticle (source: LatLon, target: LatLon, location = source, velocity = 0.05, r = 0.75, color?: string): void {\n const x = 0\n const y = 0\n this.particles.push({ x, y, source, target, location, velocity, r, color })\n }\n\n private clearParticles (): void {\n this.particles = []\n }\n\n private animate (): void {\n const map = this.leafletMapInstance\n\n requestAnimationFrame(() => {\n const zoomLevel = map?.getZoom()\n for (const p of this.particles) {\n const fullDist = Math.sqrt((p.target.lat - p.source.lat) ** 2 + (p.target.lon - p.source.lon) ** 2)\n const remainedDist = Math.sqrt((p.target.lat - p.location.lat) ** 2 + (p.target.lon - p.location.lon) ** 2)\n const angle = Math.atan2(p.target.lat - p.source.lat, p.target.lon - p.source.lon)\n p.location.lat += p.velocity * Math.sin(angle)\n p.location.lon += p.velocity * Math.cos(angle)\n\n if (\n (((p.target.lat > p.source.lat) && (p.location.lat > p.target.lat)) || ((p.target.lon > p.source.lon) && (p.location.lon > p.target.lon))) ||\n (((p.target.lat < p.source.lat) && (p.location.lat < p.target.lat)) || ((p.target.lon < p.source.lon) && (p.location.lon < p.target.lon)))\n ) {\n p.location.lat = p.source.lat\n p.location.lon = p.source.lon\n }\n\n const pos = map?.latLngToLayerPoint([p.location.lat, p.location.lon])\n const orthogonalArcShift = -(zoomLevel ** 2 * fullDist / 8) * Math.cos(Math.PI / 2 * (fullDist / 2 - remainedDist) / (fullDist / 2)) || 0\n p.x = pos?.x - this.panningOffset.x\n p.y = pos?.y + orthogonalArcShift - this.panningOffset.y\n }\n\n this.renderer.updatePointsPosition(this.particles)\n this.renderer.draw()\n this.animate()\n })\n }\n\n private getPointByScreenPos (x: number, y: number): [FlowDatum, number, number] | [] {\n const map = this.leafletMapInstance\n\n for (const flow of this.flows) {\n const lat = getNumber(flow, this.config.sourceLatitude)\n const lon = getNumber(flow, this.config.sourceLongitude)\n const r = getNumber(flow, this.config.sourcePointRadius)\n const pos = map?.latLngToLayerPoint([lat, lon])\n const posX = pos.x - this.panningOffset.x\n const posY = pos.y - this.panningOffset.y\n\n if ((Math.abs(x - posX) < r) && (Math.abs(y - posY) < r)) {\n return [flow, posX, posY]\n }\n }\n\n return []\n }\n\n private onCanvasMouseMove (event: MouseEvent): void {\n const { config } = this\n\n this.canvasElement.style.removeProperty('cursor')\n const [hoveredPoint, x, y] = this.getPointByScreenPos(event.offsetX, event.offsetY)\n if (hoveredPoint) this.canvasElement.style.cursor = 'default'\n\n if (this.hoveredSourcePoint !== hoveredPoint) {\n if (hoveredPoint) config.onSourcePointMouseEnter?.(hoveredPoint, x, y, event)\n if (this.hoveredSourcePoint) config.onSourcePointMouseLeave?.(this.hoveredSourcePoint, event)\n this.hoveredSourcePoint = hoveredPoint\n }\n }\n\n private onCanvasClick (event: MouseEvent): void {\n const { config } = this\n\n const [clickedPoint, x, y] = this.getPointByScreenPos(event.offsetX, event.offsetY)\n if (clickedPoint) config.onSourcePointClick?.(clickedPoint, x, y, event)\n }\n\n private onMapMove (leaflet: L.Map): void {\n const shift = leaflet.containerPointToLayerPoint([0, 0])\n this.panningOffset.x = shift.x\n this.panningOffset.y = shift.y\n this.canvasElement.style.transform = `translate(${shift.x}px, ${shift.y}px)`\n }\n\n public destroy (): void {\n this.resizeObserver?.disconnect()\n this.renderer?.destroy()\n this.canvasElement?.removeEventListener('mousemove', this.onCanvasMouseMoveBound)\n this.canvasElement?.removeEventListener('click', this.onCanvasClickBound)\n super.destroy()\n }\n\n // Leaflet Map useful methods\n public selectPointById (id: string, centerPoint = false): void { this.leafletMap.selectPointById(id, centerPoint) }\n public getSelectedPointId (): string | number | undefined { return this.leafletMap.getSelectedPointId() }\n public unselectPoint (): void { this.leafletMap.unselectPoint() }\n public zoomToPointById (id: string, selectNode = false, customZoomLevel?: number): void { this.leafletMap.zoomToPointById(id, selectNode, customZoomLevel) }\n public zoomIn (increment = 1): void { this.leafletMap.zoomIn(increment) }\n public zoomOut (increment = 1): void { this.leafletMap.zoomOut(increment) }\n public setZoom (zoomLevel: number): void { this.leafletMap.setZoom(zoomLevel) }\n public fitView (): void {\n const points: { lat: number; lon: number }[] = []\n\n for (const point of this.points) {\n points.push({\n lat: getNumber(point, this.config.pointLatitude),\n lon: getNumber(point, this.config.pointLongitude),\n })\n }\n\n for (const flow of this.flows) {\n const source = {\n lat: getNumber(flow, this.config.sourceLatitude),\n lon: getNumber(flow, this.config.sourceLongitude),\n }\n\n const target = {\n lat: getNumber(flow, this.config.targetLatitude),\n lon: getNumber(flow, this.config.targetLongitude),\n }\n\n points.push(source)\n points.push(target)\n }\n\n const boundsArray = getDataLatLngBounds(points, d => d.lat, d => d.lon, 0)\n const bounds: Bounds = {\n northEast: { lat: boundsArray[0][0], lng: boundsArray[1][1] },\n southWest: { lat: boundsArray[1][0], lng: boundsArray[0][1] },\n }\n this.leafletMap.fitToBounds(bounds)\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;AA2BM,MAAO,cAGX,SAAQ,aAGP,CAAA;AAoBD,IAAA,WAAA,CAAa,SAAyB,EAAE,MAA6D,EAAE,IAAoD,EAAA;;AACzJ,QAAA,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAA;QAnBjB,IAAc,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":3,"file":"index.js","sources":["../../../src/components/leaflet-flow-map/index.ts"],"sourcesContent":["import { select } from 'd3-selection'\n\nimport { ComponentCore } from 'core/component'\nimport { ComponentType } from 'types/component'\n\n// Utils\nimport { ResizeObserver } from 'utils/resize-observer'\nimport { getNumber, throttle } from 'utils/data'\nimport { getDataLatLngBounds } from 'utils/map'\nimport { getColor } from 'utils/color'\n\n// Components\nimport { LeafletMap } from 'components/leaflet-map'\n\n// Types\nimport { Bounds } from 'components/leaflet-map/types'\nimport { GenericDataRecord } from 'types/data'\n\n// Config\nimport { LeafletFlowMapConfig, LeafletFlowMapConfigInterface } from './config'\n\n// Local Types\nimport { LatLon, Particle } from './types'\n\n// Renderer\nimport { PointRenderer as PointRendererType } from './renderer'\n\nexport class LeafletFlowMap<\n PointDatum extends GenericDataRecord,\n FlowDatum extends GenericDataRecord,\n> extends ComponentCore<\n { points: PointDatum[]; flows?: FlowDatum[] },\n LeafletFlowMapConfig<PointDatum, FlowDatum>,\n LeafletFlowMapConfigInterface<PointDatum, FlowDatum>\n > {\n static selectors = LeafletMap.selectors\n type = ComponentType.HTML\n private leafletMap: LeafletMap<PointDatum>\n private leafletMapInstance: L.Map\n private flows: FlowDatum[] = []\n private points: PointDatum[] = []\n private hoveredSourcePoint: FlowDatum | undefined\n private onCanvasMouseMoveBound = throttle(this.onCanvasMouseMove.bind(this), 60)\n private onCanvasClickBound = this.onCanvasClick.bind(this)\n private canvasElement: HTMLCanvasElement | undefined\n config: LeafletFlowMapConfig<PointDatum, FlowDatum> = new LeafletFlowMapConfig()\n private panningOffset = { x: 0, y: 0 }\n\n private resizeObserver: ResizeObserver | undefined\n private renderer: PointRendererType | undefined\n particles: Particle[] = []\n\n constructor (container: HTMLDivElement, config?: LeafletFlowMapConfigInterface<PointDatum, FlowDatum>, data?: { points: PointDatum[]; flows?: FlowDatum[] }) {\n super(ComponentType.HTML)\n\n this.leafletMap = new LeafletMap<PointDatum>(container, config, data?.points ?? [])\n\n const rendererImportPromise = import('./renderer')\n Promise.all([rendererImportPromise, this.leafletMap.getLeafletInstancePromise()])\n .then((imports) => {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n const [{ PointRenderer }, leaflet] = imports\n\n this.leafletMapInstance = leaflet\n const canvasContainer = this.leafletMapInstance.getPanes().overlayPane as HTMLDivElement\n\n // Initialize renderer\n const canvas = select(canvasContainer).insert('canvas', ':first-child')\n this.canvasElement = canvas.node()\n this.renderer = new PointRenderer(canvasContainer, container.offsetWidth, container.offsetHeight, this.canvasElement)\n this.canvasElement.addEventListener('mousemove', this.onCanvasMouseMoveBound)\n this.canvasElement.addEventListener('click', this.onCanvasClickBound)\n\n this.leafletMap._onMapMoveEndInternal = this.onMapMove.bind(this)\n\n // Update renderer size on container resize\n this.resizeObserver = new ResizeObserver(() => {\n this.renderer.setSize(container.offsetWidth, container.offsetHeight)\n })\n this.resizeObserver.observe(container)\n\n if (config) this.setConfig(config)\n if (data) this.setData(data)\n this.animate()\n })\n }\n\n setConfig (config: LeafletFlowMapConfigInterface<PointDatum, FlowDatum>): void {\n super.setConfig(config)\n this.leafletMap.setConfig({ ...config, clusteringDistance: 0 })\n }\n\n setData (data: { points: PointDatum[]; flows?: FlowDatum[] }): void {\n super.setData(data)\n this.flows = data.flows\n this.points = data.points\n this.initParticles()\n this.leafletMap.setData(this.points)\n this.render()\n }\n\n render (): void {\n super.render()\n }\n\n initParticles (): void {\n this.clearParticles()\n for (const flow of this.flows) {\n const source = {\n lat: getNumber(flow, this.config.sourceLatitude),\n lon: getNumber(flow, this.config.sourceLongitude),\n }\n\n const target = {\n lat: getNumber(flow, this.config.targetLatitude),\n lon: getNumber(flow, this.config.targetLongitude),\n }\n\n // Add source particle, showing the origin of the flow\n const sourcePointRadius = getNumber(flow, this.config.sourcePointRadius)\n const sourcePointColor = getColor(flow, this.config.sourcePointColor)\n this.addParticle(source, source, source, 0, sourcePointRadius, sourcePointColor)\n\n // Add flow particles\n const dist = Math.sqrt((target.lat - source.lat) ** 2 + (target.lon - source.lon) ** 2)\n const numParticles = Math.round(dist * getNumber(flow, this.config.flowParticleDensity))\n const velocity = getNumber(flow, this.config.flowParticleSpeed)\n const r = getNumber(flow, this.config.flowParticleRadius)\n const color = getColor(flow, this.config.flowParticleColor)\n for (let i = 0; i < numParticles; i += 1) {\n const location = {\n lat: source.lat + (target.lat - source.lat) * i / numParticles,\n lon: source.lon + (target.lon - source.lon) * i / numParticles,\n }\n this.addParticle(source, target, location, velocity, r, color)\n }\n }\n\n this.renderer?.update(this.particles)\n }\n\n private addParticle (source: LatLon, target: LatLon, location = source, velocity = 0.05, r = 0.75, color?: string): void {\n const x = 0\n const y = 0\n this.particles.push({ x, y, source, target, location, velocity, r, color })\n }\n\n private clearParticles (): void {\n this.particles = []\n }\n\n private animate (): void {\n const map = this.leafletMapInstance\n\n requestAnimationFrame(() => {\n const zoomLevel = map?.getZoom()\n for (const p of this.particles) {\n const fullDist = Math.sqrt((p.target.lat - p.source.lat) ** 2 + (p.target.lon - p.source.lon) ** 2)\n const remainedDist = Math.sqrt((p.target.lat - p.location.lat) ** 2 + (p.target.lon - p.location.lon) ** 2)\n const angle = Math.atan2(p.target.lat - p.source.lat, p.target.lon - p.source.lon)\n p.location.lat += p.velocity * Math.sin(angle)\n p.location.lon += p.velocity * Math.cos(angle)\n\n if (\n (((p.target.lat > p.source.lat) && (p.location.lat > p.target.lat)) || ((p.target.lon > p.source.lon) && (p.location.lon > p.target.lon))) ||\n (((p.target.lat < p.source.lat) && (p.location.lat < p.target.lat)) || ((p.target.lon < p.source.lon) && (p.location.lon < p.target.lon)))\n ) {\n p.location.lat = p.source.lat\n p.location.lon = p.source.lon\n }\n\n const pos = map?.latLngToLayerPoint([p.location.lat, p.location.lon])\n const orthogonalArcShift = -(zoomLevel ** 2 * fullDist / 8) * Math.cos(Math.PI / 2 * (fullDist / 2 - remainedDist) / (fullDist / 2)) || 0\n p.x = pos?.x - this.panningOffset.x\n p.y = pos?.y + orthogonalArcShift - this.panningOffset.y\n }\n\n this.renderer.updatePointsPosition(this.particles)\n this.renderer.draw()\n this.animate()\n })\n }\n\n private getPointByScreenPos (x: number, y: number): [FlowDatum, number, number] | [] {\n const map = this.leafletMapInstance\n\n for (const flow of this.flows) {\n const lat = getNumber(flow, this.config.sourceLatitude)\n const lon = getNumber(flow, this.config.sourceLongitude)\n const r = getNumber(flow, this.config.sourcePointRadius)\n const pos = map?.latLngToLayerPoint([lat, lon])\n const posX = pos.x - this.panningOffset.x\n const posY = pos.y - this.panningOffset.y\n\n if ((Math.abs(x - posX) < r) && (Math.abs(y - posY) < r)) {\n return [flow, posX, posY]\n }\n }\n\n return []\n }\n\n private onCanvasMouseMove (event: MouseEvent): void {\n const { config } = this\n\n this.canvasElement.style.removeProperty('cursor')\n const [hoveredPoint, x, y] = this.getPointByScreenPos(event.offsetX, event.offsetY)\n if (hoveredPoint) this.canvasElement.style.cursor = 'default'\n\n if (this.hoveredSourcePoint !== hoveredPoint) {\n if (hoveredPoint) config.onSourcePointMouseEnter?.(hoveredPoint, x, y, event)\n if (this.hoveredSourcePoint) config.onSourcePointMouseLeave?.(this.hoveredSourcePoint, event)\n this.hoveredSourcePoint = hoveredPoint\n }\n }\n\n private onCanvasClick (event: MouseEvent): void {\n const { config } = this\n\n const [clickedPoint, x, y] = this.getPointByScreenPos(event.offsetX, event.offsetY)\n if (clickedPoint) config.onSourcePointClick?.(clickedPoint, x, y, event)\n }\n\n private onMapMove (leaflet: L.Map): void {\n const shift = leaflet.containerPointToLayerPoint([0, 0])\n this.panningOffset.x = shift.x\n this.panningOffset.y = shift.y\n this.canvasElement.style.transform = `translate(${shift.x}px, ${shift.y}px)`\n }\n\n public destroy (): void {\n this.resizeObserver?.disconnect()\n this.renderer?.destroy()\n this.canvasElement?.removeEventListener('mousemove', this.onCanvasMouseMoveBound)\n this.canvasElement?.removeEventListener('click', this.onCanvasClickBound)\n super.destroy()\n }\n\n // Leaflet Map useful methods\n public selectPointById (id: string, centerPoint = false): void { this.leafletMap.selectPointById(id, centerPoint) }\n public getSelectedPointId (): string | number | undefined { return this.leafletMap.getSelectedPointId() }\n public unselectPoint (): void { this.leafletMap.unselectPoint() }\n public zoomToPointById (id: string, selectNode = false, customZoomLevel?: number): void { this.leafletMap.zoomToPointById(id, selectNode, customZoomLevel) }\n public zoomIn (increment = 1): void { this.leafletMap.zoomIn(increment) }\n public zoomOut (increment = 1): void { this.leafletMap.zoomOut(increment) }\n public setZoom (zoomLevel: number): void { this.leafletMap.setZoom(zoomLevel) }\n public fitView (): void {\n const points: { lat: number; lon: number }[] = []\n\n for (const point of this.points) {\n points.push({\n lat: getNumber(point, this.config.pointLatitude),\n lon: getNumber(point, this.config.pointLongitude),\n })\n }\n\n for (const flow of this.flows) {\n const source = {\n lat: getNumber(flow, this.config.sourceLatitude),\n lon: getNumber(flow, this.config.sourceLongitude),\n }\n\n const target = {\n lat: getNumber(flow, this.config.targetLatitude),\n lon: getNumber(flow, this.config.targetLongitude),\n }\n\n points.push(source)\n points.push(target)\n }\n\n const boundsArray = getDataLatLngBounds(points, d => d.lat, d => d.lon, 0)\n const bounds: Bounds = {\n northEast: { lat: boundsArray[0][0], lng: boundsArray[1][1] },\n southWest: { lat: boundsArray[1][0], lng: boundsArray[0][1] },\n }\n this.leafletMap.fitToBounds(bounds)\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;AA2BM,MAAO,cAGX,SAAQ,aAIP,CAAA;AAkBD,IAAA,WAAA,CAAa,SAAyB,EAAE,MAA6D,EAAE,IAAoD,EAAA;;AACzJ,QAAA,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAA;AAjB3B,QAAA,IAAA,CAAA,IAAI,GAAG,aAAa,CAAC,IAAI,CAAA;QAGjB,IAAK,CAAA,KAAA,GAAgB,EAAE,CAAA;QACvB,IAAM,CAAA,MAAA,GAAiB,EAAE,CAAA;AAEzB,QAAA,IAAA,CAAA,sBAAsB,GAAG,QAAQ,CAAC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,I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C,eAAe,CAAC;aAClD,CAAA;AAED,YAAA,MAAM,MAAM,GAAG;gBACb,GAAG,EAAE,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC;gBAChD,GAAG,EAAE,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC;aAClD,CAAA;AAED,YAAA,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;AACnB,YAAA,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;AACpB,SAAA;QAED,MAAM,WAAW,GAAG,mBAAmB,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAA;AAC1E,QAAA,MAAM,MAAM,GAAW;YACrB,SAAS,EAAE,EAAE,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;YAC7D,SAAS,EAAE,EAAE,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;SAC9D,CAAA;AACD,QAAA,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,MAAM,CAAC,CAAA;KACpC;;AAlPM,cAAA,CAAA,SAAS,GAAG,UAAU,CAAC,SAAS;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComponentConfigInterface } from "../../core/component/config";
|
|
1
|
+
import { ComponentConfig, ComponentConfigInterface } from "../../core/component/config";
|
|
2
2
|
import { Tooltip } from "../tooltip";
|
|
3
3
|
import { ColorAccessor, GenericAccessor, NumericAccessor, StringAccessor } from "../../types/accessor";
|
|
4
4
|
import { GenericDataRecord } from "../../types/data";
|
|
@@ -56,7 +56,7 @@ export interface LeafletMapConfigInterface<Datum extends GenericDataRecord> exte
|
|
|
56
56
|
/** Point shape accessor function or constant value. Default: `d => d.shape` */
|
|
57
57
|
pointShape?: GenericAccessor<LeafletMapPointShape | string, Datum>;
|
|
58
58
|
/** Point color accessor function or constant value. Default: `d => d.color` */
|
|
59
|
-
pointColor?: ColorAccessor<
|
|
59
|
+
pointColor?: ColorAccessor<Datum>;
|
|
60
60
|
/** Point radius accessor function or constant value. Default: `undefined` */
|
|
61
61
|
pointRadius?: NumericAccessor<LeafletMapPointDatum<Datum>>;
|
|
62
62
|
/** Point inner label accessor function. Default: `undefined` */
|
|
@@ -76,7 +76,7 @@ export interface LeafletMapConfigInterface<Datum extends GenericDataRecord> exte
|
|
|
76
76
|
/** Set selected point by its unique id. Default: `undefined` */
|
|
77
77
|
selectedPointId?: string;
|
|
78
78
|
/** Cluster color accessor function or constant value. Default: `undefined` */
|
|
79
|
-
clusterColor?: ColorAccessor<
|
|
79
|
+
clusterColor?: ColorAccessor<Datum>;
|
|
80
80
|
/** Cluster radius accessor function or constant value. Default: `undefined` */
|
|
81
81
|
clusterRadius?: NumericAccessor<LeafletMapClusterDatum<Datum>>;
|
|
82
82
|
/** Cluster inner label accessor function. Default: `d => d.point_count` */
|
|
@@ -140,4 +140,59 @@ export interface LeafletMapConfigInterface<Datum extends GenericDataRecord> exte
|
|
|
140
140
|
*/
|
|
141
141
|
ariaLabel?: string | null | undefined;
|
|
142
142
|
}
|
|
143
|
-
export declare
|
|
143
|
+
export declare class LeafletMapConfig<Datum extends GenericDataRecord> extends ComponentConfig implements LeafletMapConfigInterface<Datum> {
|
|
144
|
+
width: any;
|
|
145
|
+
height: any;
|
|
146
|
+
flyToDuration: number;
|
|
147
|
+
fitViewPadding: [number, number];
|
|
148
|
+
zoomDuration: number;
|
|
149
|
+
initialBounds: any;
|
|
150
|
+
fitBoundsOnUpdate: any;
|
|
151
|
+
fitViewOnInit: boolean;
|
|
152
|
+
fitViewOnUpdate: boolean;
|
|
153
|
+
attribution: string[];
|
|
154
|
+
accessToken: string;
|
|
155
|
+
style: any;
|
|
156
|
+
styleDarkTheme: any;
|
|
157
|
+
renderer: LeafletMapRenderer;
|
|
158
|
+
onMapInitialized: any;
|
|
159
|
+
onMapMoveZoom: any;
|
|
160
|
+
onMapMoveStart: any;
|
|
161
|
+
onMapMoveEnd: any;
|
|
162
|
+
onMapZoomStart: any;
|
|
163
|
+
onMapZoomEnd: any;
|
|
164
|
+
onMapClick: any;
|
|
165
|
+
pointLongitude: (d: Datum) => number;
|
|
166
|
+
pointLatitude: (d: Datum) => number;
|
|
167
|
+
pointId: (d: Datum) => string;
|
|
168
|
+
pointShape: (d: Datum) => string;
|
|
169
|
+
pointColor: (d: Datum) => string;
|
|
170
|
+
pointRadius: any;
|
|
171
|
+
pointLabel: any;
|
|
172
|
+
pointLabelColor: any;
|
|
173
|
+
pointBottomLabel: string;
|
|
174
|
+
pointCursor: any;
|
|
175
|
+
pointRingWidth: number;
|
|
176
|
+
selectedPointId: any;
|
|
177
|
+
clusterColor: any;
|
|
178
|
+
clusterRadius: any;
|
|
179
|
+
clusterLabel: (d: LeafletMapClusterDatum<Datum>) => string;
|
|
180
|
+
clusterLabelColor: any;
|
|
181
|
+
clusterBottomLabel: string;
|
|
182
|
+
clusterRingWidth: number;
|
|
183
|
+
clusterBackground: boolean;
|
|
184
|
+
clusterExpandOnClick: boolean;
|
|
185
|
+
clusteringDistance: number;
|
|
186
|
+
colorMap: LeafletMapPointStyles<Datum>;
|
|
187
|
+
topoJSONLayer: {
|
|
188
|
+
sources: any;
|
|
189
|
+
fillOpacity: number;
|
|
190
|
+
strokeOpacity: number;
|
|
191
|
+
strokeWidth: number;
|
|
192
|
+
featureName: any;
|
|
193
|
+
fillProperty: any;
|
|
194
|
+
strokeProperty: any;
|
|
195
|
+
};
|
|
196
|
+
tooltip: any;
|
|
197
|
+
ariaLabel: any;
|
|
198
|
+
}
|
|
@@ -1,28 +1,72 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ComponentConfig } from '../../core/component/config.js';
|
|
2
2
|
import { LeafletMapRenderer } from './types.js';
|
|
3
3
|
|
|
4
4
|
/* eslint-disable dot-notation, no-irregular-whitespace */
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
5
|
+
class LeafletMapConfig extends ComponentConfig {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
// General
|
|
9
|
+
this.width = undefined;
|
|
10
|
+
this.height = undefined;
|
|
11
|
+
this.flyToDuration = 1500;
|
|
12
|
+
this.fitViewPadding = [150, 150];
|
|
13
|
+
this.zoomDuration = 800;
|
|
14
|
+
this.initialBounds = undefined;
|
|
15
|
+
this.fitBoundsOnUpdate = undefined;
|
|
16
|
+
this.fitViewOnInit = true;
|
|
17
|
+
this.fitViewOnUpdate = false;
|
|
18
|
+
this.attribution = ['<a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap contributors</a>'];
|
|
19
|
+
this.accessToken = '';
|
|
20
|
+
this.style = undefined;
|
|
21
|
+
this.styleDarkTheme = undefined;
|
|
22
|
+
this.renderer = LeafletMapRenderer.MapLibre;
|
|
23
|
+
// Map events
|
|
24
|
+
this.onMapInitialized = undefined;
|
|
25
|
+
this.onMapMoveZoom = undefined;
|
|
26
|
+
this.onMapMoveStart = undefined;
|
|
27
|
+
this.onMapMoveEnd = undefined;
|
|
28
|
+
this.onMapZoomStart = undefined;
|
|
29
|
+
this.onMapZoomEnd = undefined;
|
|
30
|
+
this.onMapClick = undefined;
|
|
31
|
+
// Point
|
|
32
|
+
this.pointLongitude = (d) => d['longitude'];
|
|
33
|
+
this.pointLatitude = (d) => d['latitude'];
|
|
34
|
+
this.pointId = (d) => d['id'];
|
|
35
|
+
this.pointShape = (d) => d['shape'];
|
|
36
|
+
this.pointColor = (d) => d['color'];
|
|
37
|
+
this.pointRadius = undefined;
|
|
38
|
+
this.pointLabel = undefined;
|
|
39
|
+
this.pointLabelColor = undefined;
|
|
40
|
+
this.pointBottomLabel = '';
|
|
41
|
+
this.pointCursor = null;
|
|
42
|
+
this.pointRingWidth = 1.25;
|
|
43
|
+
this.selectedPointId = undefined;
|
|
44
|
+
// Cluster
|
|
45
|
+
this.clusterColor = undefined;
|
|
46
|
+
this.clusterRadius = undefined;
|
|
47
|
+
this.clusterLabel = (d) => `${d.point_count}`;
|
|
48
|
+
this.clusterLabelColor = undefined;
|
|
49
|
+
this.clusterBottomLabel = '';
|
|
50
|
+
this.clusterRingWidth = 1.25;
|
|
51
|
+
this.clusterBackground = true;
|
|
52
|
+
this.clusterExpandOnClick = true;
|
|
53
|
+
this.clusteringDistance = 55;
|
|
54
|
+
this.colorMap = {};
|
|
55
|
+
// TopoJSON Overlay
|
|
56
|
+
this.topoJSONLayer = {
|
|
57
|
+
sources: undefined,
|
|
58
|
+
fillOpacity: 0.6,
|
|
59
|
+
strokeOpacity: 0.8,
|
|
60
|
+
strokeWidth: 1,
|
|
61
|
+
featureName: undefined,
|
|
62
|
+
fillProperty: undefined,
|
|
63
|
+
strokeProperty: undefined,
|
|
64
|
+
};
|
|
65
|
+
// Misc
|
|
66
|
+
this.tooltip = undefined;
|
|
67
|
+
this.ariaLabel = undefined;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
26
70
|
|
|
27
|
-
export {
|
|
71
|
+
export { LeafletMapConfig };
|
|
28
72
|
//# sourceMappingURL=config.js.map
|