@unovis/ts 1.3.0-beta.3 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/area/config.d.ts +6 -10
- package/components/area/config.js +3 -12
- package/components/area/config.js.map +1 -1
- package/components/area/index.d.ts +5 -6
- package/components/area/index.js +10 -9
- package/components/area/index.js.map +1 -1
- package/components/axis/config.d.ts +3 -27
- package/components/axis/config.js +3 -30
- package/components/axis/config.js.map +1 -1
- package/components/axis/index.d.ts +4 -3
- package/components/axis/index.js +8 -5
- package/components/axis/index.js.map +1 -1
- package/components/brush/config.d.ts +2 -12
- package/components/brush/config.js +11 -20
- package/components/brush/config.js.map +1 -1
- package/components/brush/index.d.ts +4 -3
- package/components/brush/index.js +4 -3
- package/components/brush/index.js.map +1 -1
- package/components/bullet-legend/config.d.ts +1 -10
- package/components/bullet-legend/config.js +11 -14
- package/components/bullet-legend/config.js.map +1 -1
- package/components/bullet-legend/index.d.ts +4 -3
- package/components/bullet-legend/index.js +5 -2
- package/components/bullet-legend/index.js.map +1 -1
- package/components/chord-diagram/config.d.ts +7 -23
- package/components/chord-diagram/config.js +4 -23
- package/components/chord-diagram/config.js.map +1 -1
- package/components/chord-diagram/index.d.ts +4 -3
- package/components/chord-diagram/index.js +8 -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 +3 -2
- package/components/chord-diagram/types.js.map +1 -1
- package/components/crosshair/config.d.ts +4 -14
- package/components/crosshair/config.js +3 -16
- package/components/crosshair/config.js.map +1 -1
- package/components/crosshair/index.d.ts +4 -3
- package/components/crosshair/index.js +4 -3
- package/components/crosshair/index.js.map +1 -1
- package/components/donut/config.d.ts +3 -20
- package/components/donut/config.js +3 -24
- package/components/donut/config.js.map +1 -1
- package/components/donut/index.d.ts +4 -3
- package/components/donut/index.js +5 -4
- 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 +1 -11
- package/components/flow-legend/config.js +11 -16
- package/components/flow-legend/config.js.map +1 -1
- package/components/flow-legend/index.d.ts +4 -3
- package/components/flow-legend/index.js +5 -2
- package/components/flow-legend/index.js.map +1 -1
- package/components/free-brush/config.d.ts +2 -12
- package/components/free-brush/config.js +11 -20
- package/components/free-brush/config.js.map +1 -1
- package/components/free-brush/index.d.ts +4 -3
- package/components/free-brush/index.js +13 -12
- package/components/free-brush/index.js.map +1 -1
- package/components/graph/config.d.ts +3 -75
- package/components/graph/config.js +13 -79
- package/components/graph/config.js.map +1 -1
- package/components/graph/index.d.ts +8 -7
- package/components/graph/index.js +7 -5
- package/components/graph/index.js.map +1 -1
- package/components/graph/modules/layout.d.ts +7 -7
- package/components/graph/modules/layout.js +7 -2
- 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/helper.d.ts +1 -1
- package/components/graph/modules/node/helper.js.map +1 -1
- package/components/graph/modules/node/index.d.ts +9 -6
- package/components/graph/modules/node/index.js +7 -9
- 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/graph/modules/shape.js +2 -2
- package/components/graph/modules/shape.js.map +1 -1
- package/components/grouped-bar/config.d.ts +5 -13
- package/components/grouped-bar/config.js +3 -16
- package/components/grouped-bar/config.js.map +1 -1
- package/components/grouped-bar/index.d.ts +5 -9
- package/components/grouped-bar/index.js +5 -15
- package/components/grouped-bar/index.js.map +1 -1
- package/components/leaflet-flow-map/config.d.ts +2 -16
- package/components/leaflet-flow-map/config.js +3 -21
- package/components/leaflet-flow-map/config.js.map +1 -1
- package/components/leaflet-flow-map/index.d.ts +4 -3
- package/components/leaflet-flow-map/index.js +3 -2
- package/components/leaflet-flow-map/index.js.map +1 -1
- package/components/leaflet-map/config.d.ts +4 -59
- package/components/leaflet-map/config.js +24 -68
- package/components/leaflet-map/config.js.map +1 -1
- package/components/leaflet-map/index.d.ts +5 -4
- package/components/leaflet-map/index.js +4 -3
- package/components/leaflet-map/index.js.map +1 -1
- package/components/leaflet-map/modules/clusterBackground.d.ts +4 -2
- package/components/leaflet-map/modules/clusterBackground.js.map +1 -1
- package/components/leaflet-map/modules/map.d.ts +4 -4
- package/components/leaflet-map/modules/map.js +6 -6
- package/components/leaflet-map/modules/map.js.map +1 -1
- package/components/leaflet-map/modules/node.d.ts +3 -0
- package/components/leaflet-map/modules/node.js +8 -12
- package/components/leaflet-map/modules/node.js.map +1 -1
- package/components/leaflet-map/modules/utils.d.ts +4 -4
- package/components/leaflet-map/modules/utils.js +6 -2
- 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/leaflet-map/renderer/mapboxgl-utils.d.ts +5 -1
- package/components/leaflet-map/renderer/mapboxgl-utils.js +3 -3
- package/components/leaflet-map/renderer/mapboxgl-utils.js.map +1 -1
- package/components/leaflet-map/style.js.map +1 -1
- package/components/leaflet-map/types.d.ts +5 -1
- package/components/leaflet-map/types.js.map +1 -1
- package/components/line/config.d.ts +6 -11
- package/components/line/config.js +3 -13
- package/components/line/config.js.map +1 -1
- package/components/line/index.d.ts +6 -5
- package/components/line/index.js +7 -6
- package/components/line/index.js.map +1 -1
- package/components/nested-donut/config.d.ts +2 -21
- package/components/nested-donut/config.js +3 -24
- package/components/nested-donut/config.js.map +1 -1
- package/components/nested-donut/index.d.ts +4 -3
- package/components/nested-donut/index.js +18 -8
- 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/nested-donut/style.js.map +1 -1
- package/components/sankey/config.d.ts +3 -48
- package/components/sankey/config.js +11 -58
- package/components/sankey/config.js.map +1 -1
- package/components/sankey/index.d.ts +4 -3
- package/components/sankey/index.js +3 -2
- 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 +12 -2
- package/components/sankey/modules/link.js +4 -8
- 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 +5 -17
- package/components/scatter/config.js +3 -19
- package/components/scatter/config.js.map +1 -1
- package/components/scatter/index.d.ts +4 -3
- package/components/scatter/index.js +8 -8
- 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 +5 -13
- package/components/stacked-bar/config.js +3 -16
- package/components/stacked-bar/config.js.map +1 -1
- package/components/stacked-bar/index.d.ts +4 -3
- package/components/stacked-bar/index.js +4 -3
- package/components/stacked-bar/index.js.map +1 -1
- package/components/timeline/config.d.ts +5 -16
- package/components/timeline/config.js +3 -21
- package/components/timeline/config.js.map +1 -1
- package/components/timeline/index.d.ts +4 -3
- package/components/timeline/index.js +4 -3
- package/components/timeline/index.js.map +1 -1
- package/components/tooltip/config.d.ts +1 -15
- package/components/tooltip/config.js +12 -16
- package/components/tooltip/config.js.map +1 -1
- package/components/tooltip/index.d.ts +6 -4
- package/components/tooltip/index.js +15 -6
- package/components/tooltip/index.js.map +1 -1
- package/components/tooltip/style.d.ts +6 -0
- package/components/tooltip/style.js +13 -14
- package/components/tooltip/style.js.map +1 -1
- package/components/topojson-map/config.d.ts +4 -36
- package/components/topojson-map/config.js +3 -38
- package/components/topojson-map/config.js.map +1 -1
- package/components/topojson-map/index.d.ts +4 -3
- package/components/topojson-map/index.js +4 -5
- package/components/topojson-map/index.js.map +1 -1
- package/components/vis-controls/config.d.ts +1 -5
- package/components/vis-controls/config.js +6 -9
- package/components/vis-controls/config.js.map +1 -1
- package/components/vis-controls/index.d.ts +3 -2
- package/components/vis-controls/index.js +5 -2
- package/components/vis-controls/index.js.map +1 -1
- package/components/xy-labels/config.d.ts +4 -16
- package/components/xy-labels/config.js +3 -20
- package/components/xy-labels/config.js.map +1 -1
- package/components/xy-labels/index.d.ts +4 -3
- package/components/xy-labels/index.js +3 -2
- 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 +2 -4
- package/containers/single-container/config.js +3 -8
- package/containers/single-container/config.js.map +1 -1
- package/containers/single-container/index.d.ts +4 -3
- package/containers/single-container/index.js +2 -2
- package/containers/single-container/index.js.map +1 -1
- package/containers/xy-container/config.d.ts +2 -22
- package/containers/xy-container/config.js +3 -26
- package/containers/xy-container/config.js.map +1 -1
- package/containers/xy-container/index.d.ts +5 -2
- package/containers/xy-container/index.js +9 -8
- package/containers/xy-container/index.js.map +1 -1
- package/core/component/config.d.ts +1 -6
- package/core/component/config.js +6 -12
- package/core/component/config.js.map +1 -1
- package/core/component/index.d.ts +7 -5
- package/core/component/index.js +14 -9
- package/core/component/index.js.map +1 -1
- package/core/container/config.d.ts +1 -21
- package/core/container/config.js +21 -25
- package/core/container/config.js.map +1 -1
- package/core/container/index.d.ts +5 -4
- package/core/container/index.js +4 -3
- package/core/container/index.js.map +1 -1
- package/core/xy-component/config.d.ts +2 -10
- package/core/xy-component/config.js +3 -16
- package/core/xy-component/config.js.map +1 -1
- package/core/xy-component/index.d.ts +5 -4
- package/core/xy-component/index.js +2 -0
- package/core/xy-component/index.js.map +1 -1
- package/data-models/map-graph.d.ts +1 -1
- package/data-models/map-graph.js +4 -7
- package/data-models/map-graph.js.map +1 -1
- package/package.json +3 -1
- package/styles/colors.d.ts +2 -2
- package/styles/index.d.ts +1 -1
- package/styles/patterns.js +2 -1
- package/styles/patterns.js.map +1 -1
- package/types/accessor.d.ts +5 -5
- package/types/component.js +2 -0
- package/types/component.js.map +1 -1
- package/utils/d3.d.ts +10 -1
- package/utils/d3.js.map +1 -1
- package/utils/data.d.ts +7 -7
- package/utils/data.js +2 -1
- package/utils/data.js.map +1 -1
- package/utils/text.js +2 -2
- package/utils/text.js.map +1 -1
- package/core/config/index.d.ts +0 -3
- package/core/config/index.js +0 -16
- package/core/config/index.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sources":["../../../src/components/topojson-map/config.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"config.js","sources":["../../../src/components/topojson-map/config.ts"],"sourcesContent":["import { GeoProjection } from 'd3-geo'\nimport { ComponentConfigInterface, ComponentDefaultConfig } from 'core/component/config'\n\n// Types\nimport { ColorAccessor, NumericAccessor, StringAccessor } from 'types/accessor'\n\n// Local Types\nimport { MapProjection, MapPointLabelPosition } from './types'\n\nexport interface TopoJSONMapConfigInterface<\n AreaDatum,\n PointDatum = unknown,\n LinkDatum = unknown,\n> extends ComponentConfigInterface {\n // General\n /** MapProjection (aka D3's GeoProjection) instance. Default: `MapProjection.Kavrayskiy7()` */\n projection?: GeoProjection;\n /** Map data in the TopoJSON topology format. Default: `undefined` */\n topojson?: TopoJSON.Topology;\n /** Name of the map features to be displayed, e.g. 'countries' or 'counties'. Default: `countries` */\n mapFeatureName?: string;\n /** Set initial map fit to points instead of topojson features. Default: `false` */\n mapFitToPoints?: boolean;\n /** Initial zoom level. Default: `undefined` */\n zoomFactor?: number;\n /** Disable pan / zoom interactions. Default: `false` */\n disableZoom?: boolean;\n /** Zoom extent. Default: `[0.5, 6]` */\n zoomExtent?: number[];\n /** Zoom animation duration. Default: `400` */\n zoomDuration?: number;\n\n /** Link width value or accessor function. Default: `d => d.width ?? 1` */\n linkWidth?: NumericAccessor<LinkDatum>;\n /** Link color value or accessor function. Default: `d => d.color ?? null` */\n linkColor?: ColorAccessor<LinkDatum>;\n /** Link cursor value or accessor function. Default: `null` */\n linkCursor?: StringAccessor<LinkDatum>;\n /** Link id accessor function. Default: `d => d.id` */\n linkId?: StringAccessor<LinkDatum>;\n /** Link source accessor function. Default: `d => d.source` */\n linkSource?: ((l: LinkDatum) => number | string | PointDatum);\n /** Link target accessor function. Default: `d => d.target` */\n linkTarget?: ((l: LinkDatum) => number | string | PointDatum);\n\n /** Area id accessor function corresponding to the feature id from TopoJSON. Default: `d => d.id ?? ''` */\n areaId?: StringAccessor<AreaDatum>;\n /** Area color value or accessor function. Default: `d => d.color ?? null` */\n areaColor?: ColorAccessor<AreaDatum>;\n /** Area cursor value or accessor function. Default: `null` */\n areaCursor?: StringAccessor<AreaDatum>;\n\n /** Point color accessor. Default: `d => d.color ?? null` */\n pointColor?: ColorAccessor<PointDatum>;\n /** Point radius accessor. Default: `d => d.radius ?? 8` */\n pointRadius?: NumericAccessor<PointDatum>;\n /** Point stroke width accessor. Default: `d => d.strokeWidth ?? null` */\n pointStrokeWidth?: NumericAccessor<PointDatum>;\n /** Point cursor constant value or accessor function. Default: `null` */\n pointCursor?: StringAccessor<PointDatum>;\n /** Point longitude accessor function. Default: `d => d.longitude ?? null` */\n longitude?: NumericAccessor<PointDatum>;\n /** Point latitude accessor function. Default: `d => d.latitude ?? null` */\n latitude?: NumericAccessor<PointDatum>;\n /** Point label accessor function. Default: `undefined` */\n pointLabel?: StringAccessor<PointDatum>;\n /** Point label position. Default: `Position.Bottom` */\n pointLabelPosition?: MapPointLabelPosition;\n /** Point color brightness ratio for switching between dark and light text label color. Default: `0.65` */\n pointLabelTextBrightnessRatio?: number;\n /** Point id accessor function. Default: `d => d.id` */\n pointId?: ((d: PointDatum, i: number) => string);\n\n /** Enables blur and blending between neighbouring points. Default: `false` */\n heatmapMode?: boolean;\n /** Heatmap blur filter stdDeviation value. Default: `10` */\n heatmapModeBlurStdDeviation?: number;\n /** Zoom level at which the heatmap mode will be disabled. Default: `2.5` */\n heatmapModeZoomLevelThreshold?: number;\n}\n\nexport const TopoJSONMapDefaultConfig: TopoJSONMapConfigInterface<unknown, unknown, unknown> = {\n ...ComponentDefaultConfig,\n projection: MapProjection.Kavrayskiy7(),\n duration: 1500,\n topojson: undefined,\n mapFeatureName: 'countries',\n mapFitToPoints: false,\n\n zoomExtent: [0.5, 6],\n zoomDuration: 400,\n disableZoom: false,\n zoomFactor: undefined,\n\n linkWidth: (d: unknown): number => (d as { width: number }).width ?? 1,\n linkColor: (d: unknown): string => (d as { color: string }).color ?? null,\n linkCursor: null,\n linkId: (d: unknown, i: number | undefined): string => `${(d as { id: string }).id ?? i}`,\n linkSource: (d: unknown): (number | string | unknown) => (d as { source: string }).source,\n linkTarget: (d: unknown): (number | string | unknown) => (d as { target: string }).target,\n\n areaId: (d: unknown): string => (d as { id: string }).id ?? '',\n areaColor: (d: unknown): string => (d as { color: string }).color ?? null,\n areaCursor: null,\n\n longitude: (d: unknown): number => (d as { longitude: number }).longitude,\n latitude: (d: unknown): number => (d as { latitude: number }).latitude,\n pointColor: (d: unknown): string => (d as { color: string }).color ?? null,\n pointRadius: (d: unknown): number => (d as { radius: number }).radius ?? 8,\n pointStrokeWidth: (d: unknown): number => (d as { strokeWidth: number }).strokeWidth ?? 0,\n pointCursor: null,\n pointLabel: undefined,\n pointLabelPosition: MapPointLabelPosition.Bottom,\n pointLabelTextBrightnessRatio: 0.65,\n pointId: (d: unknown): string => (d as { id: string }).id,\n\n heatmapMode: false,\n heatmapModeBlurStdDeviation: 8,\n heatmapModeZoomLevelThreshold: 2.5,\n}\n\n"],"names":[],"mappings":";;;AAiFO,MAAM,wBAAwB,GAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAChC,sBAAsB,CAAA,EAAA,EACzB,UAAU,EAAE,aAAa,CAAC,WAAW,EAAE,EACvC,QAAQ,EAAE,IAAI,EACd,QAAQ,EAAE,SAAS,EACnB,cAAc,EAAE,WAAW,EAC3B,cAAc,EAAE,KAAK,EAErB,UAAU,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,EACpB,YAAY,EAAE,GAAG,EACjB,WAAW,EAAE,KAAK,EAClB,UAAU,EAAE,SAAS,EAErB,SAAS,EAAE,CAAC,CAAU,KAAa,EAAA,IAAA,EAAA,CAAA,CAAA,OAAA,MAAC,CAAuB,CAAC,KAAK,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAI,CAAC,CAAA,EAAA,EACtE,SAAS,EAAE,CAAC,CAAU,KAAY,EAAA,IAAA,EAAA,CAAA,CAAC,OAAA,CAAA,EAAA,GAAC,CAAuB,CAAC,KAAK,MAAI,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAA,IAAI,CAAA,EAAA,EACzE,UAAU,EAAE,IAAI,EAChB,MAAM,EAAE,CAAC,CAAU,EAAE,CAAqB,KAAY,EAAA,IAAA,EAAA,CAAA,CAAC,OAAA,CAAA,EAAG,CAAC,EAAA,GAAA,CAAoB,CAAC,EAAE,mCAAI,CAAC,CAAA,CAAE,CAAA,EAAA,EACzF,UAAU,EAAE,CAAC,CAAU,KAAmC,CAAwB,CAAC,MAAM,EACzF,UAAU,EAAE,CAAC,CAAU,KAAmC,CAAwB,CAAC,MAAM,E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9B,6BAA6B,EAAE,GAAG;;;;"}
|
|
@@ -3,11 +3,12 @@ import { D3ZoomEvent, ZoomTransform } from 'd3-zoom';
|
|
|
3
3
|
import { ComponentCore } from "../../core/component";
|
|
4
4
|
import { MapGraphDataModel } from "../../data-models/map-graph";
|
|
5
5
|
import { MapData } from './types';
|
|
6
|
-
import {
|
|
6
|
+
import { TopoJSONMapConfigInterface } from './config';
|
|
7
7
|
import * as s from './style';
|
|
8
|
-
export declare class TopoJSONMap<AreaDatum, PointDatum = unknown, LinkDatum = unknown> extends ComponentCore<MapData<AreaDatum, PointDatum, LinkDatum>,
|
|
8
|
+
export declare class TopoJSONMap<AreaDatum, PointDatum = unknown, LinkDatum = unknown> extends ComponentCore<MapData<AreaDatum, PointDatum, LinkDatum>, TopoJSONMapConfigInterface<AreaDatum, PointDatum, LinkDatum>> {
|
|
9
9
|
static selectors: typeof s;
|
|
10
|
-
|
|
10
|
+
protected _defaultConfig: TopoJSONMapConfigInterface<AreaDatum, PointDatum, LinkDatum>;
|
|
11
|
+
config: TopoJSONMapConfigInterface<AreaDatum, PointDatum, LinkDatum>;
|
|
11
12
|
datamodel: MapGraphDataModel<AreaDatum, PointDatum, LinkDatum>;
|
|
12
13
|
g: Selection<SVGGElement, unknown, null, undefined>;
|
|
13
14
|
private _firstRender;
|
|
@@ -10,7 +10,7 @@ import { smartTransition } from '../../utils/d3.js';
|
|
|
10
10
|
import { getColor, hexToBrightness } from '../../utils/color.js';
|
|
11
11
|
import { isStringCSSVariable, getCSSVariableValue } from '../../utils/misc.js';
|
|
12
12
|
import { MapPointLabelPosition } from './types.js';
|
|
13
|
-
import {
|
|
13
|
+
import { TopoJSONMapDefaultConfig } from './config.js';
|
|
14
14
|
import { getLonLat, arc } from './utils.js';
|
|
15
15
|
import * as style from './style.js';
|
|
16
16
|
import { background, features, links, points, feature as feature$1, link, point, pointCircle, pointLabel } from './style.js';
|
|
@@ -18,7 +18,8 @@ import { background, features, links, points, feature as feature$1, link, point,
|
|
|
18
18
|
class TopoJSONMap extends ComponentCore {
|
|
19
19
|
constructor(config, data) {
|
|
20
20
|
super();
|
|
21
|
-
this.
|
|
21
|
+
this._defaultConfig = TopoJSONMapDefaultConfig;
|
|
22
|
+
this.config = this._defaultConfig;
|
|
22
23
|
this.datamodel = new MapGraphDataModel();
|
|
23
24
|
this._firstRender = true;
|
|
24
25
|
this._isResizing = false;
|
|
@@ -169,7 +170,6 @@ class TopoJSONMap extends ComponentCore {
|
|
|
169
170
|
edges.exit().remove();
|
|
170
171
|
}
|
|
171
172
|
_renderPoints(duration) {
|
|
172
|
-
var _a;
|
|
173
173
|
const { config, datamodel } = this;
|
|
174
174
|
const pointData = datamodel.points;
|
|
175
175
|
const points = this._pointsGroup
|
|
@@ -202,7 +202,7 @@ class TopoJSONMap extends ComponentCore {
|
|
|
202
202
|
.style('stroke-width', d => getNumber(d, config.pointStrokeWidth) / this._currentZoomLevel);
|
|
203
203
|
const pointLabelsMerged = pointsMerged.select(`.${pointLabel}`);
|
|
204
204
|
pointLabelsMerged
|
|
205
|
-
.text((_a = config.pointLabel) !== null && _a !== void 0 ? _a : '')
|
|
205
|
+
.text(d => { var _a; return (_a = getString(d, config.pointLabel)) !== null && _a !== void 0 ? _a : ''; })
|
|
206
206
|
.style('font-size', d => {
|
|
207
207
|
if (config.pointLabelPosition === MapPointLabelPosition.Bottom) {
|
|
208
208
|
return `calc(var(--vis-map-point-label-font-size) / ${this._currentZoomLevel}`;
|
|
@@ -259,7 +259,6 @@ class TopoJSONMap extends ComponentCore {
|
|
|
259
259
|
}),
|
|
260
260
|
},
|
|
261
261
|
}],
|
|
262
|
-
geometries: [],
|
|
263
262
|
};
|
|
264
263
|
this._projection.fitExtent([
|
|
265
264
|
[this._width * pad, this._height * pad],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/topojson-map/index.ts"],"sourcesContent":["import { Selection } from 'd3-selection'\nimport { D3ZoomEvent, zoom, ZoomBehavior, zoomIdentity, ZoomTransform } from 'd3-zoom'\nimport { timeout } from 'd3-timer'\nimport { geoPath, GeoProjection } from 'd3-geo'\nimport { color } from 'd3-color'\nimport { feature } from 'topojson-client'\n\n// Core\nimport { ComponentCore } from 'core/component'\nimport { MapGraphDataModel } from 'data-models/map-graph'\n\n// Utils\nimport { clamp, getNumber, getString, isNumber } from 'utils/data'\nimport { smartTransition } from 'utils/d3'\nimport { getColor, hexToBrightness } from 'utils/color'\nimport { getCSSVariableValue, isStringCSSVariable } from 'utils/misc'\n\n// Types\nimport { MapLink } from 'types/map'\n\n// Local Types\nimport { MapData, MapFeature, MapPointLabelPosition } from './types'\n\n// Config\nimport { TopoJSONMapConfig, TopoJSONMapConfigInterface } from './config'\n\n// Modules\nimport { arc, getLonLat } from './utils'\n\n// Styles\nimport * as s from './style'\n\nexport class TopoJSONMap<\n AreaDatum,\n PointDatum = unknown,\n LinkDatum = unknown,\n> extends ComponentCore<\n MapData<AreaDatum, PointDatum, LinkDatum>,\n TopoJSONMapConfig<AreaDatum, PointDatum, LinkDatum>,\n TopoJSONMapConfigInterface<AreaDatum, PointDatum, LinkDatum>\n > {\n static selectors = s\n config: TopoJSONMapConfig<AreaDatum, PointDatum, LinkDatum> = new TopoJSONMapConfig()\n datamodel: MapGraphDataModel<AreaDatum, PointDatum, LinkDatum> = new MapGraphDataModel()\n g: Selection<SVGGElement, unknown, null, undefined>\n private _firstRender = true\n private _isResizing = false\n private _initialScale: number = undefined\n private _center: [number, number]\n private _currentZoomLevel: number = undefined\n private _transform: ZoomTransform\n private _path = geoPath()\n private _projection: GeoProjection\n private _prevWidth: number\n private _prevHeight: number\n private _animFrameId: number\n\n private _featureCollection: GeoJSON.FeatureCollection\n private _zoomBehavior: ZoomBehavior<SVGGElement, unknown> = zoom()\n private _backgroundRect = this.g.append('rect').attr('class', s.background)\n private _featuresGroup = this.g.append('g').attr('class', s.features)\n private _linksGroup = this.g.append('g').attr('class', s.links)\n private _pointsGroup = this.g.append('g').attr('class', s.points)\n\n events = {\n [TopoJSONMap.selectors.point]: {},\n [TopoJSONMap.selectors.feature]: {},\n }\n\n constructor (config?: TopoJSONMapConfigInterface<AreaDatum, PointDatum, LinkDatum>, data?: MapData<AreaDatum, PointDatum, LinkDatum>) {\n super()\n this._zoomBehavior.on('zoom', this._onZoom.bind(this))\n\n if (config) this.setConfig(config)\n if (data) this.setData(data)\n\n this.g.append('defs')\n .append('filter')\n .attr('id', 'heatmapFilter')\n .html(`\n <feGaussianBlur in=\"SourceGraphic\" stdDeviation=\"${this.config.heatmapModeBlurStdDeviation}\" color-interpolation-filters=\"sRGB\" result=\"blur\"></feGaussianBlur>\n <feColorMatrix class=\"blurValues\" in=\"blur\" mode=\"matrix\" values=\"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 20 -4\"></feColorMatrix>\n `)\n }\n\n setData (data: MapData<AreaDatum, PointDatum, LinkDatum>): void {\n const { config } = this\n\n this.datamodel.pointId = config.pointId\n this.datamodel.linkSource = config.linkSource\n this.datamodel.linkTarget = config.linkTarget\n this.datamodel.data = data\n }\n\n setConfig (config?: TopoJSONMapConfigInterface<AreaDatum, PointDatum, LinkDatum>): void {\n super.setConfig(config)\n\n const newProjection = this.config.projection\n if (this._projection) {\n newProjection.scale(this._projection.scale()).translate(this._projection.translate())\n }\n this._projection = newProjection\n }\n\n _render (customDuration?: number): void {\n const { config } = this\n const duration = isNumber(customDuration) ? customDuration : config.duration\n\n this._renderBackground()\n this._renderMap(duration)\n this._renderGroups(duration)\n this._renderLinks(duration)\n this._renderPoints(duration)\n\n // When animation is running we need to temporary disable zoom behaviour\n if (duration && !config.disableZoom) {\n this.g.on('.zoom', null)\n timeout(() => {\n this.g.call(this._zoomBehavior)\n }, duration)\n }\n\n // When zoom behaviour is active we assign the `draggable` class to show the grabbing cursor\n this.g.classed('draggable', !config.disableZoom)\n this._firstRender = false\n }\n\n _renderBackground (): void {\n this._backgroundRect\n .attr('width', '100%')\n .attr('height', '100%')\n .attr('transform', `translate(${-this.bleed.left}, ${-this.bleed.top})`)\n }\n\n _renderGroups (duration: number): void {\n const transformString = this._transform.toString()\n smartTransition(this._featuresGroup, duration)\n .attr('transform', transformString)\n .attr('stroke-width', 1 / this._currentZoomLevel)\n\n smartTransition(this._linksGroup, duration)\n .attr('transform', transformString)\n\n smartTransition(this._pointsGroup, duration)\n .attr('transform', transformString)\n }\n\n _renderMap (duration: number): void {\n const { bleed, config, datamodel } = this\n\n this.g.attr('transform', `translate(${bleed.left}, ${bleed.top})`)\n const mapData: TopoJSON.Topology = config.topojson\n const featureName = config.mapFeatureName\n const featureObject = mapData?.objects?.[featureName]\n if (!featureObject) return\n\n this._featureCollection = feature(mapData, featureObject) as GeoJSON.FeatureCollection\n const featureData = (this._featureCollection?.features ?? []) as MapFeature<AreaDatum>[]\n\n if (this._firstRender) {\n // Rendering the map for the first time.\n this._projection.fitExtent([[0, 0], [this._width, this._height]], this._featureCollection)\n this._initialScale = this._projection.scale()\n this._center = this._projection.translate()\n\n if (config.mapFitToPoints) {\n this._fitToPoints()\n }\n\n const zoomExtent = config.zoomExtent\n this._zoomBehavior.scaleExtent([zoomExtent[0] * this._initialScale, zoomExtent[1] * this._initialScale])\n this.setZoom(config.zoomFactor || 1)\n\n if (!config.disableZoom) {\n this.g.call(this._zoomBehavior)\n this._applyZoom()\n }\n\n this._prevWidth = this._width\n this._prevHeight = this._height\n }\n\n if (this._prevWidth !== this._width || this._prevHeight !== this._height) {\n this._onResize()\n }\n\n this._path.projection(this._projection)\n\n // Merge passed area data and map feature data\n const areaData = datamodel.areas\n areaData.forEach(a => {\n const feature = featureData.find(f => f.id.toString() === getString(a, config.areaId).toString())\n if (feature) feature.data = a\n else if (this._firstRender) console.warn(`Can't find feature by area code ${getString(a, config.areaId)}`)\n })\n\n const features = this._featuresGroup\n .selectAll<SVGPathElement, unknown>(`.${s.feature}`)\n .data(featureData)\n\n const featuresEnter = features.enter().append('path').attr('class', s.feature)\n smartTransition(featuresEnter.merge(features), duration)\n .attr('d', this._path)\n .style('fill', (d, i) => d.data ? getColor(d.data, config.areaColor, i) : null)\n .style('cursor', d => d.data ? getString(d.data, config.areaCursor) : null)\n features.exit().remove()\n }\n\n _renderLinks (duration: number): void {\n const { config, datamodel } = this\n const links = datamodel.links\n\n const edges = this._linksGroup\n .selectAll<SVGPathElement, MapLink<PointDatum, LinkDatum>>(`.${s.link}`)\n .data(links, (d, i) => getString(d, config.linkId, i))\n\n const edgesEnter = edges.enter().append('path').attr('class', s.link)\n .style('stroke-width', 0)\n\n smartTransition(edgesEnter.merge(edges), duration)\n .attr('d', link => {\n const source = this._projection(getLonLat(link.source, config.longitude, config.latitude))\n const target = this._projection(getLonLat(link.target, config.longitude, config.latitude))\n return arc(source, target)\n })\n .style('stroke-width', link => getNumber(link, config.linkWidth) / this._currentZoomLevel)\n .style('cursor', link => getString(link, config.linkCursor))\n .style('stroke', (link, i) => getColor(link, config.linkColor, i))\n edges.exit().remove()\n }\n\n _renderPoints (duration: number): void {\n const { config, datamodel } = this\n const pointData = datamodel.points\n\n const points = this._pointsGroup\n .selectAll<SVGGElement, PointDatum>(`.${s.point}`)\n .data(pointData, (d, i) => getString(d, config.pointId, i))\n\n // Enter\n const pointsEnter = points.enter().append('g').attr('class', s.point)\n .attr('transform', d => {\n const pos = this._projection(getLonLat(d, config.longitude, config.latitude))\n return `translate(${pos[0]},${pos[1]})`\n })\n\n pointsEnter.append('circle').attr('class', s.pointCircle)\n .attr('r', 0)\n .style('fill', (d, i) => getColor(d, config.pointColor, i))\n .style('stroke-width', d => getNumber(d, config.pointStrokeWidth))\n\n pointsEnter.append('text').attr('class', s.pointLabel)\n .style('opacity', 0)\n\n // Update\n const pointsMerged = pointsEnter.merge(points)\n smartTransition(pointsMerged, duration)\n .attr('transform', d => {\n const pos = this._projection(getLonLat(d, config.longitude, config.latitude))\n return `translate(${pos[0]},${pos[1]})`\n })\n .style('cursor', d => getString(d, config.pointCursor))\n\n smartTransition(pointsMerged.select(`.${s.pointCircle}`), duration)\n .attr('r', d => getNumber(d, config.pointRadius) / this._currentZoomLevel)\n .style('fill', (d, i) => getColor(d, config.pointColor, i))\n .style('stroke', (d, i) => getColor(d, config.pointColor, i))\n .style('stroke-width', d => getNumber(d, config.pointStrokeWidth) / this._currentZoomLevel)\n\n const pointLabelsMerged = pointsMerged.select(`.${s.pointLabel}`)\n pointLabelsMerged\n .text(config.pointLabel ?? '')\n .style('font-size', d => {\n if (config.pointLabelPosition === MapPointLabelPosition.Bottom) {\n return `calc(var(--vis-map-point-label-font-size) / ${this._currentZoomLevel}`\n }\n const pointDiameter = 2 * getNumber(d, config.pointRadius)\n const pointLabelText = getString(d, config.pointLabel) || ''\n const textLength = pointLabelText.length\n const fontSize = 0.5 * pointDiameter / Math.pow(textLength, 0.4)\n return clamp(fontSize, fontSize, 16)\n })\n .attr('y', d => {\n if (config.pointLabelPosition === MapPointLabelPosition.Center) return null\n\n const pointRadius = getNumber(d, config.pointRadius) / this._currentZoomLevel\n return pointRadius\n })\n .attr('dy', config.pointLabelPosition === MapPointLabelPosition.Center ? '0.32em' : '1em')\n\n smartTransition(pointLabelsMerged, duration)\n .style('fill', (d, i) => {\n if (config.pointLabelPosition === MapPointLabelPosition.Bottom) return null\n\n const pointColor = getColor(d, config.pointColor, i)\n const hex = color(isStringCSSVariable(pointColor) ? getCSSVariableValue(pointColor, this.element) : pointColor)?.hex()\n if (!hex) return null\n\n const brightness = hexToBrightness(hex)\n return brightness > config.pointLabelTextBrightnessRatio ? 'var(--vis-map-point-label-text-color-dark)' : 'var(--vis-map-point-label-text-color-light)'\n })\n .style('opacity', 1)\n\n // Exit\n points.exit().remove()\n\n // Heatmap\n this._pointsGroup.style('filter', (config.heatmapMode && this._currentZoomLevel < config.heatmapModeZoomLevelThreshold) ? 'url(#heatmapFilter)' : null)\n this._pointsGroup.selectAll(`.${s.pointLabel}`).style('display', (config.heatmapMode && (this._currentZoomLevel < config.heatmapModeZoomLevelThreshold)) ? 'none' : null)\n }\n\n _fitToPoints (points?: PointDatum[], pad = 0.1): void {\n const { config, datamodel } = this\n const pointData = points || datamodel.points\n if (pointData.length === 0) return\n\n const featureCollection = {\n type: 'FeatureCollection',\n features: [{\n type: 'Feature',\n properties: {},\n geometry: {\n type: 'MultiPoint',\n coordinates: pointData.map(p => {\n return [\n getNumber(p, d => getNumber(d, config.longitude)),\n getNumber(p, d => getNumber(d, config.latitude)),\n ]\n }),\n },\n }],\n geometries: [],\n }\n\n this._projection.fitExtent([\n [this._width * pad, this._height * pad],\n [this._width * (1 - pad), this._height * (1 - pad)],\n ], featureCollection)\n\n const maxScale = config.zoomExtent[1] * this._initialScale\n if (this._projection.scale() > maxScale) this._projection.scale(maxScale)\n\n this._applyZoom()\n }\n\n _applyZoom (): void {\n const translate = this._center ?? this._projection.translate()\n const scale = this._initialScale * this._currentZoomLevel\n this.g.call(this._zoomBehavior.transform, zoomIdentity.translate(translate[0], translate[1]).scale(scale))\n }\n\n _onResize (): void {\n this._isResizing = true\n const prevTranslate = this._projection.translate()\n\n this._projection.fitExtent([[0, 0], [this._width, this._height]], this._featureCollection)\n this._initialScale = this._projection.scale()\n this._center = [\n this._projection.translate()[0] * this._center[0] / prevTranslate[0],\n this._projection.translate()[1] * this._center[1] / prevTranslate[1],\n ]\n this._applyZoom()\n\n this._isResizing = false\n this._prevWidth = this._width\n this._prevHeight = this._height\n }\n\n _onZoom (event: D3ZoomEvent<any, any>): void {\n if (this._firstRender) return // To prevent double render because of binding zoom behaviour\n const isMouseEvent = event.sourceEvent !== undefined\n const isExternalEvent = !event?.sourceEvent && !this._isResizing\n\n window.cancelAnimationFrame(this._animFrameId)\n this._animFrameId = window.requestAnimationFrame(this._onZoomHandler.bind(this, event.transform, isMouseEvent, isExternalEvent))\n\n if (isMouseEvent) {\n // Update the center coordinate so that the next call to _applyZoom()\n // will zoom with respect to the current view\n this._center = [event.transform.x, event.transform.y]\n }\n this._currentZoomLevel = (event?.transform.k / this._initialScale) || 1\n }\n\n _onZoomHandler (transform: ZoomTransform, isMouseEvent: boolean, isExternalEvent: boolean): void {\n const scale = transform.k / this._initialScale || 1\n const center = this._projection.translate()\n\n this._transform = zoomIdentity\n .translate(transform.x - center[0] * scale, transform.y - center[1] * scale)\n .scale(scale)\n\n const customDuration = isExternalEvent\n ? this.config.zoomDuration\n : (isMouseEvent ? 0 : null)\n\n // Call render functions that depend on this._transform\n this._renderGroups(customDuration)\n this._renderLinks(customDuration)\n this._renderPoints(customDuration)\n }\n\n public zoomIn (increment = 0.5): void {\n this.setZoom(this._currentZoomLevel + increment)\n }\n\n public zoomOut (increment = 0.5): void {\n this.setZoom(this._currentZoomLevel - increment)\n }\n\n public setZoom (zoomLevel: number): void {\n const { config } = this\n this._currentZoomLevel = clamp(zoomLevel, config.zoomExtent[0], config.zoomExtent[1])\n this._transform = zoomIdentity\n .translate(this._center[0] * (1 - this._currentZoomLevel), this._center[1] * (1 - this._currentZoomLevel))\n .scale(this._currentZoomLevel)\n // We are using this._applyZoom() instead of directly calling this._render(config.zoomDuration) because\n // we've to \"attach\" new transform to the map group element. Otherwise zoomBehavior will not know\n // that the zoom state has changed\n this._applyZoom()\n }\n\n public fitView (): void {\n this._projection.fitExtent([[0, 0], [this._width, this._height]], this._featureCollection)\n this._currentZoomLevel = (this._projection?.scale() / this._initialScale) || 1\n this._center = this._projection.translate()\n // We are using this._applyZoom() instead of directly calling this._render(config.zoomDuration) because\n // we've to \"attach\" new transform to the map group element. Otherwise zoomBehavior will not know\n // that the zoom state has changed\n this._applyZoom()\n }\n\n destroy (): void {\n window.cancelAnimationFrame(this._animFrameId)\n }\n}\n"],"names":["s.background","s.features","s.links","s.points","s.feature","s.link","s.point","s.pointCircle","s.pointLabel","s"],"mappings":";;;;;;;;;;;;;;;;;AAgCM,MAAO,WAIX,SAAQ,aAIP,CAAA;IA6BD,WAAa,CAAA,MAAqE,EAAE,IAAgD,EAAA;AAClI,QAAA,KAAK,EAAE,CAAA;AA5BT,QAAA,IAAA,CAAA,MAAM,GAA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iB,CAAC,CAAA;;;;QAIhC,IAAI,CAAC,UAAU,EAAE,CAAA;KAClB;IAEM,OAAO,GAAA;;QACZ,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAA;AAC1F,QAAA,IAAI,CAAC,iBAAiB,GAAG,CAAC,CAAA,CAAA,EAAA,GAAA,IAAI,CAAC,WAAW,0CAAE,KAAK,EAAE,IAAG,IAAI,CAAC,aAAa,KAAK,CAAC,CAAA;QAC9E,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,CAAA;;;;QAI3C,IAAI,CAAC,UAAU,EAAE,CAAA;KAClB;IAED,OAAO,GAAA;AACL,QAAA,MAAM,CAAC,oBAAoB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;KAC/C;;AAzYM,WAAS,CAAA,SAAA,GAAGC,KAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/topojson-map/index.ts"],"sourcesContent":["import { Selection } from 'd3-selection'\nimport { D3ZoomEvent, zoom, ZoomBehavior, zoomIdentity, ZoomTransform } from 'd3-zoom'\nimport { timeout } from 'd3-timer'\nimport { geoPath, GeoProjection, ExtendedFeatureCollection } from 'd3-geo'\nimport { color } from 'd3-color'\nimport { feature } from 'topojson-client'\n\n// Core\nimport { ComponentCore } from 'core/component'\nimport { MapGraphDataModel } from 'data-models/map-graph'\n\n// Utils\nimport { clamp, getNumber, getString, isNumber } from 'utils/data'\nimport { smartTransition } from 'utils/d3'\nimport { getColor, hexToBrightness } from 'utils/color'\nimport { getCSSVariableValue, isStringCSSVariable } from 'utils/misc'\n\n// Types\nimport { MapLink } from 'types/map'\n\n// Local Types\nimport { MapData, MapFeature, MapPointLabelPosition } from './types'\n\n// Config\nimport { TopoJSONMapDefaultConfig, TopoJSONMapConfigInterface } from './config'\n\n// Modules\nimport { arc, getLonLat } from './utils'\n\n// Styles\nimport * as s from './style'\n\nexport class TopoJSONMap<\n AreaDatum,\n PointDatum = unknown,\n LinkDatum = unknown,\n> extends ComponentCore<\n MapData<AreaDatum, PointDatum, LinkDatum>,\n TopoJSONMapConfigInterface<AreaDatum, PointDatum, LinkDatum>\n > {\n static selectors = s\n protected _defaultConfig = TopoJSONMapDefaultConfig as TopoJSONMapConfigInterface<AreaDatum, PointDatum, LinkDatum>\n public config: TopoJSONMapConfigInterface<AreaDatum, PointDatum, LinkDatum> = this._defaultConfig\n\n datamodel: MapGraphDataModel<AreaDatum, PointDatum, LinkDatum> = new MapGraphDataModel()\n g: Selection<SVGGElement, unknown, null, undefined>\n private _firstRender = true\n private _isResizing = false\n private _initialScale: number = undefined\n private _center: [number, number]\n private _currentZoomLevel: number = undefined\n private _transform: ZoomTransform\n private _path = geoPath()\n private _projection: GeoProjection\n private _prevWidth: number\n private _prevHeight: number\n private _animFrameId: number\n\n private _featureCollection: GeoJSON.FeatureCollection\n private _zoomBehavior: ZoomBehavior<SVGGElement, unknown> = zoom()\n private _backgroundRect = this.g.append('rect').attr('class', s.background)\n private _featuresGroup = this.g.append('g').attr('class', s.features)\n private _linksGroup = this.g.append('g').attr('class', s.links)\n private _pointsGroup = this.g.append('g').attr('class', s.points)\n\n events = {\n [TopoJSONMap.selectors.point]: {},\n [TopoJSONMap.selectors.feature]: {},\n }\n\n constructor (config?: TopoJSONMapConfigInterface<AreaDatum, PointDatum, LinkDatum>, data?: MapData<AreaDatum, PointDatum, LinkDatum>) {\n super()\n this._zoomBehavior.on('zoom', this._onZoom.bind(this))\n\n if (config) this.setConfig(config)\n if (data) this.setData(data)\n\n this.g.append('defs')\n .append('filter')\n .attr('id', 'heatmapFilter')\n .html(`\n <feGaussianBlur in=\"SourceGraphic\" stdDeviation=\"${this.config.heatmapModeBlurStdDeviation}\" color-interpolation-filters=\"sRGB\" result=\"blur\"></feGaussianBlur>\n <feColorMatrix class=\"blurValues\" in=\"blur\" mode=\"matrix\" values=\"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 20 -4\"></feColorMatrix>\n `)\n }\n\n setData (data: MapData<AreaDatum, PointDatum, LinkDatum>): void {\n const { config } = this\n\n this.datamodel.pointId = config.pointId\n this.datamodel.linkSource = config.linkSource\n this.datamodel.linkTarget = config.linkTarget\n this.datamodel.data = data\n }\n\n setConfig (config?: TopoJSONMapConfigInterface<AreaDatum, PointDatum, LinkDatum>): void {\n super.setConfig(config)\n\n const newProjection = this.config.projection\n if (this._projection) {\n newProjection.scale(this._projection.scale()).translate(this._projection.translate())\n }\n this._projection = newProjection\n }\n\n _render (customDuration?: number): void {\n const { config } = this\n const duration = isNumber(customDuration) ? customDuration : config.duration\n\n this._renderBackground()\n this._renderMap(duration)\n this._renderGroups(duration)\n this._renderLinks(duration)\n this._renderPoints(duration)\n\n // When animation is running we need to temporary disable zoom behaviour\n if (duration && !config.disableZoom) {\n this.g.on('.zoom', null)\n timeout(() => {\n this.g.call(this._zoomBehavior)\n }, duration)\n }\n\n // When zoom behaviour is active we assign the `draggable` class to show the grabbing cursor\n this.g.classed('draggable', !config.disableZoom)\n this._firstRender = false\n }\n\n _renderBackground (): void {\n this._backgroundRect\n .attr('width', '100%')\n .attr('height', '100%')\n .attr('transform', `translate(${-this.bleed.left}, ${-this.bleed.top})`)\n }\n\n _renderGroups (duration: number): void {\n const transformString = this._transform.toString()\n smartTransition(this._featuresGroup, duration)\n .attr('transform', transformString)\n .attr('stroke-width', 1 / this._currentZoomLevel)\n\n smartTransition(this._linksGroup, duration)\n .attr('transform', transformString)\n\n smartTransition(this._pointsGroup, duration)\n .attr('transform', transformString)\n }\n\n _renderMap (duration: number): void {\n const { bleed, config, datamodel } = this\n\n this.g.attr('transform', `translate(${bleed.left}, ${bleed.top})`)\n const mapData: TopoJSON.Topology = config.topojson\n const featureName = config.mapFeatureName\n const featureObject = mapData?.objects?.[featureName]\n if (!featureObject) return\n\n this._featureCollection = feature(mapData, featureObject) as GeoJSON.FeatureCollection\n const featureData = (this._featureCollection?.features ?? []) as MapFeature<AreaDatum>[]\n\n if (this._firstRender) {\n // Rendering the map for the first time.\n this._projection.fitExtent([[0, 0], [this._width, this._height]], this._featureCollection)\n this._initialScale = this._projection.scale()\n this._center = this._projection.translate()\n\n if (config.mapFitToPoints) {\n this._fitToPoints()\n }\n\n const zoomExtent = config.zoomExtent\n this._zoomBehavior.scaleExtent([zoomExtent[0] * this._initialScale, zoomExtent[1] * this._initialScale])\n this.setZoom(config.zoomFactor || 1)\n\n if (!config.disableZoom) {\n this.g.call(this._zoomBehavior)\n this._applyZoom()\n }\n\n this._prevWidth = this._width\n this._prevHeight = this._height\n }\n\n if (this._prevWidth !== this._width || this._prevHeight !== this._height) {\n this._onResize()\n }\n\n this._path.projection(this._projection)\n\n // Merge passed area data and map feature data\n const areaData = datamodel.areas\n areaData.forEach(a => {\n const feature = featureData.find(f => f.id.toString() === getString(a, config.areaId).toString())\n if (feature) feature.data = a\n else if (this._firstRender) console.warn(`Can't find feature by area code ${getString(a, config.areaId)}`)\n })\n\n const features = this._featuresGroup\n .selectAll<SVGPathElement, unknown>(`.${s.feature}`)\n .data(featureData)\n\n const featuresEnter = features.enter().append('path').attr('class', s.feature)\n smartTransition(featuresEnter.merge(features), duration)\n .attr('d', this._path)\n .style('fill', (d, i) => d.data ? getColor(d.data, config.areaColor, i) : null)\n .style('cursor', d => d.data ? getString(d.data, config.areaCursor) : null)\n features.exit().remove()\n }\n\n _renderLinks (duration: number): void {\n const { config, datamodel } = this\n const links = datamodel.links\n\n const edges = this._linksGroup\n .selectAll<SVGPathElement, MapLink<PointDatum, LinkDatum>>(`.${s.link}`)\n .data(links, (d, i) => getString(d, config.linkId, i))\n\n const edgesEnter = edges.enter().append('path').attr('class', s.link)\n .style('stroke-width', 0)\n\n smartTransition(edgesEnter.merge(edges), duration)\n .attr('d', link => {\n const source = this._projection(getLonLat(link.source, config.longitude, config.latitude))\n const target = this._projection(getLonLat(link.target, config.longitude, config.latitude))\n return arc(source, target)\n })\n .style('stroke-width', link => getNumber(link, config.linkWidth) / this._currentZoomLevel)\n .style('cursor', link => getString(link, config.linkCursor))\n .style('stroke', (link, i) => getColor(link, config.linkColor, i))\n edges.exit().remove()\n }\n\n _renderPoints (duration: number): void {\n const { config, datamodel } = this\n const pointData = datamodel.points\n\n const points = this._pointsGroup\n .selectAll<SVGGElement, PointDatum>(`.${s.point}`)\n .data(pointData, (d, i) => getString(d, config.pointId, i))\n\n // Enter\n const pointsEnter = points.enter().append('g').attr('class', s.point)\n .attr('transform', d => {\n const pos = this._projection(getLonLat(d, config.longitude, config.latitude))\n return `translate(${pos[0]},${pos[1]})`\n })\n\n pointsEnter.append('circle').attr('class', s.pointCircle)\n .attr('r', 0)\n .style('fill', (d, i) => getColor(d, config.pointColor, i))\n .style('stroke-width', d => getNumber(d, config.pointStrokeWidth))\n\n pointsEnter.append('text').attr('class', s.pointLabel)\n .style('opacity', 0)\n\n // Update\n const pointsMerged = pointsEnter.merge(points)\n smartTransition(pointsMerged, duration)\n .attr('transform', d => {\n const pos = this._projection(getLonLat(d, config.longitude, config.latitude))\n return `translate(${pos[0]},${pos[1]})`\n })\n .style('cursor', d => getString(d, config.pointCursor))\n\n smartTransition(pointsMerged.select(`.${s.pointCircle}`), duration)\n .attr('r', d => getNumber(d, config.pointRadius) / this._currentZoomLevel)\n .style('fill', (d, i) => getColor(d, config.pointColor, i))\n .style('stroke', (d, i) => getColor(d, config.pointColor, i))\n .style('stroke-width', d => getNumber(d, config.pointStrokeWidth) / this._currentZoomLevel)\n\n const pointLabelsMerged = pointsMerged.select(`.${s.pointLabel}`)\n pointLabelsMerged\n .text(d => getString(d, config.pointLabel) ?? '')\n .style('font-size', d => {\n if (config.pointLabelPosition === MapPointLabelPosition.Bottom) {\n return `calc(var(--vis-map-point-label-font-size) / ${this._currentZoomLevel}`\n }\n const pointDiameter = 2 * getNumber(d, config.pointRadius)\n const pointLabelText = getString(d, config.pointLabel) || ''\n const textLength = pointLabelText.length\n const fontSize = 0.5 * pointDiameter / Math.pow(textLength, 0.4)\n return clamp(fontSize, fontSize, 16)\n })\n .attr('y', d => {\n if (config.pointLabelPosition === MapPointLabelPosition.Center) return null\n\n const pointRadius = getNumber(d, config.pointRadius) / this._currentZoomLevel\n return pointRadius\n })\n .attr('dy', config.pointLabelPosition === MapPointLabelPosition.Center ? '0.32em' : '1em')\n\n smartTransition(pointLabelsMerged, duration)\n .style('fill', (d, i) => {\n if (config.pointLabelPosition === MapPointLabelPosition.Bottom) return null\n\n const pointColor = getColor(d, config.pointColor, i)\n const hex = color(isStringCSSVariable(pointColor) ? getCSSVariableValue(pointColor, this.element) : pointColor)?.hex()\n if (!hex) return null\n\n const brightness = hexToBrightness(hex)\n return brightness > config.pointLabelTextBrightnessRatio ? 'var(--vis-map-point-label-text-color-dark)' : 'var(--vis-map-point-label-text-color-light)'\n })\n .style('opacity', 1)\n\n // Exit\n points.exit().remove()\n\n // Heatmap\n this._pointsGroup.style('filter', (config.heatmapMode && this._currentZoomLevel < config.heatmapModeZoomLevelThreshold) ? 'url(#heatmapFilter)' : null)\n this._pointsGroup.selectAll(`.${s.pointLabel}`).style('display', (config.heatmapMode && (this._currentZoomLevel < config.heatmapModeZoomLevelThreshold)) ? 'none' : null)\n }\n\n _fitToPoints (points?: PointDatum[], pad = 0.1): void {\n const { config, datamodel } = this\n const pointData = points || datamodel.points\n if (pointData.length === 0) return\n\n const featureCollection: ExtendedFeatureCollection = {\n type: 'FeatureCollection',\n features: [{\n type: 'Feature',\n properties: {},\n geometry: {\n type: 'MultiPoint',\n coordinates: pointData.map(p => {\n return [\n getNumber(p, d => getNumber(d, config.longitude)),\n getNumber(p, d => getNumber(d, config.latitude)),\n ]\n }),\n },\n }],\n }\n\n this._projection.fitExtent([\n [this._width * pad, this._height * pad],\n [this._width * (1 - pad), this._height * (1 - pad)],\n ], featureCollection)\n\n const maxScale = config.zoomExtent[1] * this._initialScale\n if (this._projection.scale() > maxScale) this._projection.scale(maxScale)\n\n this._applyZoom()\n }\n\n _applyZoom (): void {\n const translate = this._center ?? this._projection.translate()\n const scale = this._initialScale * this._currentZoomLevel\n this.g.call(this._zoomBehavior.transform, zoomIdentity.translate(translate[0], translate[1]).scale(scale))\n }\n\n _onResize (): void {\n this._isResizing = true\n const prevTranslate = this._projection.translate()\n\n this._projection.fitExtent([[0, 0], [this._width, this._height]], this._featureCollection)\n this._initialScale = this._projection.scale()\n this._center = [\n this._projection.translate()[0] * this._center[0] / prevTranslate[0],\n this._projection.translate()[1] * this._center[1] / prevTranslate[1],\n ]\n this._applyZoom()\n\n this._isResizing = false\n this._prevWidth = this._width\n this._prevHeight = this._height\n }\n\n _onZoom (event: D3ZoomEvent<any, any>): void {\n if (this._firstRender) return // To prevent double render because of binding zoom behaviour\n const isMouseEvent = event.sourceEvent !== undefined\n const isExternalEvent = !event?.sourceEvent && !this._isResizing\n\n window.cancelAnimationFrame(this._animFrameId)\n this._animFrameId = window.requestAnimationFrame(this._onZoomHandler.bind(this, event.transform, isMouseEvent, isExternalEvent))\n\n if (isMouseEvent) {\n // Update the center coordinate so that the next call to _applyZoom()\n // will zoom with respect to the current view\n this._center = [event.transform.x, event.transform.y]\n }\n this._currentZoomLevel = (event?.transform.k / this._initialScale) || 1\n }\n\n _onZoomHandler (transform: ZoomTransform, isMouseEvent: boolean, isExternalEvent: boolean): void {\n const scale = transform.k / this._initialScale || 1\n const center = this._projection.translate()\n\n this._transform = zoomIdentity\n .translate(transform.x - center[0] * scale, transform.y - center[1] * scale)\n .scale(scale)\n\n const customDuration = isExternalEvent\n ? this.config.zoomDuration\n : (isMouseEvent ? 0 : null)\n\n // Call render functions that depend on this._transform\n this._renderGroups(customDuration)\n this._renderLinks(customDuration)\n this._renderPoints(customDuration)\n }\n\n public zoomIn (increment = 0.5): void {\n this.setZoom(this._currentZoomLevel + increment)\n }\n\n public zoomOut (increment = 0.5): void {\n this.setZoom(this._currentZoomLevel - increment)\n }\n\n public setZoom (zoomLevel: number): void {\n const { config } = this\n this._currentZoomLevel = clamp(zoomLevel, config.zoomExtent[0], config.zoomExtent[1])\n this._transform = zoomIdentity\n .translate(this._center[0] * (1 - this._currentZoomLevel), this._center[1] * (1 - this._currentZoomLevel))\n .scale(this._currentZoomLevel)\n // We are using this._applyZoom() instead of directly calling this._render(config.zoomDuration) because\n // we've to \"attach\" new transform to the map group element. Otherwise zoomBehavior will not know\n // that the zoom state has changed\n this._applyZoom()\n }\n\n public fitView (): void {\n this._projection.fitExtent([[0, 0], [this._width, this._height]], this._featureCollection)\n this._currentZoomLevel = (this._projection?.scale() / this._initialScale) || 1\n this._center = this._projection.translate()\n // We are using this._applyZoom() instead of directly calling this._render(config.zoomDuration) because\n // we've to \"attach\" new transform to the map group element. Otherwise zoomBehavior will not know\n // that the zoom state has changed\n this._applyZoom()\n }\n\n destroy (): void {\n window.cancelAnimationFrame(this._animFrameId)\n }\n}\n"],"names":["s.background","s.features","s.links","s.points","s.feature","s.link","s.point","s.pointCircle","s.pointLabel","s"],"mappings":";;;;;;;;;;;;;;;;;AAgCM,MAAO,WAIX,SAAQ,aAGP,CAAA;IA+BD,WAAa,CAAA,MAAqE,EAAE,IAAgD,EAAA;AAClI,QAAA,KAAK,EAAE,CAAA;QA9BC,IAAc,CAAA,cAAA,GAAG,wBAAwF,CAAA;AAC5G,QAAA,IAAA,CAAA,MAAM,GAAiE,IAAI,CAAC,cAAc,CAAA;AAEjG,QAAA,IAAA,CAAA,SAAS,GAAwD,IAAI,iBAAiB,EAAE,CAAA;QAEhF,IAAY,CAAA,YAAA,GAAG,IAAI,CAAA;QACnB,IAAW,CAAA,WAAA,GAAG,KAAK,CAAA;QACnB,IAAa,CAAA,aAAA,GAAW,SAAS,CAAA;QAEjC,IAAiB,CAAA,iBAAA,GAAW,SAAS,CAAA;QAErC,IAAK,CAAA,KAAA,GAAG,OAAO,EAAE,CAAA;QAOjB,IA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AAA,IAAI,CAAC,WAAW,0CAAE,KAAK,EAAE,IAAG,IAAI,CAAC,aAAa,KAAK,CAAC,CAAA;QAC9E,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,CAAA;;;;QAI3C,IAAI,CAAC,UAAU,EAAE,CAAA;KAClB;IAED,OAAO,GAAA;AACL,QAAA,MAAM,CAAC,oBAAoB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;KAC/C;;AA1YM,WAAS,CAAA,SAAA,GAAGC,KAAC;;;;"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Config } from "../../core/config";
|
|
2
1
|
import { VisControlItemInterface, VisControlsOrientation } from './types';
|
|
3
2
|
export interface VisControlsConfigInterface {
|
|
4
3
|
/** Controls items array, VisControlItemInterface[]. Default: `[]` */
|
|
@@ -6,7 +5,4 @@ export interface VisControlsConfigInterface {
|
|
|
6
5
|
/** Controls orientation. `VisControlsOrientation.Horizontal` or `VisControlsOrientation.Horizontal`. Default: `VisControlsOrientation.Horizontal` */
|
|
7
6
|
orientation?: VisControlsOrientation;
|
|
8
7
|
}
|
|
9
|
-
export declare
|
|
10
|
-
items: VisControlItemInterface[];
|
|
11
|
-
orientation: VisControlsOrientation;
|
|
12
|
-
}
|
|
8
|
+
export declare const VisControlsDefaultConfig: VisControlsConfigInterface;
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import { Config } from '../../core/config/index.js';
|
|
2
1
|
import { VisControlsOrientation } from './types.js';
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
}
|
|
3
|
+
// Local Types
|
|
4
|
+
const VisControlsDefaultConfig = {
|
|
5
|
+
items: [],
|
|
6
|
+
orientation: VisControlsOrientation.Horizontal,
|
|
7
|
+
};
|
|
11
8
|
|
|
12
|
-
export {
|
|
9
|
+
export { VisControlsDefaultConfig };
|
|
13
10
|
//# sourceMappingURL=config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sources":["../../../src/components/vis-controls/config.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"config.js","sources":["../../../src/components/vis-controls/config.ts"],"sourcesContent":["// Local Types\nimport { VisControlItemInterface, VisControlsOrientation } from './types'\n\nexport interface VisControlsConfigInterface {\n /** Controls items array, VisControlItemInterface[]. Default: `[]` */\n items?: VisControlItemInterface[];\n /** Controls orientation. `VisControlsOrientation.Horizontal` or `VisControlsOrientation.Horizontal`. Default: `VisControlsOrientation.Horizontal` */\n orientation?: VisControlsOrientation;\n}\n\nexport const VisControlsDefaultConfig: VisControlsConfigInterface = {\n items: [],\n orientation: VisControlsOrientation.Horizontal,\n}\n\n"],"names":[],"mappings":";;AAAA;AAUa,MAAA,wBAAwB,GAA+B;AAClE,IAAA,KAAK,EAAE,EAAE;IACT,WAAW,EAAE,sBAAsB,CAAC,UAAU;;;;;"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { Selection } from 'd3-selection';
|
|
2
2
|
import { VisControlItemInterface } from './types';
|
|
3
|
-
import {
|
|
3
|
+
import { VisControlsConfigInterface } from './config';
|
|
4
4
|
export declare class VisControls {
|
|
5
5
|
div: Selection<HTMLDivElement, unknown, null, undefined>;
|
|
6
6
|
element: HTMLDivElement;
|
|
7
|
-
|
|
7
|
+
protected _defaultConfig: VisControlsConfigInterface;
|
|
8
|
+
config: VisControlsConfigInterface;
|
|
8
9
|
protected _container: HTMLElement;
|
|
9
10
|
protected _items: Selection<HTMLDivElement, unknown, null, undefined>;
|
|
10
11
|
constructor(element: HTMLElement, config?: VisControlsConfigInterface);
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { select } from 'd3-selection';
|
|
2
|
+
import { merge } from '../../utils/data.js';
|
|
2
3
|
import { VisControlsOrientation } from './types.js';
|
|
3
|
-
import {
|
|
4
|
+
import { VisControlsDefaultConfig } from './config.js';
|
|
4
5
|
import { root, items, horizontalItems, item, itemButton, borderLeft, borderTop, borderRight, borderBottom, disabled } from './style.js';
|
|
5
6
|
|
|
6
7
|
class VisControls {
|
|
7
8
|
constructor(element, config) {
|
|
9
|
+
this._defaultConfig = VisControlsDefaultConfig;
|
|
10
|
+
this.config = this._defaultConfig;
|
|
8
11
|
this._container = element;
|
|
9
12
|
this.div = select(this._container)
|
|
10
13
|
.append('div')
|
|
@@ -16,7 +19,7 @@ class VisControls {
|
|
|
16
19
|
this.update(config);
|
|
17
20
|
}
|
|
18
21
|
update(config) {
|
|
19
|
-
this.config =
|
|
22
|
+
this.config = merge(this._defaultConfig, config);
|
|
20
23
|
this.render();
|
|
21
24
|
}
|
|
22
25
|
render() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/vis-controls/index.ts"],"sourcesContent":["import { Selection, select } from 'd3-selection'\n\n// Local Types\nimport { VisControlItemInterface, VisControlsOrientation } from './types'\n\n// Config\nimport {
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/vis-controls/index.ts"],"sourcesContent":["import { Selection, select } from 'd3-selection'\n\n// Utils\nimport { merge } from 'utils/data'\n\n// Local Types\nimport { VisControlItemInterface, VisControlsOrientation } from './types'\n\n// Config\nimport { VisControlsDefaultConfig, VisControlsConfigInterface } from './config'\n\n// Style\nimport * as s from './style'\n\nexport class VisControls {\n div: Selection<HTMLDivElement, unknown, null, undefined>\n element: HTMLDivElement\n protected _defaultConfig = VisControlsDefaultConfig as VisControlsConfigInterface\n public config: VisControlsConfigInterface = this._defaultConfig\n\n protected _container: HTMLElement\n protected _items: Selection<HTMLDivElement, unknown, null, undefined>\n\n constructor (element: HTMLElement, config?: VisControlsConfigInterface) {\n this._container = element\n\n this.div = select(this._container)\n .append('div')\n .attr('class', s.root)\n this.element = this.div.node()\n this._items = this.div.append('div')\n .attr('class', s.items)\n\n if (config) this.update(config)\n }\n\n update (config: VisControlsConfigInterface): void {\n this.config = merge(this._defaultConfig, config)\n this.render()\n }\n\n render (): void {\n const { config: { items, orientation } } = this\n this._items\n .classed(s.horizontalItems, orientation === VisControlsOrientation.Horizontal)\n const controlItems = this._items.selectAll<HTMLDivElement, VisControlItemInterface>(`.${s.item}`)\n .data(items)\n\n const controlItemsEnter = controlItems.enter()\n .append('div')\n .attr('class', s.item)\n .on('click', this._onItemClick.bind(this))\n\n controlItemsEnter.append('button')\n .attr('class', s.itemButton)\n\n const controlItemsMerged = controlItemsEnter.merge(controlItems)\n controlItemsMerged\n .classed(s.borderLeft, d => d.borderLeft)\n .classed(s.borderTop, d => d.borderTop)\n .classed(s.borderRight, d => d.borderRight)\n .classed(s.borderBottom, d => d.borderBottom)\n .classed(s.disabled, d => d.disabled)\n controlItemsMerged.select(`.${s.itemButton}`)\n .html(item => item.icon)\n\n controlItems.exit().remove()\n }\n\n _onItemClick (event: MouseEvent, item: VisControlItemInterface): void {\n item.callback?.(event)\n }\n}\n"],"names":["s.root","s.items","s.horizontalItems","s.item","s.itemButton","s.borderLeft","s.borderTop","s.borderRight","s.borderBottom","s.disabled"],"mappings":";;;;;;MAca,WAAW,CAAA;IAStB,WAAa,CAAA,OAAoB,EAAE,MAAmC,EAAA;QAN5D,IAAc,CAAA,cAAA,GAAG,wBAAsD,CAAA;AAC1E,QAAA,IAAA,CAAA,MAAM,GAA+B,IAAI,CAAC,cAAc,CAAA;AAM7D,QAAA,IAAI,CAAC,UAAU,GAAG,OAAO,CAAA;QAEzB,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC;aAC/B,MAAM,CAAC,KAAK,CAAC;AACb,aAAA,IAAI,CAAC,OAAO,EAAEA,IAAM,CAAC,CAAA;QACxB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAA;QAC9B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC;AACjC,aAAA,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C,WAAa,EAAE,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;AAC1C,aAAA,OAAO,CAACC,YAAc,EAAE,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC;AAC5C,aAAA,OAAO,CAACC,QAAU,EAAE,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAA;QACvC,kBAAkB,CAAC,MAAM,CAAC,CAAA,CAAA,EAAIL,UAAY,EAAE,CAAC;aAC1C,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,CAAA;AAE1B,QAAA,YAAY,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,CAAA;KAC7B;IAED,YAAY,CAAE,KAAiB,EAAE,IAA6B,EAAA;;QAC5D,CAAA,EAAA,GAAA,IAAI,CAAC,QAAQ,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,IAAA,CAAb,IAAI,EAAY,KAAK,CAAC,CAAA;KACvB;AACF;;;;"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { XYComponentConfigInterface
|
|
1
|
+
import { XYComponentConfigInterface } from "../../core/xy-component/config";
|
|
2
2
|
import { ColorAccessor, GenericAccessor, NumericAccessor, StringAccessor } from "../../types/accessor";
|
|
3
3
|
import { XYLabel, XYLabelPositioning } from './types';
|
|
4
4
|
export interface XYLabelsConfigInterface<Datum> extends XYComponentConfigInterface<Datum> {
|
|
5
|
+
/** Label color accessor function. Default: `d => d.color` */
|
|
6
|
+
color?: ColorAccessor<Datum>;
|
|
5
7
|
/** Single Y accessor function. Default: `undefined` */
|
|
6
8
|
y: NumericAccessor<Datum>;
|
|
7
9
|
/** Defines how to position the label horizontally: in data space or in screen space. Default: `XYLabelPositioning.DataSpace` */
|
|
@@ -31,18 +33,4 @@ export interface XYLabelsConfigInterface<Datum> extends XYComponentConfigInterfa
|
|
|
31
33
|
/** Cluster label color accessor function. Default: `null` */
|
|
32
34
|
clusterLabelColor?: ColorAccessor<XYLabel<Datum>[]>;
|
|
33
35
|
}
|
|
34
|
-
export declare
|
|
35
|
-
xPositioning: XYLabelPositioning;
|
|
36
|
-
yPositioning: XYLabelPositioning;
|
|
37
|
-
labelFontSize: any;
|
|
38
|
-
label: any;
|
|
39
|
-
backgroundColor: any;
|
|
40
|
-
cursor: any;
|
|
41
|
-
labelTextBrightnessRatio: number;
|
|
42
|
-
clustering: boolean;
|
|
43
|
-
clusterLabel: (records: XYLabel<Datum>[]) => string;
|
|
44
|
-
clusterFontSize: any;
|
|
45
|
-
clusterBackgroundColor: any;
|
|
46
|
-
clusterCursor: any;
|
|
47
|
-
clusterLabelColor: any;
|
|
48
|
-
}
|
|
36
|
+
export declare const XYLabelsDefaultConfig: XYLabelsConfigInterface<unknown>;
|
|
@@ -1,25 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { XYComponentDefaultConfig } from '../../core/xy-component/config.js';
|
|
2
2
|
import { XYLabelPositioning } from './types.js';
|
|
3
3
|
|
|
4
4
|
// Core
|
|
5
|
-
|
|
6
|
-
constructor() {
|
|
7
|
-
super(...arguments);
|
|
8
|
-
this.xPositioning = XYLabelPositioning.DataSpace;
|
|
9
|
-
this.yPositioning = XYLabelPositioning.DataSpace;
|
|
10
|
-
this.labelFontSize = undefined;
|
|
11
|
-
this.label = undefined;
|
|
12
|
-
this.backgroundColor = undefined;
|
|
13
|
-
this.cursor = null;
|
|
14
|
-
this.labelTextBrightnessRatio = 0.65;
|
|
15
|
-
this.clustering = true;
|
|
16
|
-
this.clusterLabel = (records) => records.length.toString();
|
|
17
|
-
this.clusterFontSize = undefined;
|
|
18
|
-
this.clusterBackgroundColor = undefined;
|
|
19
|
-
this.clusterCursor = undefined;
|
|
20
|
-
this.clusterLabelColor = null;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
5
|
+
const XYLabelsDefaultConfig = Object.assign(Object.assign({}, XYComponentDefaultConfig), { color: (d) => d.color, y: undefined, xPositioning: XYLabelPositioning.DataSpace, yPositioning: XYLabelPositioning.DataSpace, labelFontSize: undefined, label: undefined, backgroundColor: undefined, cursor: null, labelTextBrightnessRatio: 0.65, clustering: true, clusterLabel: (records) => records.length.toString(), clusterFontSize: undefined, clusterBackgroundColor: undefined, clusterCursor: undefined, clusterLabelColor: null });
|
|
23
6
|
|
|
24
|
-
export {
|
|
7
|
+
export { XYLabelsDefaultConfig };
|
|
25
8
|
//# sourceMappingURL=config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sources":["../../../src/components/xy-labels/config.ts"],"sourcesContent":["// Core\nimport { XYComponentConfigInterface,
|
|
1
|
+
{"version":3,"file":"config.js","sources":["../../../src/components/xy-labels/config.ts"],"sourcesContent":["// Core\nimport { XYComponentConfigInterface, XYComponentDefaultConfig } from 'core/xy-component/config'\n\n// Types\nimport { ColorAccessor, GenericAccessor, NumericAccessor, StringAccessor } from 'types/accessor'\n\n// Local Types\nimport { XYLabel, XYLabelPositioning } from './types'\n\nexport interface XYLabelsConfigInterface<Datum> extends XYComponentConfigInterface<Datum> {\n /** Label color accessor function. Default: `d => d.color` */\n color?: ColorAccessor<Datum>;\n /** Single Y accessor function. Default: `undefined` */\n y: NumericAccessor<Datum>;\n /** Defines how to position the label horizontally: in data space or in screen space. Default: `XYLabelPositioning.DataSpace` */\n xPositioning?: GenericAccessor<XYLabelPositioning | string, Datum>;\n /** Defines how to position the label vertically: in data space or in screen space. Default: `XYLabelPositioning.DataSpace` */\n yPositioning?: GenericAccessor<XYLabelPositioning | string, Datum>;\n /** Font size accessor function or constant value in pixels. If not provided, the value of CSS variable `--vis-xy-label-font-size` will be used. Default: `undefined` */\n labelFontSize?: NumericAccessor<Datum>;\n /** Label accessor function or string. Default: `undefined` */\n label?: StringAccessor<Datum>;\n /** Label color. Default: `undefined` */\n backgroundColor?: ColorAccessor<Datum>;\n /** Optional label cursor. Default: `null` */\n cursor?: StringAccessor<Datum>;\n /** Label color brightness ratio for switching between dark and light text label color. Default: `0.65` */\n labelTextBrightnessRatio?: number;\n /** Enable label clustering. Default: `true` */\n clustering?: boolean;\n /** Label accessor for clusters. Default: `undefined` */\n clusterLabel?: StringAccessor<XYLabel<Datum>[]>;\n /** Font size accessor for clusters, the value is in pixels. If not provided, the value of CSS variable `--vis-xy-label-cluster-font-size` will be used. Default: `undefined` */\n clusterFontSize?: NumericAccessor<XYLabel<Datum>[]>;\n /** Background color accessor for clusters. Default: `undefined` */\n clusterBackgroundColor?: ColorAccessor<XYLabel<Datum>[]>;\n /** Optional cluster cursor. Default: `null` */\n clusterCursor?: StringAccessor<XYLabel<Datum>[]>;\n /** Cluster label color accessor function. Default: `null` */\n clusterLabelColor?: ColorAccessor<XYLabel<Datum>[]>;\n}\nexport const XYLabelsDefaultConfig: XYLabelsConfigInterface<unknown> = {\n ...XYComponentDefaultConfig,\n color: (d: unknown): string => (d as { color: string }).color,\n y: undefined,\n xPositioning: XYLabelPositioning.DataSpace,\n yPositioning: XYLabelPositioning.DataSpace,\n labelFontSize: undefined,\n label: undefined,\n backgroundColor: undefined,\n cursor: null,\n labelTextBrightnessRatio: 0.65,\n\n clustering: true,\n clusterLabel: <Datum>(records: XYLabel<Datum>[]): string => records.length.toString(),\n clusterFontSize: undefined,\n clusterBackgroundColor: undefined,\n clusterCursor: undefined,\n clusterLabelColor: null,\n}\n\n"],"names":[],"mappings":";;;AAAA;AAyCa,MAAA,qBAAqB,mCAC7B,wBAAwB,CAAA,EAAA,EAC3B,KAAK,EAAE,CAAC,CAAU,KAAc,CAAuB,CAAC,KAAK,EAC7D,CAAC,EAAE,SAAS,EACZ,YAAY,EAAE,kBAAkB,CAAC,SAAS,EAC1C,YAAY,EAAE,kBAAkB,CAAC,SAAS,EAC1C,aAAa,EAAE,SAAS,EACxB,KAAK,EAAE,SAAS,EAChB,eAAe,EAAE,SAAS,EAC1B,MAAM,EAAE,IAAI,EACZ,wBAAwB,EAAE,IAAI,EAE9B,UAAU,EAAE,IAAI,EAChB,YAAY,EAAE,CAAQ,OAAyB,KAAa,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,EACrF,eAAe,EAAE,SAAS,EAC1B,sBAAsB,EAAE,SAAS,EACjC,aAAa,EAAE,SAAS,EACxB,iBAAiB,EAAE,IAAI;;;;"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { XYComponentCore } from "../../core/xy-component";
|
|
2
|
-
import {
|
|
2
|
+
import { XYLabelsConfigInterface } from './config';
|
|
3
3
|
import * as s from './style';
|
|
4
|
-
export declare class XYLabels<Datum> extends XYComponentCore<Datum,
|
|
4
|
+
export declare class XYLabels<Datum> extends XYComponentCore<Datum, XYLabelsConfigInterface<Datum>> {
|
|
5
5
|
static selectors: typeof s;
|
|
6
6
|
clippable: boolean;
|
|
7
|
-
|
|
7
|
+
protected _defaultConfig: XYLabelsConfigInterface<Datum>;
|
|
8
|
+
config: XYLabelsConfigInterface<Datum>;
|
|
8
9
|
events: {
|
|
9
10
|
[x: string]: {};
|
|
10
11
|
};
|
|
@@ -2,7 +2,7 @@ import { XYComponentCore } from '../../core/xy-component/index.js';
|
|
|
2
2
|
import { isNumber, getValue, isNumberWithinRange } from '../../utils/data.js';
|
|
3
3
|
import { rectIntersect } from '../../utils/misc.js';
|
|
4
4
|
import { XYLabelPositioning } from './types.js';
|
|
5
|
-
import {
|
|
5
|
+
import { XYLabelsDefaultConfig } from './config.js';
|
|
6
6
|
import { removeLabels, createLabels, updateLabels, getLabelRenderProps } from './modules/label.js';
|
|
7
7
|
import * as style from './style.js';
|
|
8
8
|
import { labelGroup, cluster, label } from './style.js';
|
|
@@ -12,7 +12,8 @@ class XYLabels extends XYComponentCore {
|
|
|
12
12
|
constructor(config) {
|
|
13
13
|
super();
|
|
14
14
|
this.clippable = false;
|
|
15
|
-
this.
|
|
15
|
+
this._defaultConfig = XYLabelsDefaultConfig;
|
|
16
|
+
this.config = this._defaultConfig;
|
|
16
17
|
this.events = {
|
|
17
18
|
[XYLabels.selectors.label]: {},
|
|
18
19
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/xy-labels/index.ts"],"sourcesContent":["// Core\nimport { XYComponentCore } from 'core/xy-component'\n\n// Utils\nimport { getValue, isNumber, isNumberWithinRange } from 'utils/data'\nimport { rectIntersect } from 'utils/misc'\n\n// Local Types\nimport { XYLabelCluster, XYLabel, XYLabelPositioning } from './types'\n\n// Config\nimport {
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/xy-labels/index.ts"],"sourcesContent":["// Core\nimport { XYComponentCore } from 'core/xy-component'\n\n// Utils\nimport { getValue, isNumber, isNumberWithinRange } from 'utils/data'\nimport { rectIntersect } from 'utils/misc'\n\n// Local Types\nimport { XYLabelCluster, XYLabel, XYLabelPositioning } from './types'\n\n// Config\nimport { XYLabelsDefaultConfig, XYLabelsConfigInterface } from './config'\n\n// Modules\nimport { createLabels, updateLabels, removeLabels, getLabelRenderProps } from './modules/label'\n\n// Styles\nimport * as s from './style'\n\nexport class XYLabels<Datum> extends XYComponentCore<Datum, XYLabelsConfigInterface<Datum>> {\n static selectors = s\n clippable = false\n protected _defaultConfig = XYLabelsDefaultConfig as XYLabelsConfigInterface<Datum>\n public config: XYLabelsConfigInterface<Datum> = this._defaultConfig\n\n events = {\n [XYLabels.selectors.label]: {},\n }\n\n constructor (config?: XYLabelsConfigInterface<Datum>) {\n super()\n if (config) this.setConfig(config)\n }\n\n _render (customDuration?: number): void {\n const { config } = this\n const duration = isNumber(customDuration) ? customDuration : config.duration\n\n const labelGroups = this.g\n .selectAll<SVGGElement, XYLabel<Datum> | XYLabelCluster<Datum>>(`.${s.labelGroup}`)\n .data(this._getDataToRender())\n\n const labelGroupsExit = labelGroups.exit<XYLabel<Datum> | XYLabelCluster<Datum>>()\n removeLabels(labelGroupsExit, duration)\n\n const labelGroupsEnter = labelGroups.enter().append('g')\n .attr('class', s.labelGroup)\n .call(createLabels)\n\n const labelGroupsMerged = labelGroupsEnter\n .merge(labelGroups)\n .classed(s.cluster, d => !!(d as XYLabelCluster<Datum>).records)\n .classed(s.label, d => !(d as XYLabelCluster<Datum>).records)\n\n labelGroupsMerged.call(updateLabels, config, duration)\n }\n\n private _getDataToRender (): (XYLabel<Datum> | XYLabelCluster<Datum>)[] {\n const { config, datamodel } = this\n\n const xRange = this.xScale.range() as [number, number]\n const yRange = this.xScale.range() as [number, number]\n\n const labels = datamodel.data?.reduce<XYLabel<Datum>[]>((acc, d) => {\n const xPositioning = getValue<Datum, XYLabelPositioning>(d, config.xPositioning)\n const yPositioning = getValue<Datum, XYLabelPositioning>(d, config.yPositioning)\n const props = getLabelRenderProps(d, this.element, config, this.xScale, this.yScale)\n\n if (\n ((xPositioning !== XYLabelPositioning.DataSpace) || isNumberWithinRange(props.x, xRange)) &&\n ((yPositioning !== XYLabelPositioning.DataSpace) || isNumberWithinRange(props.y, yRange))\n ) {\n acc.push({ ...d, _screen: props })\n }\n\n return acc\n }, []) ?? []\n\n return this._getClusteredLabels(labels)\n }\n\n private _getClusteredLabels (labels: XYLabel<Datum>[]): (XYLabel<Datum> | XYLabelCluster<Datum>)[] {\n const labelsNonOverlapping = [...labels]\n const clusterMap = new Map<XYLabel<Datum>, XYLabel<Datum>[]>()\n for (let i = 0; i < labelsNonOverlapping.length; i += 1) {\n const label1 = labelsNonOverlapping[i]\n for (let j = i + 1; j < labelsNonOverlapping.length; j += 1) {\n const label2 = labelsNonOverlapping[j]\n const isIntersecting = rectIntersect(label1._screen, label2._screen)\n if (isIntersecting) {\n if (!clusterMap.has(label1)) clusterMap.set(label1, [label1])\n clusterMap.get(label1).push(label2)\n labelsNonOverlapping.splice(j, 1)\n j -= 1\n }\n }\n\n if (clusterMap.has(label1)) {\n labelsNonOverlapping.splice(i, 1)\n i -= 1\n }\n }\n\n const clusters = Array.from(clusterMap.values()).map(records => ({\n _screen: getLabelRenderProps(records, this.element, this.config, this.xScale, this.yScale),\n records,\n }))\n\n return [...labelsNonOverlapping, ...clusters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BAAoB,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;oBACjC,CAAC,IAAI,CAAC,CAAA;AACP,iBAAA;AACF,aAAA;AAED,YAAA,IAAI,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;AAC1B,gBAAA,oBAAoB,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;gBACjC,CAAC,IAAI,CAAC,CAAA;AACP,aAAA;AACF,SAAA;AAED,QAAA,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,OAAO,KAAK;YAC/D,OAAO,EAAE,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC;YAC1F,OAAO;AACR,SAAA,CAAC,CAAC,CAAA;AAEH,QAAA,OAAO,CAAC,GAAG,oBAAoB,EAAE,GAAG,QAAQ,CAAC,CAAA;KAC9C;;AAzFM,QAAS,CAAA,SAAA,GAAGC,KAAC;;;;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Selection } from 'd3-selection';
|
|
2
2
|
import { ContinuousScale } from "../../../types/scale";
|
|
3
|
-
import {
|
|
3
|
+
import { XYLabelsConfigInterface } from '../config';
|
|
4
4
|
import { XYLabel, XYLabelCluster, XYLabelPositioning, XYLabelRenderProps } from '../types';
|
|
5
5
|
export declare function createLabels<Datum>(selection: Selection<SVGGElement, XYLabel<Datum> | XYLabelCluster<Datum>, any, any>): void;
|
|
6
|
-
export declare function updateLabels<Datum>(selection: Selection<SVGGElement, XYLabel<Datum> | XYLabelCluster<Datum>, any, any>, config:
|
|
6
|
+
export declare function updateLabels<Datum>(selection: Selection<SVGGElement, XYLabel<Datum> | XYLabelCluster<Datum>, any, any>, config: XYLabelsConfigInterface<Datum>, duration: number): void;
|
|
7
7
|
export declare function removeLabels<Datum>(selection: Selection<SVGGElement, XYLabel<Datum> | XYLabelCluster<Datum>, any, any>, duration: number): void;
|
|
8
8
|
export declare function getLabelPosition(value: number, positioning: XYLabelPositioning, scale: ContinuousScale): number;
|
|
9
|
-
export declare function getLabelRenderProps<Datum>(data: Datum | XYLabel<Datum>[], el: SVGGraphicsElement, config:
|
|
9
|
+
export declare function getLabelRenderProps<Datum>(data: Datum | XYLabel<Datum>[], el: SVGGraphicsElement, config: XYLabelsConfigInterface<Datum>, xScale: ContinuousScale, yScale: ContinuousScale): XYLabelRenderProps;
|
|
@@ -79,7 +79,7 @@ function getLabelRenderProps(data, el, config, xScale, yScale) {
|
|
|
79
79
|
const fontSize = isCluster
|
|
80
80
|
? ((_a = getNumber(data, config.clusterFontSize)) !== null && _a !== void 0 ? _a : getCSSVariableValueInPixels('var(--vis-xy-label-cluster-font-size)', el))
|
|
81
81
|
: ((_b = getNumber(data, config.labelFontSize)) !== null && _b !== void 0 ? _b : getCSSVariableValueInPixels('var(--vis-xy-label-font-size)', el));
|
|
82
|
-
const labelText = (isCluster ? config.clusterLabel
|
|
82
|
+
const labelText = (isCluster ? getString(data, config.clusterLabel) : getString(data, config.label)) || '';
|
|
83
83
|
const backgroundHeight = fontSize * 1.7;
|
|
84
84
|
let backgroundWidth = fontSize * labelText.length * 0.7;
|
|
85
85
|
if (backgroundWidth < backgroundHeight)
|