@unovis/ts 1.5.1-xplg.1 → 1.5.1-xplg.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/annotations/style.js.map +1 -1
- package/components/area/style.js.map +1 -1
- package/components/axis/style.js.map +1 -1
- package/components/brush/style.js.map +1 -1
- package/components/bullet-legend/style.js.map +1 -1
- package/components/chord-diagram/style.js.map +1 -1
- package/components/crosshair/style.js.map +1 -1
- package/components/donut/style.js.map +1 -1
- package/components/flow-legend/style.js.map +1 -1
- package/components/free-brush/style.js.map +1 -1
- package/components/graph/config.d.ts +6 -1
- package/components/graph/config.js +2 -2
- package/components/graph/config.js.map +1 -1
- package/components/graph/index.d.ts +2 -2
- package/components/graph/index.js +37 -14
- package/components/graph/index.js.map +1 -1
- package/components/graph/modules/link/style.js.map +1 -1
- package/components/graph/modules/node/style.js.map +1 -1
- package/components/graph/modules/panel/style.js.map +1 -1
- package/components/graph/style.js.map +1 -1
- package/components/graph/types.d.ts +7 -0
- package/components/graph/types.js +10 -2
- package/components/graph/types.js.map +1 -1
- package/components/grouped-bar/style.js.map +1 -1
- package/components/leaflet-flow-map/config.js +1 -0
- package/components/leaflet-flow-map/config.js.map +1 -1
- package/components/leaflet-flow-map/shaders.js.map +1 -1
- package/components/leaflet-map/config.js +1 -0
- package/components/leaflet-map/config.js.map +1 -1
- package/components/leaflet-map/modules/map.js +3 -3
- package/components/leaflet-map/modules/map.js.map +1 -1
- package/components/leaflet-map/renderer/leaflet-maplibre-gl.js.map +1 -1
- package/components/leaflet-map/style.js.map +1 -1
- package/components/line/style.js.map +1 -1
- package/components/nested-donut/style.js.map +1 -1
- package/components/rolling-pin-legend/config.d.ts +19 -0
- package/components/rolling-pin-legend/config.js +9 -0
- package/components/rolling-pin-legend/config.js.map +1 -0
- package/components/rolling-pin-legend/index.d.ts +16 -0
- package/components/rolling-pin-legend/index.js +63 -0
- package/components/rolling-pin-legend/index.js.map +1 -0
- package/components/rolling-pin-legend/style.d.ts +5 -0
- package/components/rolling-pin-legend/style.js +40 -0
- package/components/rolling-pin-legend/style.js.map +1 -0
- package/components/rolling-pin-legend/types.d.ts +1 -0
- package/components/sankey/modules/label.js.map +1 -1
- package/components/sankey/modules/link.js.map +1 -1
- package/components/sankey/style.js.map +1 -1
- package/components/scatter/style.js.map +1 -1
- package/components/stacked-bar/style.js.map +1 -1
- package/components/timeline/index.js +12 -8
- package/components/timeline/index.js.map +1 -1
- package/components/timeline/style.js.map +1 -1
- package/components/tooltip/style.js.map +1 -1
- package/components/topojson-map/index.js.map +1 -1
- package/components/topojson-map/style.js.map +1 -1
- package/components/treemap/style.js.map +1 -1
- package/components/vis-controls/style.js.map +1 -1
- package/components/xy-labels/style.js.map +1 -1
- package/components.d.ts +2 -0
- package/components.js +1 -0
- package/components.js.map +1 -1
- package/containers/xy-container/index.js.map +1 -1
- package/core/container/config.js +1 -0
- package/core/container/config.js.map +1 -1
- package/index.js +2 -1
- package/index.js.map +1 -1
- package/maps/ind-regions.json.js +1 -1
- package/maps/us-counties.json.js +8 -8
- package/package.json +1 -1
- package/styles/index.js.map +1 -1
- package/styles/patterns.js.map +1 -1
- package/styles/sizes.js.map +1 -1
- package/types.js +3 -2
- package/types.js.map +1 -1
- package/utils/path.js.map +1 -1
- package/utils/text.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sources":["../../../src/components/graph/types.ts"],"sourcesContent":["// Types\nimport { Position } from 'types/position'\nimport { GraphInputLink, GraphInputNode, GraphNodeCore, GraphLinkCore } from 'types/graph'\nimport { Spacing } from 'types/spacing'\nimport { TrimMode } from 'types/text'\n\nexport type GraphNode<\n N extends GraphInputNode = GraphInputNode,\n L extends GraphInputLink = GraphInputLink,\n> = GraphNodeCore<N, L> & {\n x?: number;\n y?: number;\n\n _id?: number | string;\n _index?: number;\n _state?: {\n isDragged?: boolean;\n fx?: number;\n fy?: number;\n selected?: boolean;\n greyout?: boolean;\n brushed?: boolean;\n };\n\n _panels?: GraphPanel<N, L>[];\n _isConnected?: boolean;\n}\n\nexport type GraphForceSimulationNode<\n N extends GraphInputNode = GraphInputNode,\n L extends GraphInputLink = GraphInputLink,\n> = GraphNode<N, L> & {\n fx?: number;\n fy?: number;\n}\n\nexport type GraphLink<\n N extends GraphInputNode = GraphInputNode,\n L extends GraphInputLink = GraphInputLink,\n> = GraphLinkCore<N, L> & {\n id?: number | string;\n source: number | string | GraphNode<N>;\n target: number | string | GraphNode<N>;\n\n _id?: number | string;\n _direction?: number;\n _index?: number;\n _neighbours?: number;\n\n _state?: {\n flowAnimTime?: number;\n hovered?: boolean;\n selected?: boolean;\n greyout?: boolean;\n };\n}\n\nexport enum GraphLayoutType {\n Circular = 'circular',\n Concentric = 'concentric',\n Parallel = 'parallel',\n ParallelHorizontal = 'parallel horizontal',\n Dagre = 'dagre',\n Force = 'force',\n Elk = 'elk',\n Precalculated = 'precalculated',\n}\n\nexport type GraphCircleLabel = {\n text: string;\n textColor?: string | null;\n color?: string | null;\n cursor?: string | null;\n fontSize?: string | null;\n radius?: number;\n}\n\nexport type GraphLinkLabel = GraphCircleLabel\n\nexport enum GraphLinkStyle {\n Dashed = 'dashed',\n Solid = 'solid',\n}\n\nexport enum GraphLinkArrowStyle {\n Single = 'single',\n Double = 'double',\n}\n\nexport enum GraphNodeShape {\n Circle = 'circle',\n Square = 'square',\n Hexagon = 'hexagon',\n Triangle = 'triangle',\n}\n\nexport type GraphPanelConfig = {\n /** Panel nodes references by unique ids */\n nodes: (string|number)[];\n /** Panel label */\n label?: string;\n /** Trim label if it's longer than this number of characters */\n labelTrimLength?: number;\n /** Trim mode of the label */\n labelTrimMode?: TrimMode;\n /** Position of the label */\n labelPosition?: Position.Top | Position.Bottom | string;\n /** Fill color of the panel */\n fillColor?: string;\n /** Color of the panel's border */\n borderColor?: string;\n /** Border width of the panel in pixels */\n borderWidth?: number;\n /** Inner padding */\n padding?: number | Spacing;\n /** Dashed outline showing that the panel is selected */\n dashedOutline?: boolean;\n /** Side icon symbol */\n sideIconSymbol?: string;\n /** Size of the icon as a CSS string. e.g.: `12pt` or `12px` */\n sideIconFontSize?: string;\n /** Color of the icon */\n sideIconSymbolColor?: string;\n /** Shape of the icon's background */\n sideIconShape?: GraphNodeShape | string;\n /** Size of the icon's background shape */\n sideIconShapeSize?: number;\n /** Stroke color of the icon's background shape */\n sideIconShapeStroke?: string;\n /** Cursor, when hovering over the icon */\n sideIconCursor?: string;\n}\n\nexport type GraphPanel<\n N extends GraphInputNode = GraphInputNode,\n L extends GraphInputLink = GraphInputLink,\n> = GraphPanelConfig & {\n _numNodes?: number;\n _x?: number;\n _y?: number;\n _width?: number;\n _height?: number;\n _disabled?: boolean;\n _padding?: Spacing;\n}\n\nexport type GraphNodeAnimationState = {\n endAngle: number;\n nodeIndex: number;\n nodeSize?: number;\n borderWidth?: number;\n}\n\nexport type GraphNodeAnimatedElement<T = SVGElement> = T & {\n _animState: GraphNodeAnimationState;\n}\n\nexport type GraphForceLayoutSettings<\n N extends GraphInputNode = GraphInputNode,\n L extends GraphInputLink = GraphInputLink,\n> = {\n /** Preferred Link Distance. Default: `60` */\n linkDistance?: number | ((l: GraphLink<N, L>, i: number) => number);\n /** Link Strength [0:1]. Default: `0.45` */\n linkStrength?: number | ((l: GraphLink<N, L>, i: number) => number);\n /** Charge Force (<0 repulsion, >0 attraction). Default: `-500` */\n charge?: number | ((l: GraphNode<N, L>, i: number) => number);\n /** X-centring force. Default: `0.15` */\n forceXStrength?: number;\n /** Y-centring force. Default: `0.25` */\n forceYStrength?: number;\n /** Number if simulation iterations. Default: automatic */\n numIterations?: number;\n /** Set to true if you want to fix the node positions after the simulation\n * Helpful when you want to update graph settings without re-calculating the layout.\n * Default: `false` */\n fixNodePositionAfterSimulation?: boolean;\n}\n\nexport type GraphElkLayoutSettings = Record<string, string>\n\n/**\n * Settings for configuring the layout of a Dagre graph.\n */\nexport type GraphDagreLayoutSetting = {\n /**\n * Direction for rank nodes. Can be TB, BT, LR, or RL, where T = top, B = bottom, L = left, and R = right.\n * Additional custom values can also be provided as a string.\n */\n rankdir?: 'TB' | 'BT' | 'LR' | 'RL' | string;\n\n /**\n * Alignment for rank nodes. Can be UL, UR, DL, or DR, where U = up, D = down, L = left, and R = right.\n * Additional custom values can also be provided as a string.\n */\n align?: 'UL' | 'UR' | 'DL' | 'DR' | string;\n\n /**\n * Number of pixels that separate nodes horizontally in the layout.\n */\n nodesep?: number;\n\n /**\n * Number of pixels that separate edges horizontally in the layout.\n */\n edgesep?: number;\n\n /**\n * Number of pixels between each rank in the layout.\n */\n ranksep?: number;\n\n /**\n * Number of pixels to use as a margin around the left and right of the graph.\n */\n marginx?: number;\n\n /**\n * Number of pixels to use as a margin around the top and bottom of the graph.\n */\n marginy?: number;\n\n /**\n * If set to 'greedy', uses a greedy heuristic for finding a feedback arc set for a graph.\n * A feedback arc set is a set of edges that can be removed to make a graph acyclic.\n */\n acyclicer?: 'greedy' | undefined;\n\n /**\n * Type of algorithm to assign a rank to each node in the input graph.\n * Possible values are 'network-simplex', 'tight-tree', or 'longest-path'.\n * Additional custom values can also be provided as a string.\n */\n ranker?: 'network-simplex' | 'tight-tree' | 'longest-path' | string;\n}\n\nexport enum GraphNodeSelectionHighlightMode {\n None = 'none',\n Greyout ='greyout',\n GreyoutNonConnected ='greyout-non-connected',\n}\n"],"names":[],"mappings":"IAyDY,gBASX;AATD,CAAA,UAAY,eAAe,EAAA;AACzB,IAAA,eAAA,CAAA,UAAA,CAAA,GAAA,UAAqB,CAAA;AACrB,IAAA,eAAA,CAAA,YAAA,CAAA,GAAA,YAAyB,CAAA;AACzB,IAAA,eAAA,CAAA,UAAA,CAAA,GAAA,UAAqB,CAAA;AACrB,IAAA,eAAA,CAAA,oBAAA,CAAA,GAAA,qBAA0C,CAAA;AAC1C,IAAA,eAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACf,IAAA,eAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AAC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AAA;;;;"}
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../../../src/components/graph/types.ts"],"sourcesContent":["// Types\nimport { Position } from 'types/position'\nimport { GraphInputLink, GraphInputNode, GraphNodeCore, GraphLinkCore } from 'types/graph'\nimport { Spacing } from 'types/spacing'\nimport { TrimMode } from 'types/text'\n\nexport type GraphNode<\n N extends GraphInputNode = GraphInputNode,\n L extends GraphInputLink = GraphInputLink,\n> = GraphNodeCore<N, L> & {\n x?: number;\n y?: number;\n\n _id?: number | string;\n _index?: number;\n _state?: {\n isDragged?: boolean;\n fx?: number;\n fy?: number;\n selected?: boolean;\n greyout?: boolean;\n brushed?: boolean;\n };\n\n _panels?: GraphPanel<N, L>[];\n _isConnected?: boolean;\n}\n\nexport type GraphForceSimulationNode<\n N extends GraphInputNode = GraphInputNode,\n L extends GraphInputLink = GraphInputLink,\n> = GraphNode<N, L> & {\n fx?: number;\n fy?: number;\n}\n\nexport type GraphLink<\n N extends GraphInputNode = GraphInputNode,\n L extends GraphInputLink = GraphInputLink,\n> = GraphLinkCore<N, L> & {\n id?: number | string;\n source: number | string | GraphNode<N>;\n target: number | string | GraphNode<N>;\n\n _id?: number | string;\n _direction?: number;\n _index?: number;\n _neighbours?: number;\n\n _state?: {\n flowAnimTime?: number;\n hovered?: boolean;\n selected?: boolean;\n greyout?: boolean;\n };\n}\n\nexport enum GraphLayoutType {\n Circular = 'circular',\n Concentric = 'concentric',\n Parallel = 'parallel',\n ParallelHorizontal = 'parallel horizontal',\n Dagre = 'dagre',\n Force = 'force',\n Elk = 'elk',\n Precalculated = 'precalculated',\n}\n\nexport type GraphCircleLabel = {\n text: string;\n textColor?: string | null;\n color?: string | null;\n cursor?: string | null;\n fontSize?: string | null;\n radius?: number;\n}\n\nexport type GraphLinkLabel = GraphCircleLabel\n\nexport enum GraphLinkStyle {\n Dashed = 'dashed',\n Solid = 'solid',\n}\n\nexport enum GraphLinkArrowStyle {\n Single = 'single',\n Double = 'double',\n}\n\nexport enum GraphNodeShape {\n Circle = 'circle',\n Square = 'square',\n Hexagon = 'hexagon',\n Triangle = 'triangle',\n}\n\nexport type GraphPanelConfig = {\n /** Panel nodes references by unique ids */\n nodes: (string|number)[];\n /** Panel label */\n label?: string;\n /** Trim label if it's longer than this number of characters */\n labelTrimLength?: number;\n /** Trim mode of the label */\n labelTrimMode?: TrimMode;\n /** Position of the label */\n labelPosition?: Position.Top | Position.Bottom | string;\n /** Fill color of the panel */\n fillColor?: string;\n /** Color of the panel's border */\n borderColor?: string;\n /** Border width of the panel in pixels */\n borderWidth?: number;\n /** Inner padding */\n padding?: number | Spacing;\n /** Dashed outline showing that the panel is selected */\n dashedOutline?: boolean;\n /** Side icon symbol */\n sideIconSymbol?: string;\n /** Size of the icon as a CSS string. e.g.: `12pt` or `12px` */\n sideIconFontSize?: string;\n /** Color of the icon */\n sideIconSymbolColor?: string;\n /** Shape of the icon's background */\n sideIconShape?: GraphNodeShape | string;\n /** Size of the icon's background shape */\n sideIconShapeSize?: number;\n /** Stroke color of the icon's background shape */\n sideIconShapeStroke?: string;\n /** Cursor, when hovering over the icon */\n sideIconCursor?: string;\n}\n\nexport type GraphPanel<\n N extends GraphInputNode = GraphInputNode,\n L extends GraphInputLink = GraphInputLink,\n> = GraphPanelConfig & {\n _numNodes?: number;\n _x?: number;\n _y?: number;\n _width?: number;\n _height?: number;\n _disabled?: boolean;\n _padding?: Spacing;\n}\n\nexport type GraphNodeAnimationState = {\n endAngle: number;\n nodeIndex: number;\n nodeSize?: number;\n borderWidth?: number;\n}\n\nexport type GraphNodeAnimatedElement<T = SVGElement> = T & {\n _animState: GraphNodeAnimationState;\n}\n\nexport type GraphForceLayoutSettings<\n N extends GraphInputNode = GraphInputNode,\n L extends GraphInputLink = GraphInputLink,\n> = {\n /** Preferred Link Distance. Default: `60` */\n linkDistance?: number | ((l: GraphLink<N, L>, i: number) => number);\n /** Link Strength [0:1]. Default: `0.45` */\n linkStrength?: number | ((l: GraphLink<N, L>, i: number) => number);\n /** Charge Force (<0 repulsion, >0 attraction). Default: `-500` */\n charge?: number | ((l: GraphNode<N, L>, i: number) => number);\n /** X-centring force. Default: `0.15` */\n forceXStrength?: number;\n /** Y-centring force. Default: `0.25` */\n forceYStrength?: number;\n /** Number if simulation iterations. Default: automatic */\n numIterations?: number;\n /** Set to true if you want to fix the node positions after the simulation\n * Helpful when you want to update graph settings without re-calculating the layout.\n * Default: `false` */\n fixNodePositionAfterSimulation?: boolean;\n}\n\nexport type GraphElkLayoutSettings = Record<string, string>\n\n/**\n * Settings for configuring the layout of a Dagre graph.\n */\nexport type GraphDagreLayoutSetting = {\n /**\n * Direction for rank nodes. Can be TB, BT, LR, or RL, where T = top, B = bottom, L = left, and R = right.\n * Additional custom values can also be provided as a string.\n */\n rankdir?: 'TB' | 'BT' | 'LR' | 'RL' | string;\n\n /**\n * Alignment for rank nodes. Can be UL, UR, DL, or DR, where U = up, D = down, L = left, and R = right.\n * Additional custom values can also be provided as a string.\n */\n align?: 'UL' | 'UR' | 'DL' | 'DR' | string;\n\n /**\n * Number of pixels that separate nodes horizontally in the layout.\n */\n nodesep?: number;\n\n /**\n * Number of pixels that separate edges horizontally in the layout.\n */\n edgesep?: number;\n\n /**\n * Number of pixels between each rank in the layout.\n */\n ranksep?: number;\n\n /**\n * Number of pixels to use as a margin around the left and right of the graph.\n */\n marginx?: number;\n\n /**\n * Number of pixels to use as a margin around the top and bottom of the graph.\n */\n marginy?: number;\n\n /**\n * If set to 'greedy', uses a greedy heuristic for finding a feedback arc set for a graph.\n * A feedback arc set is a set of edges that can be removed to make a graph acyclic.\n */\n acyclicer?: 'greedy' | undefined;\n\n /**\n * Type of algorithm to assign a rank to each node in the input graph.\n * Possible values are 'network-simplex', 'tight-tree', or 'longest-path'.\n * Additional custom values can also be provided as a string.\n */\n ranker?: 'network-simplex' | 'tight-tree' | 'longest-path' | string;\n}\n\nexport enum GraphNodeSelectionHighlightMode {\n None = 'none',\n Greyout ='greyout',\n GreyoutNonConnected ='greyout-non-conn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AAA,CAAA,GAAA,QAAiB,CAAA;AACjB,IAAA,cAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;AACnB,IAAA,cAAA,CAAA,UAAA,CAAA,GAAA,UAAqB,CAAA;AACvB,CAAC,EALW,cAAc,KAAd,cAAc,GAKzB,EAAA,CAAA,CAAA,CAAA;IA8IW,gCAIX;AAJD,CAAA,UAAY,+BAA+B,EAAA;AACzC,IAAA,+BAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACb,IAAA,+BAAA,CAAA,SAAA,CAAA,GAAA,SAAkB,CAAA;AAClB,IAAA,+BAAA,CAAA,qBAAA,CAAA,GAAA,uBAA4C,CAAA;AAC9C,CAAC,EAJW,+BAA+B,KAA/B,+BAA+B,GAI1C,EAAA,CAAA,CAAA,CAAA;IAEW,sBAMX;AAND,CAAA,UAAY,qBAAqB,EAAA;AAC/B,IAAA,qBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB,CAAA;AACjB,IAAA,qBAAA,CAAA,KAAA,CAAA,GAAA,KAAW,CAAA;AACX,IAAA,qBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB,CAAA;AACjB,IAAA,qBAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACb,IAAA,qBAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACjB,CAAC,EANW,qBAAqB,KAArB,qBAAqB,GAMhC,EAAA,CAAA,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.js","sources":["../../../src/components/grouped-bar/style.ts"],"sourcesContent":["import { css, injectGlobal } from '@emotion/css'\n\nexport const root = css`\n label: grouped-bar-component;\n`\n\nexport const globalStyles = injectGlobal`\n :root {\n --vis-grouped-bar-cursor: default;\n --vis-grouped-bar-fill-color: var(--vis-color-main);\n --vis-grouped-bar-stroke-color: none;\n --vis-grouped-bar-stroke-width: 0px;\n --vis-grouped-bar-hover-stroke-width: 1px;\n --vis-grouped-bar-hover-stroke-color: none;\n\n\n /* Dark Theme */\n --vis-dark-grouped-bar-stroke-color: none;\n }\n\n body.theme-dark ${`.${root}`} {\n --vis-grouped-bar-stroke-color: var(--vis-dark-grouped-bar-stroke-color);\n }\n`\n\nexport const bar = css`\n label: bar;\n fill: var(--vis-grouped-bar-fill-color);\n stroke: var(--vis-grouped-bar-stroke-color);\n stroke-width: var(--vis-grouped-bar-stroke-width);\n cursor: var(--vis-grouped-bar-cursor);\n\n &:hover {\n stroke-width: var(--vis-grouped-bar-hover-stroke-width);\n stroke: var(--vis-grouped-bar-hover-stroke-color);\n }\n`\n\nexport const barGroup = css`\n label: barGroup;\n`\n\nexport const barGroupExit = css`\n label: barGroupExit;\n`\n"],"names":[],"mappings":";;AAEO,MAAM,IAAI,GAAG,GAAG,CAAA
|
|
1
|
+
{"version":3,"file":"style.js","sources":["../../../src/components/grouped-bar/style.ts"],"sourcesContent":["import { css, injectGlobal } from '@emotion/css'\n\nexport const root = css`\n label: grouped-bar-component;\n`\n\nexport const globalStyles = injectGlobal`\n :root {\n --vis-grouped-bar-cursor: default;\n --vis-grouped-bar-fill-color: var(--vis-color-main);\n --vis-grouped-bar-stroke-color: none;\n --vis-grouped-bar-stroke-width: 0px;\n --vis-grouped-bar-hover-stroke-width: 1px;\n --vis-grouped-bar-hover-stroke-color: none;\n\n\n /* Dark Theme */\n --vis-dark-grouped-bar-stroke-color: none;\n }\n\n body.theme-dark ${`.${root}`} {\n --vis-grouped-bar-stroke-color: var(--vis-dark-grouped-bar-stroke-color);\n }\n`\n\nexport const bar = css`\n label: bar;\n fill: var(--vis-grouped-bar-fill-color);\n stroke: var(--vis-grouped-bar-stroke-color);\n stroke-width: var(--vis-grouped-bar-stroke-width);\n cursor: var(--vis-grouped-bar-cursor);\n\n &:hover {\n stroke-width: var(--vis-grouped-bar-hover-stroke-width);\n stroke: var(--vis-grouped-bar-hover-stroke-color);\n }\n`\n\nexport const barGroup = css`\n label: barGroup;\n`\n\nexport const barGroupExit = css`\n label: barGroupExit;\n`\n"],"names":[],"mappings":";;AAEO,MAAM,IAAI,GAAG,GAAG,CAAA;;EAEtB;AAEM,MAAM,YAAY,GAAG,YAAY,CAAA;;;;;;;;;;;;;;AAcpB,kBAAA,EAAA,CAAA,CAAA,EAAI,IAAI,CAAE,CAAA,CAAA;;;EAG7B;AAEM,MAAM,GAAG,GAAG,GAAG,CAAA;;;;;;;;;;;EAWrB;AAEM,MAAM,QAAQ,GAAG,GAAG,CAAA;;EAE1B;AAEM,MAAM,YAAY,GAAG,GAAG,CAAA;;;;;;"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { LeafletMapDefaultConfig } from '../leaflet-map/config.js';
|
|
2
2
|
|
|
3
3
|
/* eslint-disable dot-notation */
|
|
4
|
+
// Config
|
|
4
5
|
const LeafletFlowMapDefaultConfig = Object.assign(Object.assign({}, LeafletMapDefaultConfig), { sourceLongitude: (f) => f.sourceLongitude, sourceLatitude: (f) => f.sourceLatitude, targetLongitude: (f) => f.targetLongitude, targetLatitude: (f) => f.targetLatitude, sourcePointRadius: 3, sourcePointColor: '#88919f', flowParticleColor: '#949dad', flowParticleRadius: 1.1, flowParticleSpeed: 0.07, flowParticleDensity: 0.6, onSourcePointClick: undefined, onSourcePointMouseEnter: undefined, onSourcePointMouseLeave: undefined });
|
|
5
6
|
|
|
6
7
|
export { LeafletFlowMapDefaultConfig };
|
|
@@ -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 { LeafletMapDefaultConfig, 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 const LeafletFlowMapDefaultConfig: LeafletFlowMapConfigInterface<GenericDataRecord, GenericDataRecord> = {\n ...LeafletMapDefaultConfig,\n sourceLongitude: (f: unknown): number => (f as { sourceLongitude: number }).sourceLongitude as number,\n sourceLatitude: (f: unknown): number => (f as { sourceLatitude: number }).sourceLatitude as number,\n targetLongitude: (f: unknown): number => (f as { targetLongitude: number }).targetLongitude as number,\n targetLatitude: (f: unknown): number => (f as { targetLatitude: number }).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 onSourcePointClick: undefined,\n onSourcePointMouseEnter: undefined,\n onSourcePointMouseLeave: undefined,\n}\n"],"names":[],"mappings":";;AAAA;
|
|
1
|
+
{"version":3,"file":"config.js","sources":["../../../src/components/leaflet-flow-map/config.ts"],"sourcesContent":["/* eslint-disable dot-notation */\n\n// Config\nimport { LeafletMapDefaultConfig, 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 const LeafletFlowMapDefaultConfig: LeafletFlowMapConfigInterface<GenericDataRecord, GenericDataRecord> = {\n ...LeafletMapDefaultConfig,\n sourceLongitude: (f: unknown): number => (f as { sourceLongitude: number }).sourceLongitude as number,\n sourceLatitude: (f: unknown): number => (f as { sourceLatitude: number }).sourceLatitude as number,\n targetLongitude: (f: unknown): number => (f as { targetLongitude: number }).targetLongitude as number,\n targetLatitude: (f: unknown): number => (f as { targetLatitude: number }).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 onSourcePointClick: undefined,\n onSourcePointMouseEnter: undefined,\n onSourcePointMouseLeave: undefined,\n}\n"],"names":[],"mappings":";;AAAA;AAEA;AAsCa,MAAA,2BAA2B,mCACnC,uBAAuB,CAAA,EAAA,EAC1B,eAAe,EAAE,CAAC,CAAU,KAAc,CAAiC,CAAC,eAAyB,EACrG,cAAc,EAAE,CAAC,CAAU,KAAc,CAAgC,CAAC,cAAwB,EAClG,eAAe,EAAE,CAAC,CAAU,KAAc,CAAiC,CAAC,eAAyB,EACrG,cAAc,EAAE,CAAC,CAAU,KAAc,CAAgC,CAAC,cAAwB,EAClG,iBAAiB,EAAE,CAAC,EACpB,gBAAgB,EAAE,SAAS,EAC3B,iBAAiB,EAAE,SAAS,EAC5B,kBAAkB,EAAE,GAAG,EACvB,iBAAiB,EAAE,IAAI,EACvB,mBAAmB,EAAE,GAAG,EACxB,kBAAkB,EAAE,SAAS,EAC7B,uBAAuB,EAAE,SAAS,EAClC,uBAAuB,EAAE,SAAS;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shaders.js","sources":["../../../src/components/leaflet-flow-map/shaders.ts"],"sourcesContent":["export const vertex = `\nattribute float size;\nattribute vec4 customColor;\nvarying vec4 vColor;\nvoid main() {\n vColor = customColor;\n vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n gl_PointSize = size * 2.0;\n gl_Position = projectionMatrix * mvPosition;\n}\n`\nexport const fragment = `\nuniform vec3 color;\nvarying vec4 vColor;\nvoid main() {\n // if ( length( gl_PointCoord - vec2( 0.5, 0.5 ) ) > 0.475 ) discard;\n // gl_FragColor = vec4(color * vColor.rgb, vColor.a);\n vec2 cxy = 2.0 * gl_PointCoord - 1.0;\n float r = dot(cxy, cxy);\n\n float opacity = 1.0 - smoothstep(0.7, 1.0, r);\n gl_FragColor = vec4(color * vColor.rgb, vColor.a * opacity);\n}\n`\n"],"names":[],"mappings":"AAAa,MAAA,MAAM,GAAG
|
|
1
|
+
{"version":3,"file":"shaders.js","sources":["../../../src/components/leaflet-flow-map/shaders.ts"],"sourcesContent":["export const vertex = `\nattribute float size;\nattribute vec4 customColor;\nvarying vec4 vColor;\nvoid main() {\n vColor = customColor;\n vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n gl_PointSize = size * 2.0;\n gl_Position = projectionMatrix * mvPosition;\n}\n`\nexport const fragment = `\nuniform vec3 color;\nvarying vec4 vColor;\nvoid main() {\n // if ( length( gl_PointCoord - vec2( 0.5, 0.5 ) ) > 0.475 ) discard;\n // gl_FragColor = vec4(color * vColor.rgb, vColor.a);\n vec2 cxy = 2.0 * gl_PointCoord - 1.0;\n float r = dot(cxy, cxy);\n\n float opacity = 1.0 - smoothstep(0.7, 1.0, r);\n gl_FragColor = vec4(color * vColor.rgb, vColor.a * opacity);\n}\n`\n"],"names":[],"mappings":"AAAa,MAAA,MAAM,GAAG;;;;;;;;;;EAUrB;AACY,MAAA,QAAQ,GAAG;;;;;;;;;;;;;;;;"}
|
|
@@ -2,6 +2,7 @@ import { ComponentDefaultConfig } from '../../core/component/config.js';
|
|
|
2
2
|
import { LeafletMapRenderer } from './types.js';
|
|
3
3
|
|
|
4
4
|
/* eslint-disable no-irregular-whitespace */
|
|
5
|
+
// Core
|
|
5
6
|
const LeafletMapDefaultConfig = Object.assign(Object.assign({}, ComponentDefaultConfig), {
|
|
6
7
|
// General
|
|
7
8
|
width: undefined, height: undefined, flyToDuration: 1500, fitViewPadding: [150, 150], zoomDuration: 800, initialBounds: undefined, fitBoundsOnUpdate: undefined, fitViewOnInit: true, fitViewOnUpdate: false, attribution: ['<a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap contributors</a>'], accessToken: '', style: undefined, styleDarkTheme: undefined, renderer: LeafletMapRenderer.MapLibre,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sources":["../../../src/components/leaflet-map/config.ts"],"sourcesContent":["/* eslint-disable no-irregular-whitespace */\n\n// Core\nimport { ComponentDefaultConfig, ComponentConfigInterface } from 'core/component/config'\nimport { Tooltip } from 'components/tooltip'\n\n// Types\nimport { ColorAccessor, GenericAccessor, NumericAccessor, StringAccessor } from 'types/accessor'\nimport { GenericDataRecord } from 'types/data'\n\n// Local Types\nimport {\n Bounds,\n LeafletMapPointStyles,\n MapZoomState,\n LeafletMapPointDatum,\n LeafletMapPointShape,\n LeafletMapClusterDatum,\n LeafletMapRenderer,\n} from './types'\n\n// Renderer settings\nimport { MapLibreStyleSpecs } from './renderer/map-style'\n\nexport interface LeafletMapConfigInterface<Datum extends GenericDataRecord> extends ComponentConfigInterface {\n // General\n /** Width in pixels or in CSS units. By default, the map will automatically fit to the size of the parent element. Default: `undefined`. */\n width?: number | string;\n /** Height in pixels or in CSS units. By default, the map will automatically fit to the size of the parent element. Default: `undefined`. */\n height?: number | string;\n /** Animation duration when the map is automatically panning or zooming to a point or area. Default: `1500` ms */\n flyToDuration?: number;\n /** Padding to be used when the `fitView` function has been called. The value is in pixels, [topLeft, bottomRight]. Default: `[150, 150]` */\n fitViewPadding?: [number, number];\n /** Animation duration for the `setZoom` function. Default: `800` ms */\n zoomDuration?: number;\n /** Default bounds that will be applied on the first map render if the bounds property is not set. Default: `undefined` */\n initialBounds?: Bounds;\n /** Force set map bounds on config and data updates. Default: `undefined` */\n fitBoundsOnUpdate?: Bounds;\n /** Fit the view to contain the data points on map initialization. Default: `true` */\n fitViewOnInit?: boolean;\n /** Fit the view to contain the data points on map config and data updates. Default: `false` */\n fitViewOnUpdate?: boolean;\n /** MapLibre `StyleSpecification` settings, or a URL to it. When renderer is set to`LeafletMapRenderer.Raster`, provide a template URL. Default: `undefined` */\n style: MapLibreStyleSpecs | string | undefined;\n /** MapLibre `StyleSpecification` settings or URL for dark theme. Default: `undefined` */\n styleDarkTheme?: MapLibreStyleSpecs | string | undefined;\n /** Tile server access token or API key. Default: `''` */\n accessToken?: string;\n /** Array of attribution labels. Default: `['<a href=\"https://www.openstreetmap.org/copyright\" target=\"_blank\">OpenStreetMap contributors</a>']` */\n attribution?: string[];\n /** Rendering mode for map's tile layer. For raster files, use `LeafletMapRenderer.Raster`. Default: `LeafletMapRenderer.MapLibre` */\n renderer?: LeafletMapRenderer | string;\n\n // Map events\n /** Function to be called after the map's async initialization is done. Default: `undefined` */\n onMapInitialized?: (() => void);\n /** Map Move / Zoom unified callback function. Default: `undefined` */\n onMapMoveZoom?: (({ mapCenter, zoomLevel, bounds }: MapZoomState) => void);\n /** Map Move Start callback function. Default: `undefined` */\n onMapMoveStart?: (({ mapCenter, zoomLevel, bounds }: MapZoomState) => void);\n /** Map Move End callback function. Default: `undefined` */\n onMapMoveEnd?: (({ mapCenter, zoomLevel, bounds }: MapZoomState) => void);\n /** Map Zoom Start callback function. Default: `undefined` */\n onMapZoomStart?: (({ mapCenter, zoomLevel, bounds }: MapZoomState) => void);\n /** Map Zoom End callback function. Default: `undefined` */\n onMapZoomEnd?: (({ mapCenter, zoomLevel, bounds }: MapZoomState) => void);\n /** Map Zoom Click callback function. Default: `undefined` */\n onMapClick?: (({ mapCenter, zoomLevel, bounds }: MapZoomState) => void);\n\n // Point\n /** Point longitude accessor function. Default: `d => d.longitude` */\n pointLongitude?: NumericAccessor<Datum>;\n /** Point latitude accessor function. Default: `d => d.latitude` */\n pointLatitude?: NumericAccessor<Datum>;\n /** Point id accessor function or constant value. Default: `d => d.id` */\n pointId?: StringAccessor<Datum>;\n /** Point shape accessor function or constant value. Default: `d => d.shape` */\n pointShape?: GenericAccessor<LeafletMapPointShape | string, Datum>;\n /** Point color accessor function or constant value. Default: `d => d.color` */\n pointColor?: ColorAccessor<LeafletMapPointDatum<Datum>>;\n /** Point radius accessor function or constant value. Default: `undefined` */\n pointRadius?: NumericAccessor<LeafletMapPointDatum<Datum>>;\n /** Point inner label accessor function. Default: `undefined` */\n pointLabel?: StringAccessor<LeafletMapPointDatum<Datum>>;\n /** Point inner label color accessor function or constant value.\n * By default, the label color will be set, depending on the point brightness, either to\n * `--vis-map-point-inner-label-text-color-light` or to `--vis-map-point-inner-label-text-color-dark` CSS variable.\n * Default: `undefined`\n */\n pointLabelColor?: StringAccessor<LeafletMapPointDatum<Datum>>;\n /** Point bottom label accessor function. Default: `''` */\n pointBottomLabel?: StringAccessor<LeafletMapPointDatum<Datum>>;\n /** Point cursor value or accessor function. Default: `null` */\n pointCursor?: StringAccessor<LeafletMapPointDatum<Datum>>;\n /** The width of the ring when a point has a `LeafletMapPointShape.Ring` shape. Default: `1.25` */\n pointRingWidth?: number;\n /** Set selected point by its unique id. Default: `undefined` */\n selectedPointId?: string;\n\n // Cluster\n /** Cluster color accessor function or constant value. Default: `undefined` */\n clusterColor?: ColorAccessor<LeafletMapClusterDatum<Datum>>;\n /** Cluster radius accessor function or constant value. Default: `undefined` */\n clusterRadius?: NumericAccessor<LeafletMapClusterDatum<Datum>>;\n /** Cluster inner label accessor function. Default: `d => d.point_count` */\n clusterLabel?: StringAccessor<LeafletMapClusterDatum<Datum>>;\n /** Cluster inner label color accessor function or constant value.\n * By default, the label color will be set, depending on the point brightness, either to\n * `--vis-map-cluster-inner-label-text-color-light` or to `--vis-map-cluster-inner-label-text-color-dark` CSS variable.\n * Default: `undefined`\n */\n clusterLabelColor?: StringAccessor<LeafletMapClusterDatum<Datum>>;\n /** Cluster bottom label accessor function. Default: `''` */\n clusterBottomLabel?: StringAccessor<LeafletMapClusterDatum<Datum>>;\n /** The width of the cluster point ring. Default: `1.25` */\n clusterRingWidth?: number;\n /** When cluster is expanded, show a background circle to better separate points from the base map. Default: `true` */\n clusterBackground?: boolean;\n /** Defines whether the cluster should expand on click or not. Default: `true` */\n clusterExpandOnClick?: boolean;\n /** Clustering distance in pixels. This value will be passed to Supercluster as the `radius` property https://github.com/mapbox/supercluster. Default: `55` */\n clusteringDistance?: number;\n /** A single map point can have multiple properties displayed as a small pie chart (or a donut chart for a cluster of points).\n * By setting the colorMap configuration you can specify data properties that should be mapped to various pie / donut segments.\n *\n * ```\n * {\n * [key in keyof Datum]?: { color: string, className?: string }\n * }\n * ```\n * e.g.:\n * ```\n * {\n * healthy: { color: 'green' },\n * warning: { color: 'orange' },\n * danger: { color: 'red' }\n * }\n * ```\n * where every data point has the `healthy`, `warning` and `danger` numerical or boolean property.\n */\n colorMap?: LeafletMapPointStyles<Datum>;\n\n // TopoJSON overlay\n /** A TopoJSON Geometry layer to be displayed on top of the map. Supports fill and stroke */\n topoJSONLayer?: {\n /** The TopoJSON.Topology object. Default: `undefined` */\n sources: any;\n /** Name of the geometry feature to be displayed. Default: `undefined` */\n featureName?: string;\n /** Name of the property to be used for defining the fill color of the geometry. Default: `undefined` */\n fillProperty?: string;\n /** Name of the property to be used for defining the stroke color of the geometry. Default: `undefined` */\n strokeProperty?: string;\n /** Geometry fill opacity value. Default: `0.6` */\n fillOpacity?: number;\n /** Geometry stroke opacity value. Default: `0.8` */\n strokeOpacity?: number;\n /** Geometry stroke width. Default: `2` */\n strokeWidth?: number;\n };\n\n // Misc\n /** Tooltip component. Default: `undefined` */\n tooltip?: Tooltip;\n\n /** Alternative text description of the chart for accessibility purposes. It will be applied as an\n * `aria-label` attribute to the div element containing your chart. Default: `undefined`.\n */\n ariaLabel?: string | null | undefined;\n}\n\nexport const LeafletMapDefaultConfig: LeafletMapConfigInterface<GenericDataRecord> = {\n ...ComponentDefaultConfig,\n // General\n width: undefined,\n height: undefined,\n flyToDuration: 1500,\n fitViewPadding: [150, 150],\n zoomDuration: 800,\n initialBounds: undefined,\n fitBoundsOnUpdate: undefined,\n fitViewOnInit: true,\n fitViewOnUpdate: false,\n attribution: ['<a href=\"https://www.openstreetmap.org/copyright\" target=\"_blank\">OpenStreetMap contributors</a>'],\n accessToken: '',\n style: undefined,\n styleDarkTheme: undefined,\n renderer: LeafletMapRenderer.MapLibre,\n\n // Map events\n onMapInitialized: undefined,\n onMapMoveZoom: undefined,\n onMapMoveStart: undefined,\n onMapMoveEnd: undefined,\n onMapZoomStart: undefined,\n onMapZoomEnd: undefined,\n onMapClick: undefined,\n\n // Point\n pointLongitude: (d: unknown): number => (d as { longitude: number }).longitude,\n pointLatitude: (d: unknown): number => (d as { latitude: number }).latitude,\n pointId: (d: unknown): string => (d as { id: string }).id,\n pointShape: (d: unknown): string => (d as { shape: string }).shape,\n pointColor: (d: unknown): string => (d as { color: string }).color,\n pointRadius: undefined,\n pointLabel: undefined,\n pointLabelColor: undefined,\n pointBottomLabel: '',\n pointCursor: null,\n pointRingWidth: 1.25,\n selectedPointId: undefined,\n\n // Cluster\n clusterColor: undefined,\n clusterRadius: undefined,\n clusterLabel: <Datum extends GenericDataRecord>(d: LeafletMapClusterDatum<Datum>): string => `${d.point_count}`,\n clusterLabelColor: undefined,\n clusterBottomLabel: '',\n clusterRingWidth: 1.25,\n clusterBackground: true,\n clusterExpandOnClick: true,\n clusteringDistance: 55,\n colorMap: {},\n\n // TopoJSON Overlay\n topoJSONLayer: {\n sources: undefined,\n fillOpacity: 0.6,\n strokeOpacity: 0.8,\n strokeWidth: 1,\n featureName: undefined,\n fillProperty: undefined,\n strokeProperty: undefined,\n },\n\n // Misc\n tooltip: undefined,\n ariaLabel: undefined,\n}\n"],"names":[],"mappings":";;;AAAA;AA6KO,MAAM,uBAAuB,GAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAC/B,sBAAsB,CAAA,EAAA;;AAEzB,IAAA,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,SAAS,EACjB,aAAa,EAAE,IAAI,EACnB,cAAc,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,EAC1B,YAAY,EAAE,GAAG,EACjB,aAAa,EAAE,SAAS,EACxB,iBAAiB,EAAE,SAAS,EAC5B,aAAa,EAAE,IAAI,EACnB,eAAe,EAAE,KAAK,EACtB,WAAW,EAAE,CAAC,kGAAkG,CAAC,EACjH,WAAW,EAAE,EAAE,EACf,KAAK,EAAE,SAAS,EAChB,cAAc,EAAE,SAAS,EACzB,QAAQ,EAAE,kBAAkB,CAAC,QAAQ;;IAGrC,gBAAgB,EAAE,SAAS,EAC3B,aAAa,EAAE,SAAS,EACxB,cAAc,EAAE,SAAS,EACzB,YAAY,EAAE,SAAS,EACvB,cAAc,EAAE,SAAS,EACzB,YAAY,EAAE,SAAS,EACvB,UAAU,EAAE,SAAS;;AAGrB,IAAA,cAAc,EAAE,CAAC,CAAU,KAAc,CAA2B,CAAC,SAAS,EAC9E,aAAa,EAAE,CAAC,CAAU,KAAc,CAA0B,CAAC,QAAQ,EAC3E,OAAO,EAAE,CAAC,CAAU,KAAc,CAAoB,CAAC,EAAE,EACzD,UAAU,EAAE,CAAC,CAAU,KAAc,CAAuB,CAAC,KAAK,EAClE,UAAU,EAAE,CAAC,CAAU,KAAc,CAAuB,CAAC,KAAK,EAClE,WAAW,EAAE,SAAS,EACtB,UAAU,EAAE,SAAS,EACrB,eAAe,EAAE,SAAS,EAC1B,gBAAgB,EAAE,EAAE,EACpB,WAAW,EAAE,IAAI,EACjB,cAAc,EAAE,IAAI,EACpB,eAAe,EAAE,SAAS;;IAG1B,YAAY,EAAE,SAAS,EACvB,aAAa,EAAE,SAAS,EACxB,YAAY,EAAE,CAAkC,CAAgC,KAAa,CAAG,EAAA,CAAC,CAAC,WAAW,CAAA,CAAE,EAC/G,iBAAiB,EAAE,SAAS,EAC5B,kBAAkB,EAAE,EAAE,EACtB,gBAAgB,EAAE,IAAI,EACtB,iBAAiB,EAAE,IAAI,EACvB,oBAAoB,EAAE,IAAI,EAC1B,kBAAkB,EAAE,EAAE,EACtB,QAAQ,EAAE,EAAE;;AAGZ,IAAA,aAAa,EAAE;AACb,QAAA,OAAO,EAAE,SAAS;AAClB,QAAA,WAAW,EAAE,GAAG;AAChB,QAAA,aAAa,EAAE,GAAG;AAClB,QAAA,WAAW,EAAE,CAAC;AACd,QAAA,WAAW,EAAE,SAAS;AACtB,QAAA,YAAY,EAAE,SAAS;AACvB,QAAA,cAAc,EAAE,SAAS;AAC1B,KAAA;;AAGD,IAAA,OAAO,EAAE,SAAS,EAClB,SAAS,EAAE,SAAS;;;;"}
|
|
1
|
+
{"version":3,"file":"config.js","sources":["../../../src/components/leaflet-map/config.ts"],"sourcesContent":["/* eslint-disable no-irregular-whitespace */\n\n// Core\nimport { ComponentDefaultConfig, ComponentConfigInterface } from 'core/component/config'\nimport { Tooltip } from 'components/tooltip'\n\n// Types\nimport { ColorAccessor, GenericAccessor, NumericAccessor, StringAccessor } from 'types/accessor'\nimport { GenericDataRecord } from 'types/data'\n\n// Local Types\nimport {\n Bounds,\n LeafletMapPointStyles,\n MapZoomState,\n LeafletMapPointDatum,\n LeafletMapPointShape,\n LeafletMapClusterDatum,\n LeafletMapRenderer,\n} from './types'\n\n// Renderer settings\nimport { MapLibreStyleSpecs } from './renderer/map-style'\n\nexport interface LeafletMapConfigInterface<Datum extends GenericDataRecord> extends ComponentConfigInterface {\n // General\n /** Width in pixels or in CSS units. By default, the map will automatically fit to the size of the parent element. Default: `undefined`. */\n width?: number | string;\n /** Height in pixels or in CSS units. By default, the map will automatically fit to the size of the parent element. Default: `undefined`. */\n height?: number | string;\n /** Animation duration when the map is automatically panning or zooming to a point or area. Default: `1500` ms */\n flyToDuration?: number;\n /** Padding to be used when the `fitView` function has been called. The value is in pixels, [topLeft, bottomRight]. Default: `[150, 150]` */\n fitViewPadding?: [number, number];\n /** Animation duration for the `setZoom` function. Default: `800` ms */\n zoomDuration?: number;\n /** Default bounds that will be applied on the first map render if the bounds property is not set. Default: `undefined` */\n initialBounds?: Bounds;\n /** Force set map bounds on config and data updates. Default: `undefined` */\n fitBoundsOnUpdate?: Bounds;\n /** Fit the view to contain the data points on map initialization. Default: `true` */\n fitViewOnInit?: boolean;\n /** Fit the view to contain the data points on map config and data updates. Default: `false` */\n fitViewOnUpdate?: boolean;\n /** MapLibre `StyleSpecification` settings, or a URL to it. When renderer is set to`LeafletMapRenderer.Raster`, provide a template URL. Default: `undefined` */\n style: MapLibreStyleSpecs | string | undefined;\n /** MapLibre `StyleSpecification` settings or URL for dark theme. Default: `undefined` */\n styleDarkTheme?: MapLibreStyleSpecs | string | undefined;\n /** Tile server access token or API key. Default: `''` */\n accessToken?: string;\n /** Array of attribution labels. Default: `['<a href=\"https://www.openstreetmap.org/copyright\" target=\"_blank\">OpenStreetMap contributors</a>']` */\n attribution?: string[];\n /** Rendering mode for map's tile layer. For raster files, use `LeafletMapRenderer.Raster`. Default: `LeafletMapRenderer.MapLibre` */\n renderer?: LeafletMapRenderer | string;\n\n // Map events\n /** Function to be called after the map's async initialization is done. Default: `undefined` */\n onMapInitialized?: (() => void);\n /** Map Move / Zoom unified callback function. Default: `undefined` */\n onMapMoveZoom?: (({ mapCenter, zoomLevel, bounds }: MapZoomState) => void);\n /** Map Move Start callback function. Default: `undefined` */\n onMapMoveStart?: (({ mapCenter, zoomLevel, bounds }: MapZoomState) => void);\n /** Map Move End callback function. Default: `undefined` */\n onMapMoveEnd?: (({ mapCenter, zoomLevel, bounds }: MapZoomState) => void);\n /** Map Zoom Start callback function. Default: `undefined` */\n onMapZoomStart?: (({ mapCenter, zoomLevel, bounds }: MapZoomState) => void);\n /** Map Zoom End callback function. Default: `undefined` */\n onMapZoomEnd?: (({ mapCenter, zoomLevel, bounds }: MapZoomState) => void);\n /** Map Zoom Click callback function. Default: `undefined` */\n onMapClick?: (({ mapCenter, zoomLevel, bounds }: MapZoomState) => void);\n\n // Point\n /** Point longitude accessor function. Default: `d => d.longitude` */\n pointLongitude?: NumericAccessor<Datum>;\n /** Point latitude accessor function. Default: `d => d.latitude` */\n pointLatitude?: NumericAccessor<Datum>;\n /** Point id accessor function or constant value. Default: `d => d.id` */\n pointId?: StringAccessor<Datum>;\n /** Point shape accessor function or constant value. Default: `d => d.shape` */\n pointShape?: GenericAccessor<LeafletMapPointShape | string, Datum>;\n /** Point color accessor function or constant value. Default: `d => d.color` */\n pointColor?: ColorAccessor<LeafletMapPointDatum<Datum>>;\n /** Point radius accessor function or constant value. Default: `undefined` */\n pointRadius?: NumericAccessor<LeafletMapPointDatum<Datum>>;\n /** Point inner label accessor function. Default: `undefined` */\n pointLabel?: StringAccessor<LeafletMapPointDatum<Datum>>;\n /** Point inner label color accessor function or constant value.\n * By default, the label color will be set, depending on the point brightness, either to\n * `--vis-map-point-inner-label-text-color-light` or to `--vis-map-point-inner-label-text-color-dark` CSS variable.\n * Default: `undefined`\n */\n pointLabelColor?: StringAccessor<LeafletMapPointDatum<Datum>>;\n /** Point bottom label accessor function. Default: `''` */\n pointBottomLabel?: StringAccessor<LeafletMapPointDatum<Datum>>;\n /** Point cursor value or accessor function. Default: `null` */\n pointCursor?: StringAccessor<LeafletMapPointDatum<Datum>>;\n /** The width of the ring when a point has a `LeafletMapPointShape.Ring` shape. Default: `1.25` */\n pointRingWidth?: number;\n /** Set selected point by its unique id. Default: `undefined` */\n selectedPointId?: string;\n\n // Cluster\n /** Cluster color accessor function or constant value. Default: `undefined` */\n clusterColor?: ColorAccessor<LeafletMapClusterDatum<Datum>>;\n /** Cluster radius accessor function or constant value. Default: `undefined` */\n clusterRadius?: NumericAccessor<LeafletMapClusterDatum<Datum>>;\n /** Cluster inner label accessor function. Default: `d => d.point_count` */\n clusterLabel?: StringAccessor<LeafletMapClusterDatum<Datum>>;\n /** Cluster inner label color accessor function or constant value.\n * By default, the label color will be set, depending on the point brightness, either to\n * `--vis-map-cluster-inner-label-text-color-light` or to `--vis-map-cluster-inner-label-text-color-dark` CSS variable.\n * Default: `undefined`\n */\n clusterLabelColor?: StringAccessor<LeafletMapClusterDatum<Datum>>;\n /** Cluster bottom label accessor function. Default: `''` */\n clusterBottomLabel?: StringAccessor<LeafletMapClusterDatum<Datum>>;\n /** The width of the cluster point ring. Default: `1.25` */\n clusterRingWidth?: number;\n /** When cluster is expanded, show a background circle to better separate points from the base map. Default: `true` */\n clusterBackground?: boolean;\n /** Defines whether the cluster should expand on click or not. Default: `true` */\n clusterExpandOnClick?: boolean;\n /** Clustering distance in pixels. This value will be passed to Supercluster as the `radius` property https://github.com/mapbox/supercluster. Default: `55` */\n clusteringDistance?: number;\n /** A single map point can have multiple properties displayed as a small pie chart (or a donut chart for a cluster of points).\n * By setting the colorMap configuration you can specify data properties that should be mapped to various pie / donut segments.\n *\n * ```\n * {\n * [key in keyof Datum]?: { color: string, className?: string }\n * }\n * ```\n * e.g.:\n * ```\n * {\n * healthy: { color: 'green' },\n * warning: { color: 'orange' },\n * danger: { color: 'red' }\n * }\n * ```\n * where every data point has the `healthy`, `warning` and `danger` numerical or boolean property.\n */\n colorMap?: LeafletMapPointStyles<Datum>;\n\n // TopoJSON overlay\n /** A TopoJSON Geometry layer to be displayed on top of the map. Supports fill and stroke */\n topoJSONLayer?: {\n /** The TopoJSON.Topology object. Default: `undefined` */\n sources: any;\n /** Name of the geometry feature to be displayed. Default: `undefined` */\n featureName?: string;\n /** Name of the property to be used for defining the fill color of the geometry. Default: `undefined` */\n fillProperty?: string;\n /** Name of the property to be used for defining the stroke color of the geometry. Default: `undefined` */\n strokeProperty?: string;\n /** Geometry fill opacity value. Default: `0.6` */\n fillOpacity?: number;\n /** Geometry stroke opacity value. Default: `0.8` */\n strokeOpacity?: number;\n /** Geometry stroke width. Default: `2` */\n strokeWidth?: number;\n };\n\n // Misc\n /** Tooltip component. Default: `undefined` */\n tooltip?: Tooltip;\n\n /** Alternative text description of the chart for accessibility purposes. It will be applied as an\n * `aria-label` attribute to the div element containing your chart. Default: `undefined`.\n */\n ariaLabel?: string | null | undefined;\n}\n\nexport const LeafletMapDefaultConfig: LeafletMapConfigInterface<GenericDataRecord> = {\n ...ComponentDefaultConfig,\n // General\n width: undefined,\n height: undefined,\n flyToDuration: 1500,\n fitViewPadding: [150, 150],\n zoomDuration: 800,\n initialBounds: undefined,\n fitBoundsOnUpdate: undefined,\n fitViewOnInit: true,\n fitViewOnUpdate: false,\n attribution: ['<a href=\"https://www.openstreetmap.org/copyright\" target=\"_blank\">OpenStreetMap contributors</a>'],\n accessToken: '',\n style: undefined,\n styleDarkTheme: undefined,\n renderer: LeafletMapRenderer.MapLibre,\n\n // Map events\n onMapInitialized: undefined,\n onMapMoveZoom: undefined,\n onMapMoveStart: undefined,\n onMapMoveEnd: undefined,\n onMapZoomStart: undefined,\n onMapZoomEnd: undefined,\n onMapClick: undefined,\n\n // Point\n pointLongitude: (d: unknown): number => (d as { longitude: number }).longitude,\n pointLatitude: (d: unknown): number => (d as { latitude: number }).latitude,\n pointId: (d: unknown): string => (d as { id: string }).id,\n pointShape: (d: unknown): string => (d as { shape: string }).shape,\n pointColor: (d: unknown): string => (d as { color: string }).color,\n pointRadius: undefined,\n pointLabel: undefined,\n pointLabelColor: undefined,\n pointBottomLabel: '',\n pointCursor: null,\n pointRingWidth: 1.25,\n selectedPointId: undefined,\n\n // Cluster\n clusterColor: undefined,\n clusterRadius: undefined,\n clusterLabel: <Datum extends GenericDataRecord>(d: LeafletMapClusterDatum<Datum>): string => `${d.point_count}`,\n clusterLabelColor: undefined,\n clusterBottomLabel: '',\n clusterRingWidth: 1.25,\n clusterBackground: true,\n clusterExpandOnClick: true,\n clusteringDistance: 55,\n colorMap: {},\n\n // TopoJSON Overlay\n topoJSONLayer: {\n sources: undefined,\n fillOpacity: 0.6,\n strokeOpacity: 0.8,\n strokeWidth: 1,\n featureName: undefined,\n fillProperty: undefined,\n strokeProperty: undefined,\n },\n\n // Misc\n tooltip: undefined,\n ariaLabel: undefined,\n}\n"],"names":[],"mappings":";;;AAAA;AAEA;AA2KO,MAAM,uBAAuB,GAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAC/B,sBAAsB,CAAA,EAAA;;AAEzB,IAAA,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,SAAS,EACjB,aAAa,EAAE,IAAI,EACnB,cAAc,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,EAC1B,YAAY,EAAE,GAAG,EACjB,aAAa,EAAE,SAAS,EACxB,iBAAiB,EAAE,SAAS,EAC5B,aAAa,EAAE,IAAI,EACnB,eAAe,EAAE,KAAK,EACtB,WAAW,EAAE,CAAC,kGAAkG,CAAC,EACjH,WAAW,EAAE,EAAE,EACf,KAAK,EAAE,SAAS,EAChB,cAAc,EAAE,SAAS,EACzB,QAAQ,EAAE,kBAAkB,CAAC,QAAQ;;IAGrC,gBAAgB,EAAE,SAAS,EAC3B,aAAa,EAAE,SAAS,EACxB,cAAc,EAAE,SAAS,EACzB,YAAY,EAAE,SAAS,EACvB,cAAc,EAAE,SAAS,EACzB,YAAY,EAAE,SAAS,EACvB,UAAU,EAAE,SAAS;;AAGrB,IAAA,cAAc,EAAE,CAAC,CAAU,KAAc,CAA2B,CAAC,SAAS,EAC9E,aAAa,EAAE,CAAC,CAAU,KAAc,CAA0B,CAAC,QAAQ,EAC3E,OAAO,EAAE,CAAC,CAAU,KAAc,CAAoB,CAAC,EAAE,EACzD,UAAU,EAAE,CAAC,CAAU,KAAc,CAAuB,CAAC,KAAK,EAClE,UAAU,EAAE,CAAC,CAAU,KAAc,CAAuB,CAAC,KAAK,EAClE,WAAW,EAAE,SAAS,EACtB,UAAU,EAAE,SAAS,EACrB,eAAe,EAAE,SAAS,EAC1B,gBAAgB,EAAE,EAAE,EACpB,WAAW,EAAE,IAAI,EACjB,cAAc,EAAE,IAAI,EACpB,eAAe,EAAE,SAAS;;IAG1B,YAAY,EAAE,SAAS,EACvB,aAAa,EAAE,SAAS,EACxB,YAAY,EAAE,CAAkC,CAAgC,KAAa,CAAG,EAAA,CAAC,CAAC,WAAW,CAAA,CAAE,EAC/G,iBAAiB,EAAE,SAAS,EAC5B,kBAAkB,EAAE,EAAE,EACtB,gBAAgB,EAAE,IAAI,EACtB,iBAAiB,EAAE,IAAI,EACvB,oBAAoB,EAAE,IAAI,EAC1B,kBAAkB,EAAE,EAAE,EACtB,QAAQ,EAAE,EAAE;;AAGZ,IAAA,aAAa,EAAE;AACb,QAAA,OAAO,EAAE,SAAS;AAClB,QAAA,WAAW,EAAE,GAAG;AAChB,QAAA,aAAa,EAAE,GAAG;AAClB,QAAA,WAAW,EAAE,CAAC;AACd,QAAA,WAAW,EAAE,SAAS;AACtB,QAAA,YAAY,EAAE,SAAS;AACvB,QAAA,cAAc,EAAE,SAAS;AAC1B,KAAA;;AAGD,IAAA,OAAO,EAAE,SAAS,EAClB,SAAS,EAAE,SAAS;;;;"}
|
|
@@ -76,10 +76,10 @@ function updateTopoJson(maplibreMap, config) {
|
|
|
76
76
|
function setupMap(mapContainer, config) {
|
|
77
77
|
var _a, _b;
|
|
78
78
|
return __awaiter(this, void 0, void 0, function* () {
|
|
79
|
-
const { style, renderer, topoJSONLayer } = config;
|
|
79
|
+
const { style: style$1, renderer, topoJSONLayer } = config;
|
|
80
80
|
const leaflet = yield import('leaflet');
|
|
81
81
|
const L = leaflet.default;
|
|
82
|
-
if (!style) {
|
|
82
|
+
if (!style$1) {
|
|
83
83
|
console.error('Unovis | Leaflet Map: Please provide style settings in the map configuration object');
|
|
84
84
|
return;
|
|
85
85
|
}
|
|
@@ -116,7 +116,7 @@ function setupMap(mapContainer, config) {
|
|
|
116
116
|
});
|
|
117
117
|
break;
|
|
118
118
|
case LeafletMapRenderer.Raster:
|
|
119
|
-
layer = L.tileLayer(style);
|
|
119
|
+
layer = L.tileLayer(style$1);
|
|
120
120
|
layer.addTo(leafletMap);
|
|
121
121
|
break;
|
|
122
122
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map.js","sources":["../../../../src/components/leaflet-map/modules/map.ts"],"sourcesContent":["import type L from 'leaflet'\nimport { select, Selection } from 'd3-selection'\nimport type { GeoJSONSource, Map } from 'maplibre-gl'\nimport { feature } from 'topojson-client'\n\n// Types\nimport { GenericDataRecord } from 'types/data'\n\n// Config\nimport { LeafletMapConfigInterface } from '../config'\n\n// Local Types\n\n// Utils\nimport { constraintMapView, mapboxglWheelEventThrottled } from '../renderer/mapboxgl-utils'\n\n// Styles\nimport * as s from '../style'\nimport { LeafletMapRenderer } from '../types'\n\nexport const initialMapCenter: L.LatLngExpression = [36, 14]\nexport const initialMapZoom = 1.9\n\nexport function updateTopoJson<T extends GenericDataRecord> (maplibreMap: Map, config: LeafletMapConfigInterface<T>): void {\n const { topoJSONLayer } = config\n\n if (topoJSONLayer.sources) {\n const featureObject = topoJSONLayer.sources?.objects?.[topoJSONLayer.featureName]\n if (featureObject) {\n const mapSource = maplibreMap.getSource(topoJSONLayer.featureName) as GeoJSONSource\n const featureCollection = feature(topoJSONLayer.sources, featureObject)\n if (mapSource) {\n mapSource.setData(featureCollection)\n } else {\n maplibreMap.addSource(topoJSONLayer.featureName, { type: 'geojson', data: featureCollection })\n }\n }\n }\n\n const fillLayer = maplibreMap.getLayer(`${topoJSONLayer.featureName}-area`)\n if (topoJSONLayer.fillProperty) {\n if (!fillLayer) {\n maplibreMap.addLayer({\n id: `${topoJSONLayer.featureName}-area`,\n type: 'fill',\n source: topoJSONLayer.featureName,\n paint: {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n 'fill-antialias': false,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n 'fill-opacity': topoJSONLayer.fillOpacity,\n },\n })\n }\n maplibreMap.setPaintProperty(`${topoJSONLayer.featureName}-area`, 'fill-color', [\n 'case',\n ['!', ['has', topoJSONLayer.fillProperty]],\n 'rgba(255, 255, 255, 0)',\n ['get', topoJSONLayer.fillProperty],\n ])\n } else if (fillLayer) maplibreMap.removeLayer(`${topoJSONLayer.featureName}-area`)\n\n const strokeLayer = maplibreMap.getLayer(`${topoJSONLayer.featureName}-stroke`)\n if (topoJSONLayer.strokeProperty) {\n if (!strokeLayer) {\n maplibreMap.addLayer({\n id: `${topoJSONLayer.featureName}-stroke`,\n type: 'line',\n source: topoJSONLayer.featureName,\n paint: {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n 'line-opacity': topoJSONLayer.strokeOpacity,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n 'line-width': topoJSONLayer.strokeWidth,\n },\n })\n }\n maplibreMap.setPaintProperty(`${topoJSONLayer.featureName}-stroke`, 'line-color', [\n 'case',\n ['!', ['has', topoJSONLayer.strokeProperty]],\n 'rgba(255, 255, 255, 0)',\n ['get', topoJSONLayer.strokeProperty],\n ])\n } else if (strokeLayer) { maplibreMap.removeLayer(`${topoJSONLayer.featureName}-stroke`) }\n}\n\nexport async function setupMap<T extends GenericDataRecord> (mapContainer: HTMLElement, config: LeafletMapConfigInterface<T>): Promise<{\n leaflet: L.Map;\n layer: L.Layer;\n svgOverlay: Selection<SVGSVGElement, unknown, null, undefined>;\n svgGroup: Selection<SVGGElement, unknown, SVGElement, undefined>;\n}> {\n const { style, renderer, topoJSONLayer } = config\n const leaflet = await import('leaflet')\n const L = leaflet.default\n\n if (!style) {\n console.error('Unovis | Leaflet Map: Please provide style settings in the map configuration object')\n return\n }\n\n const leafletMap = L.map(mapContainer, {\n scrollWheelZoom: renderer === LeafletMapRenderer.Raster, // We define custom scroll event for MapboxGL to enabling smooth zooming\n zoomControl: false,\n zoomDelta: renderer === LeafletMapRenderer.Raster ? 1 : 0.5,\n zoomSnap: renderer === LeafletMapRenderer.Raster ? 1 : 0,\n attributionControl: true,\n center: initialMapCenter,\n zoom: initialMapZoom,\n minZoom: Math.sqrt(mapContainer.offsetWidth) / 17,\n maxZoom: 23,\n maxBounds: L.latLngBounds(\n [-75, -290],\n [85, 290]\n ),\n maxBoundsViscosity: 1,\n })\n\n for (const attr of config.attribution) {\n leafletMap.attributionControl.addAttribution(attr)\n }\n\n let layer: L.Layer | (L.Layer & { getMaplibreMap(): Map })\n let maplibreMap: Map = null\n\n switch (renderer) {\n case LeafletMapRenderer.MapLibre:\n // eslint-disable-next-line no-case-declarations\n const maplibre = await import('maplibre-gl')\n // eslint-disable-next-line no-case-declarations\n const { getMaplibreGLLayer } = await import('../renderer/mapboxgl-layer')\n layer = getMaplibreGLLayer(config, L, maplibre.default)\n layer.addTo(leafletMap)\n maplibreMap = (layer as ReturnType<typeof getMaplibreGLLayer>).getMaplibreMap?.()\n\n select(mapContainer).on('wheel', (event: WheelEvent) => {\n event.preventDefault()\n mapboxglWheelEventThrottled(leafletMap, layer as (L.Layer & { getMaplibreMap(): Map }), event)\n })\n break\n case LeafletMapRenderer.Raster:\n layer = L.tileLayer(style as string)\n layer.addTo(leafletMap)\n break\n }\n // leaflet-mapbox-gl has a layer positioning issue on far zoom levels which leads to having wrong\n // map points projection. We constrain the view to prevent that.\n constraintMapView(leafletMap)\n\n if (maplibreMap && topoJSONLayer?.sources) {\n const canvas = maplibreMap.getCanvas()\n const canvasSelection = select(canvas).classed(s.mapboxglCanvas, true)\n const tilePaneSelection = select(leafletMap.getPanes().tilePane)\n\n maplibreMap.on('mousemove', (event) => {\n const layerName = `${topoJSONLayer.featureName}-area`\n const layer = maplibreMap.getLayer(layerName)\n if (!layer) return\n\n const features = maplibreMap.queryRenderedFeatures(event.point, { layers: [layerName] })\n tilePaneSelection.datum(features[0])\n canvasSelection.classed(s.onFeatureHover, Boolean(features[0]))\n })\n\n maplibreMap.on('load', () => {\n updateTopoJson(maplibreMap, config)\n })\n }\n\n const svgOverlay = select(leafletMap.getPanes().overlayPane).append('svg')\n const svgGroup = svgOverlay.append('g')\n\n return {\n leaflet: leafletMap,\n layer,\n svgOverlay,\n svgGroup,\n }\n}\n"],"names":["s.mapboxglCanvas","s.onFeatureHover"],"mappings":";;;;;;;MAoBa,gBAAgB,GAAuB,CAAC,EAAE,EAAE,EAAE,EAAC;AACrD,MAAM,cAAc,GAAG,IAAG;AAEjB,SAAA,cAAc,CAA+B,WAAgB,EAAE,MAAoC,EAAA;;AACjH,IAAA,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,CAAA;IAEhC,IAAI,aAAa,CAAC,OAAO,EAAE;AACzB,QAAA,MAAM,aAAa,GAAG,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,aAAa,CAAC,OAAO,MAAE,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,OAAO,MAAG,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,aAAa,CAAC,WAAW,CAAC,CAAA;AACjF,QAAA,IAAI,aAAa,EAAE;YACjB,MAAM,SAAS,GAAG,WAAW,CAAC,SAAS,CAAC,aAAa,CAAC,WAAW,CAAkB,CAAA;YACnF,MAAM,iBAAiB,GAAG,OAAO,CAAC,aAAa,CAAC,OAAO,EAAE,aAAa,CAAC,CAAA;AACvE,YAAA,IAAI,SAAS,EAAE;AACb,gBAAA,SAAS,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAA;AACrC,aAAA;AAAM,iBAAA;AACL,gBAAA,WAAW,CAAC,SAAS,CAAC,aAAa,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,iBAAiB,EAAE,CAAC,CAAA;AAC/F,aAAA;AACF,S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AAC,CAAC,CAAA;AAEF,YAAA,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAK;AAC1B,gBAAA,cAAc,CAAC,WAAW,EAAE,MAAM,CAAC,CAAA;AACrC,aAAC,CAAC,CAAA;AACH,SAAA;AAED,QAAA,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;QAC1E,MAAM,QAAQ,GAAG,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;QAEvC,OAAO;AACL,YAAA,OAAO,EAAE,UAAU;YACnB,KAAK;YACL,UAAU;YACV,QAAQ;SACT,CAAA;;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"map.js","sources":["../../../../src/components/leaflet-map/modules/map.ts"],"sourcesContent":["import type L from 'leaflet'\nimport { select, Selection } from 'd3-selection'\nimport type { GeoJSONSource, Map } from 'maplibre-gl'\nimport { feature } from 'topojson-client'\n\n// Types\nimport { GenericDataRecord } from 'types/data'\n\n// Config\nimport { LeafletMapConfigInterface } from '../config'\n\n// Local Types\n\n// Utils\nimport { constraintMapView, mapboxglWheelEventThrottled } from '../renderer/mapboxgl-utils'\n\n// Styles\nimport * as s from '../style'\nimport { LeafletMapRenderer } from '../types'\n\nexport const initialMapCenter: L.LatLngExpression = [36, 14]\nexport const initialMapZoom = 1.9\n\nexport function updateTopoJson<T extends GenericDataRecord> (maplibreMap: Map, config: LeafletMapConfigInterface<T>): void {\n const { topoJSONLayer } = config\n\n if (topoJSONLayer.sources) {\n const featureObject = topoJSONLayer.sources?.objects?.[topoJSONLayer.featureName]\n if (featureObject) {\n const mapSource = maplibreMap.getSource(topoJSONLayer.featureName) as GeoJSONSource\n const featureCollection = feature(topoJSONLayer.sources, featureObject)\n if (mapSource) {\n mapSource.setData(featureCollection)\n } else {\n maplibreMap.addSource(topoJSONLayer.featureName, { type: 'geojson', data: featureCollection })\n }\n }\n }\n\n const fillLayer = maplibreMap.getLayer(`${topoJSONLayer.featureName}-area`)\n if (topoJSONLayer.fillProperty) {\n if (!fillLayer) {\n maplibreMap.addLayer({\n id: `${topoJSONLayer.featureName}-area`,\n type: 'fill',\n source: topoJSONLayer.featureName,\n paint: {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n 'fill-antialias': false,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n 'fill-opacity': topoJSONLayer.fillOpacity,\n },\n })\n }\n maplibreMap.setPaintProperty(`${topoJSONLayer.featureName}-area`, 'fill-color', [\n 'case',\n ['!', ['has', topoJSONLayer.fillProperty]],\n 'rgba(255, 255, 255, 0)',\n ['get', topoJSONLayer.fillProperty],\n ])\n } else if (fillLayer) maplibreMap.removeLayer(`${topoJSONLayer.featureName}-area`)\n\n const strokeLayer = maplibreMap.getLayer(`${topoJSONLayer.featureName}-stroke`)\n if (topoJSONLayer.strokeProperty) {\n if (!strokeLayer) {\n maplibreMap.addLayer({\n id: `${topoJSONLayer.featureName}-stroke`,\n type: 'line',\n source: topoJSONLayer.featureName,\n paint: {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n 'line-opacity': topoJSONLayer.strokeOpacity,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n 'line-width': topoJSONLayer.strokeWidth,\n },\n })\n }\n maplibreMap.setPaintProperty(`${topoJSONLayer.featureName}-stroke`, 'line-color', [\n 'case',\n ['!', ['has', topoJSONLayer.strokeProperty]],\n 'rgba(255, 255, 255, 0)',\n ['get', topoJSONLayer.strokeProperty],\n ])\n } else if (strokeLayer) { maplibreMap.removeLayer(`${topoJSONLayer.featureName}-stroke`) }\n}\n\nexport async function setupMap<T extends GenericDataRecord> (mapContainer: HTMLElement, config: LeafletMapConfigInterface<T>): Promise<{\n leaflet: L.Map;\n layer: L.Layer;\n svgOverlay: Selection<SVGSVGElement, unknown, null, undefined>;\n svgGroup: Selection<SVGGElement, unknown, SVGElement, undefined>;\n}> {\n const { style, renderer, topoJSONLayer } = config\n const leaflet = await import('leaflet')\n const L = leaflet.default\n\n if (!style) {\n console.error('Unovis | Leaflet Map: Please provide style settings in the map configuration object')\n return\n }\n\n const leafletMap = L.map(mapContainer, {\n scrollWheelZoom: renderer === LeafletMapRenderer.Raster, // We define custom scroll event for MapboxGL to enabling smooth zooming\n zoomControl: false,\n zoomDelta: renderer === LeafletMapRenderer.Raster ? 1 : 0.5,\n zoomSnap: renderer === LeafletMapRenderer.Raster ? 1 : 0,\n attributionControl: true,\n center: initialMapCenter,\n zoom: initialMapZoom,\n minZoom: Math.sqrt(mapContainer.offsetWidth) / 17,\n maxZoom: 23,\n maxBounds: L.latLngBounds(\n [-75, -290],\n [85, 290]\n ),\n maxBoundsViscosity: 1,\n })\n\n for (const attr of config.attribution) {\n leafletMap.attributionControl.addAttribution(attr)\n }\n\n let layer: L.Layer | (L.Layer & { getMaplibreMap(): Map })\n let maplibreMap: Map = null\n\n switch (renderer) {\n case LeafletMapRenderer.MapLibre:\n // eslint-disable-next-line no-case-declarations\n const maplibre = await import('maplibre-gl')\n // eslint-disable-next-line no-case-declarations\n const { getMaplibreGLLayer } = await import('../renderer/mapboxgl-layer')\n layer = getMaplibreGLLayer(config, L, maplibre.default)\n layer.addTo(leafletMap)\n maplibreMap = (layer as ReturnType<typeof getMaplibreGLLayer>).getMaplibreMap?.()\n\n select(mapContainer).on('wheel', (event: WheelEvent) => {\n event.preventDefault()\n mapboxglWheelEventThrottled(leafletMap, layer as (L.Layer & { getMaplibreMap(): Map }), event)\n })\n break\n case LeafletMapRenderer.Raster:\n layer = L.tileLayer(style as string)\n layer.addTo(leafletMap)\n break\n }\n // leaflet-mapbox-gl has a layer positioning issue on far zoom levels which leads to having wrong\n // map points projection. We constrain the view to prevent that.\n constraintMapView(leafletMap)\n\n if (maplibreMap && topoJSONLayer?.sources) {\n const canvas = maplibreMap.getCanvas()\n const canvasSelection = select(canvas).classed(s.mapboxglCanvas, true)\n const tilePaneSelection = select(leafletMap.getPanes().tilePane)\n\n maplibreMap.on('mousemove', (event) => {\n const layerName = `${topoJSONLayer.featureName}-area`\n const layer = maplibreMap.getLayer(layerName)\n if (!layer) return\n\n const features = maplibreMap.queryRenderedFeatures(event.point, { layers: [layerName] })\n tilePaneSelection.datum(features[0])\n canvasSelection.classed(s.onFeatureHover, Boolean(features[0]))\n })\n\n maplibreMap.on('load', () => {\n updateTopoJson(maplibreMap, config)\n })\n }\n\n const svgOverlay = select(leafletMap.getPanes().overlayPane).append('svg')\n const svgGroup = svgOverlay.append('g')\n\n return {\n leaflet: leafletMap,\n layer,\n svgOverlay,\n svgGroup,\n }\n}\n"],"names":["style","s.mapboxglCanvas","s.onFeatureHover"],"mappings":";;;;;;;MAoBa,gBAAgB,GAAuB,CAAC,EAAE,EAAE,EAAE,EAAC;AACrD,MAAM,cAAc,GAAG,IAAG;AAEjB,SAAA,cAAc,CAA+B,WAAgB,EAAE,MAAoC,EAAA;;AACjH,IAAA,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,CAAA;IAEhC,IAAI,aAAa,CAAC,OAAO,EAAE;AACzB,QAAA,MAAM,aAAa,GAAG,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,aAAa,CAAC,OAAO,MAAE,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,OAAO,MAAG,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,aAAa,CAAC,WAAW,CAAC,CAAA;AACjF,QAAA,IAAI,aAAa,EAAE;YACjB,MAAM,SAAS,GAAG,WAAW,CAAC,SAAS,CAAC,aAAa,CAAC,WAAW,CAAkB,CAAA;YACnF,MAAM,iBAAiB,GAAG,OAAO,CAAC,aAAa,CAAC,OAAO,EAAE,aAAa,CAAC,CAAA;AACvE,YAAA,IAAI,SAAS,EAAE;AACb,gBAAA,SAAS,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAA;AACrC,aAAA;AAAM,iBAAA;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AAQ,CAAC,CAAC,CAAC,CAAC,CAAA;AACpC,gBAAA,eAAe,CAAC,OAAO,CAACC,cAAgB,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AACjE,aAAC,CAAC,CAAA;AAEF,YAAA,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAK;AAC1B,gBAAA,cAAc,CAAC,WAAW,EAAE,MAAM,CAAC,CAAA;AACrC,aAAC,CAAC,CAAA;AACH,SAAA;AAED,QAAA,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;QAC1E,MAAM,QAAQ,GAAG,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;QAEvC,OAAO;AACL,YAAA,OAAO,EAAE,UAAU;YACnB,KAAK;YACL,UAAU;YACV,QAAQ;SACT,CAAA;;AACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"leaflet-maplibre-gl.js","sources":["../../../../src/components/leaflet-map/renderer/leaflet-maplibre-gl.js"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function MaplibreGLLayer (leaflet, maplibre, options) {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n const Layer = leaflet.Layer.extend({\n options: {\n updateInterval: 32,\n // How much to extend the overlay view (relative to map size)\n // e.g. 0.1 would be 10% of map view in each direction\n padding: 0.1,\n // whether or not to register the mouse and keyboard\n // events on the maplibre overlay\n interactive: false,\n // set the tilepane as the default pane to draw gl tiles\n pane: 'tilePane',\n },\n\n initialize: function (options) {\n leaflet.setOptions(this, options)\n\n // setup throttling the update event when panning\n this._throttledUpdate = leaflet.Util.throttle(this._update, this.options.updateInterval, this)\n },\n\n onAdd: function (map) {\n if (!this._container) {\n this._initContainer()\n }\n\n const paneName = this.getPaneName()\n map.getPane(paneName).appendChild(this._container)\n\n this._initGL()\n\n this._offset = this._map.containerPointToLayerPoint([0, 0])\n\n // work around https://github.com/mapbox/mapbox-gl-leaflet/issues/47\n if (map.options.zoomAnimation) {\n leaflet.DomEvent.on(map._proxy, leaflet.DomUtil.TRANSITION_END, this._transitionEnd, this)\n }\n },\n\n onRemove: function (map) {\n if (this._map._proxy && this._map.options.zoomAnimation) {\n leaflet.DomEvent.off(this._map._proxy, leaflet.DomUtil.TRANSITION_END, this._transitionEnd, this)\n }\n const paneName = this.getPaneName()\n map.getPane(paneName).removeChild(this._container)\n\n this._glMap.remove()\n this._glMap = null\n },\n\n getEvents: function () {\n return {\n move: this._throttledUpdate, // sensibly throttle updating while panning\n zoomanim: this._animateZoom, // applys the zoom animation to the <canvas>\n zoom: this._pinchZoom, // animate every zoom event for smoother pinch-zooming\n zoomstart: this._zoomStart, // flag starting a zoom to disable panning\n zoomend: this._zoomEnd,\n resize: this._resize,\n }\n },\n\n getMaplibreMap: function () {\n return this._glMap\n },\n\n getCanvas: function () {\n return this._glMap.getCanvas()\n },\n\n getSize: function () {\n return this._map.getSize().multiplyBy(1 + this.options.padding * 2)\n },\n\n getBounds: function () {\n const halfSize = this.getSize().multiplyBy(0.5)\n const center = this._map.latLngToContainerPoint(this._map.getCenter())\n return leaflet.latLngBounds(\n this._map.containerPointToLatLng(center.subtract(halfSize)),\n this._map.containerPointToLatLng(center.add(halfSize))\n )\n },\n\n getContainer: function () {\n return this._container\n },\n\n // returns the pane name set in options if it is a valid pane, defaults to tilePane\n getPaneName: function () {\n return this._map.getPane(this.options.pane) ? this.options.pane : 'tilePane'\n },\n\n _initContainer: function () {\n const container = this._container = leaflet.DomUtil.create('div', 'leaflet-gl-layer')\n\n const size = this.getSize()\n const offset = this._map.getSize().multiplyBy(this.options.padding)\n container.style.width = `${size.x}px`\n container.style.height = `${size.y}px`\n\n const topLeft = this._map.containerPointToLayerPoint([0, 0]).subtract(offset)\n\n leaflet.DomUtil.setPosition(container, topLeft)\n },\n\n _initGL: function () {\n const center = this._map.getCenter()\n\n const options = leaflet.extend({}, this.options, {\n container: this._container,\n center: [center.lng, center.lat],\n zoom: this._map.getZoom() - 1,\n attributionControl: false,\n })\n\n this._glMap = new maplibre.Map(options)\n\n // allow GL base map to pan beyond min/max latitudes\n this._glMap.transform.latRange = null\n this._glMap.transform.maxValidLatitude = Infinity\n\n this._transformGL(this._glMap)\n\n if (this._glMap._canvas.canvas) {\n // older versions of mapbox-gl surfaced the canvas differently\n this._glMap._actualCanvas = this._glMap._canvas.canvas\n } else {\n this._glMap._actualCanvas = this._glMap._canvas\n }\n\n // treat child <canvas> element like leaflet.ImageOverlay\n const canvas = this._glMap._actualCanvas\n leaflet.DomUtil.addClass(canvas, 'leaflet-image-layer')\n leaflet.DomUtil.addClass(canvas, 'leaflet-zoom-animated')\n if (this.options.interactive) {\n leaflet.DomUtil.addClass(canvas, 'leaflet-interactive')\n }\n if (this.options.className) {\n leaflet.DomUtil.addClass(canvas, this.options.className)\n }\n },\n\n _update: function (e) {\n // update the offset so we can correct for it later when we zoom\n this._offset = this._map.containerPointToLayerPoint([0, 0])\n\n if (this._zooming) {\n return\n }\n\n const size = this.getSize()\n const container = this._container\n const gl = this._glMap\n const offset = this._map.getSize().multiplyBy(this.options.padding)\n const topLeft = this._map.containerPointToLayerPoint([0, 0]).subtract(offset)\n\n leaflet.DomUtil.setPosition(container, topLeft)\n\n this._transformGL(gl)\n\n if (gl.transform.width !== size.x || gl.transform.height !== size.y) {\n container.style.width = `${size.x}px`\n container.style.height = `${size.y}px`\n if (gl._resize !== null && gl._resize !== undefined) {\n gl._resize()\n } else {\n gl.resize()\n }\n } else {\n // older versions of mapbox-gl surfaced update publicly\n if (gl._update !== null && gl._update !== undefined) {\n gl._update()\n } else {\n gl.update()\n }\n }\n },\n\n _transformGL: function (gl) {\n const center = this._map.getCenter()\n\n // gl.setView([center.lat, center.lng], this._map.getZoom() - 1, 0);\n // calling setView directly causes sync issues because it uses requestAnimFrame\n\n const tr = gl.transform\n tr.center = maplibre.LngLat.convert([center.lng, center.lat])\n tr.zoom = this._map.getZoom() - 1\n },\n\n // update the map constantly during a pinch zoom\n _pinchZoom: function (e) {\n this._glMap.jumpTo({\n zoom: this._map.getZoom() - 1,\n center: this._map.getCenter(),\n })\n },\n\n // borrowed from leaflet.ImageOverlay\n // https://github.com/Leaflet/Leaflet/blob/master/src/layer/ImageOverlay.js#L139-L144\n _animateZoom: function (e) {\n const scale = this._map.getZoomScale(e.zoom)\n const padding = this._map.getSize().multiplyBy(this.options.padding * scale)\n const viewHalf = this.getSize()._divideBy(2)\n // corrections for padding (scaled), adapted from\n // https://github.com/Leaflet/Leaflet/blob/master/src/map/Map.js#L1490-L1508\n const topLeft = this._map.project(e.center, e.zoom)\n ._subtract(viewHalf)\n ._add(this._map._getMapPanePos()\n .add(padding))._round()\n const offset = this._map.project(this._map.getBounds().getNorthWest(), e.zoom)\n ._subtract(topLeft)\n\n leaflet.DomUtil.setTransform(\n this._glMap._actualCanvas,\n offset.subtract(this._offset),\n scale\n )\n },\n\n _zoomStart: function (e) {\n this._zooming = true\n },\n\n _zoomEnd: function () {\n const scale = this._map.getZoomScale(this._map.getZoom())\n\n leaflet.DomUtil.setTransform(\n this._glMap._actualCanvas,\n // https://github.com/mapbox/mapbox-gl-leaflet/pull/130\n null,\n scale\n )\n\n this._zooming = false\n\n this._update()\n },\n\n _transitionEnd: function (e) {\n leaflet.Util.requestAnimFrame(function () {\n const zoom = this._map.getZoom()\n const center = this._map.getCenter()\n const offset = this._map.latLngToContainerPoint(\n this._map.getBounds().getNorthWest()\n )\n\n // reset the scale and offset\n leaflet.DomUtil.setTransform(this._glMap._actualCanvas, offset, 1)\n\n // enable panning once the gl map is ready again\n this._glMap.once('moveend', leaflet.Util.bind(function () {\n this._zoomEnd()\n }, this))\n\n // update the map position\n this._glMap.jumpTo({\n center: center,\n zoom: zoom - 1,\n })\n }, this)\n },\n\n _resize: function (e) {\n this._transitionEnd(e)\n },\n })\n\n return new Layer(options)\n}\n\n"],"names":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AC,aAAa,EAAE,MAAM,EAAE,CAAC,EAAC;AAC1E;AACA;AACA,QAAQ,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY;AAClE,UAAU,IAAI,CAAC,QAAQ,GAAE;AACzB,SAAS,EAAE,IAAI,CAAC,EAAC;AACjB;AACA;AACA,QAAQ,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;AAC3B,UAAU,MAAM,EAAE,MAAM;AACxB,UAAU,IAAI,EAAE,IAAI,GAAG,CAAC;AACxB,SAAS,EAAC;AACV,OAAO,EAAE,IAAI,EAAC;AACd,KAAK;AACL;AACA,IAAI,OAAO,EAAE,UAAU,CAAC,EAAE;AAC1B,MAAM,IAAI,CAAC,cAAc,CAAC,CAAC,EAAC;AAC5B,KAAK;AACL,GAAG,EAAC;AACJ;AACA,EAAE,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC;AAC3B;;;;"}
|
|
1
|
+
{"version":3,"file":"leaflet-maplibre-gl.js","sources":["../../../../src/components/leaflet-map/renderer/leaflet-maplibre-gl.js"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function MaplibreGLLayer (leaflet, maplibre, options) {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n const Layer = leaflet.Layer.extend({\n options: {\n updateInterval: 32,\n // How much to extend the overlay view (relative to map size)\n // e.g. 0.1 would be 10% of map view in each direction\n padding: 0.1,\n // whether or not to register the mouse and keyboard\n // events on the maplibre overlay\n interactive: false,\n // set the tilepane as the default pane to draw gl tiles\n pane: 'tilePane',\n },\n\n initialize: function (options) {\n leaflet.setOptions(this, options)\n\n // setup throttling the update event when panning\n this._throttledUpdate = leaflet.Util.throttle(this._update, this.options.updateInterval, this)\n },\n\n onAdd: function (map) {\n if (!this._container) {\n this._initContainer()\n }\n\n const paneName = this.getPaneName()\n map.getPane(paneName).appendChild(this._container)\n\n this._initGL()\n\n this._offset = this._map.containerPointToLayerPoint([0, 0])\n\n // work around https://github.com/mapbox/mapbox-gl-leaflet/issues/47\n if (map.options.zoomAnimation) {\n leaflet.DomEvent.on(map._proxy, leaflet.DomUtil.TRANSITION_END, this._transitionEnd, this)\n }\n },\n\n onRemove: function (map) {\n if (this._map._proxy && this._map.options.zoomAnimation) {\n leaflet.DomEvent.off(this._map._proxy, leaflet.DomUtil.TRANSITION_END, this._transitionEnd, this)\n }\n const paneName = this.getPaneName()\n map.getPane(paneName).removeChild(this._container)\n\n this._glMap.remove()\n this._glMap = null\n },\n\n getEvents: function () {\n return {\n move: this._throttledUpdate, // sensibly throttle updating while panning\n zoomanim: this._animateZoom, // applys the zoom animation to the <canvas>\n zoom: this._pinchZoom, // animate every zoom event for smoother pinch-zooming\n zoomstart: this._zoomStart, // flag starting a zoom to disable panning\n zoomend: this._zoomEnd,\n resize: this._resize,\n }\n },\n\n getMaplibreMap: function () {\n return this._glMap\n },\n\n getCanvas: function () {\n return this._glMap.getCanvas()\n },\n\n getSize: function () {\n return this._map.getSize().multiplyBy(1 + this.options.padding * 2)\n },\n\n getBounds: function () {\n const halfSize = this.getSize().multiplyBy(0.5)\n const center = this._map.latLngToContainerPoint(this._map.getCenter())\n return leaflet.latLngBounds(\n this._map.containerPointToLatLng(center.subtract(halfSize)),\n this._map.containerPointToLatLng(center.add(halfSize))\n )\n },\n\n getContainer: function () {\n return this._container\n },\n\n // returns the pane name set in options if it is a valid pane, defaults to tilePane\n getPaneName: function () {\n return this._map.getPane(this.options.pane) ? this.options.pane : 'tilePane'\n },\n\n _initContainer: function () {\n const container = this._container = leaflet.DomUtil.create('div', 'leaflet-gl-layer')\n\n const size = this.getSize()\n const offset = this._map.getSize().multiplyBy(this.options.padding)\n container.style.width = `${size.x}px`\n container.style.height = `${size.y}px`\n\n const topLeft = this._map.containerPointToLayerPoint([0, 0]).subtract(offset)\n\n leaflet.DomUtil.setPosition(container, topLeft)\n },\n\n _initGL: function () {\n const center = this._map.getCenter()\n\n const options = leaflet.extend({}, this.options, {\n container: this._container,\n center: [center.lng, center.lat],\n zoom: this._map.getZoom() - 1,\n attributionControl: false,\n })\n\n this._glMap = new maplibre.Map(options)\n\n // allow GL base map to pan beyond min/max latitudes\n this._glMap.transform.latRange = null\n this._glMap.transform.maxValidLatitude = Infinity\n\n this._transformGL(this._glMap)\n\n if (this._glMap._canvas.canvas) {\n // older versions of mapbox-gl surfaced the canvas differently\n this._glMap._actualCanvas = this._glMap._canvas.canvas\n } else {\n this._glMap._actualCanvas = this._glMap._canvas\n }\n\n // treat child <canvas> element like leaflet.ImageOverlay\n const canvas = this._glMap._actualCanvas\n leaflet.DomUtil.addClass(canvas, 'leaflet-image-layer')\n leaflet.DomUtil.addClass(canvas, 'leaflet-zoom-animated')\n if (this.options.interactive) {\n leaflet.DomUtil.addClass(canvas, 'leaflet-interactive')\n }\n if (this.options.className) {\n leaflet.DomUtil.addClass(canvas, this.options.className)\n }\n },\n\n _update: function (e) {\n // update the offset so we can correct for it later when we zoom\n this._offset = this._map.containerPointToLayerPoint([0, 0])\n\n if (this._zooming) {\n return\n }\n\n const size = this.getSize()\n const container = this._container\n const gl = this._glMap\n const offset = this._map.getSize().multiplyBy(this.options.padding)\n const topLeft = this._map.containerPointToLayerPoint([0, 0]).subtract(offset)\n\n leaflet.DomUtil.setPosition(container, topLeft)\n\n this._transformGL(gl)\n\n if (gl.transform.width !== size.x || gl.transform.height !== size.y) {\n container.style.width = `${size.x}px`\n container.style.height = `${size.y}px`\n if (gl._resize !== null && gl._resize !== undefined) {\n gl._resize()\n } else {\n gl.resize()\n }\n } else {\n // older versions of mapbox-gl surfaced update publicly\n if (gl._update !== null && gl._update !== undefined) {\n gl._update()\n } else {\n gl.update()\n }\n }\n },\n\n _transformGL: function (gl) {\n const center = this._map.getCenter()\n\n // gl.setView([center.lat, center.lng], this._map.getZoom() - 1, 0);\n // calling setView directly causes sync issues because it uses requestAnimFrame\n\n const tr = gl.transform\n tr.center = maplibre.LngLat.convert([center.lng, center.lat])\n tr.zoom = this._map.getZoom() - 1\n },\n\n // update the map constantly during a pinch zoom\n _pinchZoom: function (e) {\n this._glMap.jumpTo({\n zoom: this._map.getZoom() - 1,\n center: this._map.getCenter(),\n })\n },\n\n // borrowed from leaflet.ImageOverlay\n // https://github.com/Leaflet/Leaflet/blob/master/src/layer/ImageOverlay.js#L139-L144\n _animateZoom: function (e) {\n const scale = this._map.getZoomScale(e.zoom)\n const padding = this._map.getSize().multiplyBy(this.options.padding * scale)\n const viewHalf = this.getSize()._divideBy(2)\n // corrections for padding (scaled), adapted from\n // https://github.com/Leaflet/Leaflet/blob/master/src/map/Map.js#L1490-L1508\n const topLeft = this._map.project(e.center, e.zoom)\n ._subtract(viewHalf)\n ._add(this._map._getMapPanePos()\n .add(padding))._round()\n const offset = this._map.project(this._map.getBounds().getNorthWest(), e.zoom)\n ._subtract(topLeft)\n\n leaflet.DomUtil.setTransform(\n this._glMap._actualCanvas,\n offset.subtract(this._offset),\n scale\n )\n },\n\n _zoomStart: function (e) {\n this._zooming = true\n },\n\n _zoomEnd: function () {\n const scale = this._map.getZoomScale(this._map.getZoom())\n\n leaflet.DomUtil.setTransform(\n this._glMap._actualCanvas,\n // https://github.com/mapbox/mapbox-gl-leaflet/pull/130\n null,\n scale\n )\n\n this._zooming = false\n\n this._update()\n },\n\n _transitionEnd: function (e) {\n leaflet.Util.requestAnimFrame(function () {\n const zoom = this._map.getZoom()\n const center = this._map.getCenter()\n const offset = this._map.latLngToContainerPoint(\n this._map.getBounds().getNorthWest()\n )\n\n // reset the scale and offset\n leaflet.DomUtil.setTransform(this._glMap._actualCanvas, offset, 1)\n\n // enable panning once the gl map is ready again\n this._glMap.once('moveend', leaflet.Util.bind(function () {\n this._zoomEnd()\n }, this))\n\n // update the map position\n this._glMap.jumpTo({\n center: center,\n zoom: zoom - 1,\n })\n }, this)\n },\n\n _resize: function (e) {\n this._transitionEnd(e)\n },\n })\n\n return new Layer(options)\n}\n\n"],"names":[],"mappings":"AAA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;AACR;;AAEA,MAAM,IAAI,CAAC,QAAQ,GAAG;;AAEtB,MAAM,IAAI,CAAC,OAAO;AAClB,KAAK;;AAEL,IAAI,cAAc,EAAE,UAAU,CAAC,EAAE;AACjC,MAAM,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,YAAY;AAChD,QAAQ,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO;AACtC,QAAQ,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS;AAC1C,QAAQ,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,sBAAsB;AACvD,UAAU,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,YAAY;AAC5C;;AAEA;AACA,QAAQ,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,MAAM,EAAE,CAAC;;AAEzE;AACA,QAAQ,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY;AAClE,UAAU,IAAI,CAAC,QAAQ;AACvB,SAAS,EAAE,IAAI,CAAC;;AAEhB;AACA,QAAQ,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;AAC3B,UAAU,MAAM,EAAE,MAAM;AACxB,UAAU,IAAI,EAAE,IAAI,GAAG,CAAC;AACxB,SAAS;AACT,OAAO,EAAE,IAAI;AACb,KAAK;;AAEL,IAAI,OAAO,EAAE,UAAU,CAAC,EAAE;AAC1B,MAAM,IAAI,CAAC,cAAc,CAAC,CAAC;AAC3B,KAAK;AACL,GAAG;;AAEH,EAAE,OAAO,IAAI,KAAK,CAAC,OAAO;AAC1B;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.js","sources":["../../../src/components/leaflet-map/style.ts"],"sourcesContent":["import { css, injectGlobal } from '@emotion/css'\n\n// Utils\nimport { getCssVarNames, injectGlobalCssVariables } from 'utils/style'\n\n// Inject Leaflet global style\n// eslint-disable-next-line\nimport leafletCSS from './leaflet.css'\ninjectGlobal(leafletCSS)\n\nconst cssVarDefaults = {\n '--vis-map-container-background-color': '#dfe5eb',\n /* Undefined by default to allow proper fallback to var(--vis-font-family) */\n '--vis-map-label-font-family': undefined as undefined,\n\n '--vis-map-point-default-fill-color': '#B9BEC3',\n '--vis-map-point-ring-fill-color': '#ffffff',\n '--vis-map-point-default-stroke-color': '#959da3',\n '--vis-map-point-default-stroke-width': '0px',\n '--vis-map-point-default-cursor': 'default',\n\n '--vis-map-cluster-default-fill-color': '#fff',\n '--vis-map-cluster-default-stroke-color': '#B9BEC3',\n '--vis-map-cluster-default-stroke-width': '1.5px',\n '--vis-map-cluster-donut-fill-color': '#959da3',\n\n '--vis-map-cluster-inner-label-text-color-dark': '#5b5f6d',\n '--vis-map-cluster-inner-label-text-color-light': '#fff',\n\n '--vis-map-point-inner-label-text-color-dark': '#5b5f6d',\n '--vis-map-point-inner-label-text-color-light': '#fff',\n\n '--vis-map-point-bottom-label-text-color': '#5b5f6d',\n '--vis-map-point-bottom-label-font-size': '10px',\n\n '--vis-map-cluster-expanded-background-fill-color': '#fff',\n\n /* Dark Theme */\n '--vis-dark-map-container-background-color': '#dfe5eb',\n '--vis-dark-map-point-default-fill-color': '#B9BEC3',\n '--vis-dark-map-point-default-stroke-color': '#959da3',\n '--vis-dark-map-point-ring-fill-color': '#5b5f6d',\n\n '--vis-dark-map-cluster-default-fill-color': '#5b5f6d',\n '--vis-dark-map-cluster-default-stroke-color': '#B9BEC3',\n '--vis-dark-map-cluster-donut-fill-color': '#959da3',\n\n '--vis-dark-map-cluster-inner-label-text-color-dark': '#5b5f6d',\n '--vis-dark-map-cluster-inner-label-text-color-light': '#fff',\n\n '--vis-dark-map-point-inner-label-text-color-dark': '#5b5f6d',\n '--vis-dark-map-point-inner-label-text-color-light': '#fff',\n\n '--vis-dark-map-point-bottom-label-text-color': '#5b5f6d',\n\n '--vis-dark-map-cluster-expanded-background-fill-color': '#fff',\n}\n\nexport const root = css`\n label: leaflet-map-component;\n\n width: 100%;\n height: 100%;\n position: absolute;\n background-color: var(--vis-map-container-background-color);\n\n canvas {\n pointer-events: all;\n }\n`\n\nexport const variables = getCssVarNames(cssVarDefaults)\ninjectGlobalCssVariables(cssVarDefaults, root)\n\nexport const background = `${root} canvas`\n\nexport const points = css`\n label: g-points;\n`\n\nexport const point = css`\n label: g-point;\n`\n\nexport const pointPath = css`\n label: point-path;\n\n stroke-opacity: 1;\n fill-opacity: 1.0;\n fill: var(${variables.mapPointDefaultFillColor});\n stroke: var(${variables.mapPointDefaultStrokeColor});\n stroke-width: var(${variables.mapPointDefaultStrokeWidth});\n pointer-events: fill !important;\n transition: .2s stroke-width, .3s transform;\n cursor: var(${variables.mapPointDefaultCursor});\n\n &:hover {\n stroke-width: 2;\n fill-opacity: 1;\n animation: none;\n transform: scale(1.1);\n }\n`\n\nexport const pointPathRing = css`\n label: point-path-ring;\n fill: var(${variables.mapPointRingFillColor});\n`\n\nexport const pointPathCluster = css`\n label: point-path-cluster;\n fill-opacity: 0.9;\n stroke: none;\n animation: none;\n fill: var(${variables.mapClusterDefaultFillColor});\n stroke: var(${variables.mapClusterDefaultStrokeColor});\n stroke-width: var(${variables.mapClusterDefaultStrokeWidth});\n`\n\nexport const pointSelectionRing = css`\n label: point-selection-ring;\n stroke: var(${variables.mapPointDefaultFillColor});\n`\n\nexport const pointSelection = css`\n label: point-selection;\n\n opacity: 0;\n transform: scale(1);\n\n &.active {\n transition: all 400ms cubic-bezier(0.230, 1.000, 0.320, 1.000);\n opacity: 1;\n transform: scale(1.25);\n }\n`\n\nexport const innerLabel = css`\n label: inner-label;\n\n text-anchor: middle;\n fill: var(${variables.mapPointInnerLabelTextColorDark});\n font-family: var(${variables.mapLabelFontFamily}, var(--vis-font-family));\n pointer-events: none;\n font-weight: 600;\n`\n\nexport const innerLabelCluster = css`\n label: inner-label-cluster;\n fill: var(${variables.mapPointInnerLabelTextColorDark});\n`\n\nexport const bottomLabel = css`\n label: bottom-label;\n\n text-anchor: middle;\n fill: var(${variables.mapPointBottomLabelTextColor});\n font-family: var(${variables.mapLabelFontFamily}, var(--vis-font-family));\n pointer-events: none;\n font-weight: 600;\n`\n\nexport const donutCluster = css`\n label: donut-cluster;\n\n transform: scale(1);\n transition: .3s transform;\n path {\n fill: var(${variables.mapClusterDonutFillColor});\n stroke-width: 0.5;\n }\n\n &:hover {\n transform: scale(1.1);\n }\n`\n\nexport const svgOverlay = css`\n label: svg-overlay;\n position: absolute;\n pointer-events: none;\n`\n\nexport const backgroundRect = css`\n label: background-rect;\n\n opacity: 0;\n`\n\nexport const clusterBackground = css`\n label: cluster-background;\n\n fill: var(${variables.mapClusterExpandedBackgroundFillColor});\n opacity: 0.6;\n visibility: hidden;\n\n &.active {\n visibility: visible;\n }\n`\n\nexport const onFeatureHover = css`\n label: feature-hovered;\n`\n\nexport const mapboxglCanvas = css`\n pointer-events: all;\n cursor: grab;\n\n &${`.${onFeatureHover}`} {\n cursor: default;\n }\n`\n\nexport const map = css`\n label: map;\n`\n"],"names":["leafletCSS"],"mappings":";;;;AAQA,YAAY,CAACA,QAAU,CAAC,CAAA;AAExB,MAAM,cAAc,GAAG;AACrB,IAAA,sCAAsC,EAAE,SAAS;;AAEjD,IAAA,6BAA6B,EAAE,SAAsB;AAErD,IAAA,oCAAoC,EAAE,SAAS;AAC/C,IAAA,iCAAiC,EAAE,SAAS;AAC5C,IAAA,sCAAsC,EAAE,SAAS;AACjD,IAAA,sCAAsC,EAAE,KAAK;AAC7C,IAAA,gCAAgC,EAAE,SAAS;AAE3C,IAAA,sCAAsC,EAAE,MAAM;AAC9C,IAAA,wCAAwC,EAAE,SAAS;AACnD,IAAA,wCAAwC,EAAE,OAAO;AACjD,IAAA,oCAAoC,EAAE,SAAS;AAE/C,IAAA,+CAA+C,EAAE,SAAS;AAC1D,IAAA,gDAAgD,EAAE,MAAM;AAExD,IAAA,6CAA6C,EAAE,SAAS;AACxD,IAAA,8CAA8C,EAAE,MAAM;AAEtD,IAAA,yCAAyC,EAAE,SAAS;AACpD,IAAA,wCAAwC,EAAE,MAAM;AAEhD,IAAA,kDAAkD,EAAE,MAAM;;AAG1D,IAAA,2CAA2C,EAAE,SAAS;AACtD,IAAA,yCAAyC,EAAE,SAAS;AACpD,IAAA,2CAA2C,EAAE,SAAS;AACtD,IAAA,sCAAsC,EAAE,SAAS;AAEjD,IAAA,2CAA2C,EAAE,SAAS;AACtD,IAAA,6CAA6C,EAAE,SAAS;AACxD,IAAA,yCAAyC,EAAE,SAAS;AAEpD,IAAA,oDAAoD,EAAE,SAAS;AAC/D,IAAA,qDAAqD,EAAE,MAAM;AAE7D,IAAA,kDAAkD,EAAE,SAAS;AAC7D,IAAA,mDAAmD,EAAE,MAAM;AAE3D,IAAA,8CAA8C,EAAE,SAAS;AAEzD,IAAA,uDAAuD,EAAE,MAAM;CAChE,CAAA;AAEM,MAAM,IAAI,GAAG,GAAG,CAAA
|
|
1
|
+
{"version":3,"file":"style.js","sources":["../../../src/components/leaflet-map/style.ts"],"sourcesContent":["import { css, injectGlobal } from '@emotion/css'\n\n// Utils\nimport { getCssVarNames, injectGlobalCssVariables } from 'utils/style'\n\n// Inject Leaflet global style\n// eslint-disable-next-line\nimport leafletCSS from './leaflet.css'\ninjectGlobal(leafletCSS)\n\nconst cssVarDefaults = {\n '--vis-map-container-background-color': '#dfe5eb',\n /* Undefined by default to allow proper fallback to var(--vis-font-family) */\n '--vis-map-label-font-family': undefined as undefined,\n\n '--vis-map-point-default-fill-color': '#B9BEC3',\n '--vis-map-point-ring-fill-color': '#ffffff',\n '--vis-map-point-default-stroke-color': '#959da3',\n '--vis-map-point-default-stroke-width': '0px',\n '--vis-map-point-default-cursor': 'default',\n\n '--vis-map-cluster-default-fill-color': '#fff',\n '--vis-map-cluster-default-stroke-color': '#B9BEC3',\n '--vis-map-cluster-default-stroke-width': '1.5px',\n '--vis-map-cluster-donut-fill-color': '#959da3',\n\n '--vis-map-cluster-inner-label-text-color-dark': '#5b5f6d',\n '--vis-map-cluster-inner-label-text-color-light': '#fff',\n\n '--vis-map-point-inner-label-text-color-dark': '#5b5f6d',\n '--vis-map-point-inner-label-text-color-light': '#fff',\n\n '--vis-map-point-bottom-label-text-color': '#5b5f6d',\n '--vis-map-point-bottom-label-font-size': '10px',\n\n '--vis-map-cluster-expanded-background-fill-color': '#fff',\n\n /* Dark Theme */\n '--vis-dark-map-container-background-color': '#dfe5eb',\n '--vis-dark-map-point-default-fill-color': '#B9BEC3',\n '--vis-dark-map-point-default-stroke-color': '#959da3',\n '--vis-dark-map-point-ring-fill-color': '#5b5f6d',\n\n '--vis-dark-map-cluster-default-fill-color': '#5b5f6d',\n '--vis-dark-map-cluster-default-stroke-color': '#B9BEC3',\n '--vis-dark-map-cluster-donut-fill-color': '#959da3',\n\n '--vis-dark-map-cluster-inner-label-text-color-dark': '#5b5f6d',\n '--vis-dark-map-cluster-inner-label-text-color-light': '#fff',\n\n '--vis-dark-map-point-inner-label-text-color-dark': '#5b5f6d',\n '--vis-dark-map-point-inner-label-text-color-light': '#fff',\n\n '--vis-dark-map-point-bottom-label-text-color': '#5b5f6d',\n\n '--vis-dark-map-cluster-expanded-background-fill-color': '#fff',\n}\n\nexport const root = css`\n label: leaflet-map-component;\n\n width: 100%;\n height: 100%;\n position: absolute;\n background-color: var(--vis-map-container-background-color);\n\n canvas {\n pointer-events: all;\n }\n`\n\nexport const variables = getCssVarNames(cssVarDefaults)\ninjectGlobalCssVariables(cssVarDefaults, root)\n\nexport const background = `${root} canvas`\n\nexport const points = css`\n label: g-points;\n`\n\nexport const point = css`\n label: g-point;\n`\n\nexport const pointPath = css`\n label: point-path;\n\n stroke-opacity: 1;\n fill-opacity: 1.0;\n fill: var(${variables.mapPointDefaultFillColor});\n stroke: var(${variables.mapPointDefaultStrokeColor});\n stroke-width: var(${variables.mapPointDefaultStrokeWidth});\n pointer-events: fill !important;\n transition: .2s stroke-width, .3s transform;\n cursor: var(${variables.mapPointDefaultCursor});\n\n &:hover {\n stroke-width: 2;\n fill-opacity: 1;\n animation: none;\n transform: scale(1.1);\n }\n`\n\nexport const pointPathRing = css`\n label: point-path-ring;\n fill: var(${variables.mapPointRingFillColor});\n`\n\nexport const pointPathCluster = css`\n label: point-path-cluster;\n fill-opacity: 0.9;\n stroke: none;\n animation: none;\n fill: var(${variables.mapClusterDefaultFillColor});\n stroke: var(${variables.mapClusterDefaultStrokeColor});\n stroke-width: var(${variables.mapClusterDefaultStrokeWidth});\n`\n\nexport const pointSelectionRing = css`\n label: point-selection-ring;\n stroke: var(${variables.mapPointDefaultFillColor});\n`\n\nexport const pointSelection = css`\n label: point-selection;\n\n opacity: 0;\n transform: scale(1);\n\n &.active {\n transition: all 400ms cubic-bezier(0.230, 1.000, 0.320, 1.000);\n opacity: 1;\n transform: scale(1.25);\n }\n`\n\nexport const innerLabel = css`\n label: inner-label;\n\n text-anchor: middle;\n fill: var(${variables.mapPointInnerLabelTextColorDark});\n font-family: var(${variables.mapLabelFontFamily}, var(--vis-font-family));\n pointer-events: none;\n font-weight: 600;\n`\n\nexport const innerLabelCluster = css`\n label: inner-label-cluster;\n fill: var(${variables.mapPointInnerLabelTextColorDark});\n`\n\nexport const bottomLabel = css`\n label: bottom-label;\n\n text-anchor: middle;\n fill: var(${variables.mapPointBottomLabelTextColor});\n font-family: var(${variables.mapLabelFontFamily}, var(--vis-font-family));\n pointer-events: none;\n font-weight: 600;\n`\n\nexport const donutCluster = css`\n label: donut-cluster;\n\n transform: scale(1);\n transition: .3s transform;\n path {\n fill: var(${variables.mapClusterDonutFillColor});\n stroke-width: 0.5;\n }\n\n &:hover {\n transform: scale(1.1);\n }\n`\n\nexport const svgOverlay = css`\n label: svg-overlay;\n position: absolute;\n pointer-events: none;\n`\n\nexport const backgroundRect = css`\n label: background-rect;\n\n opacity: 0;\n`\n\nexport const clusterBackground = css`\n label: cluster-background;\n\n fill: var(${variables.mapClusterExpandedBackgroundFillColor});\n opacity: 0.6;\n visibility: hidden;\n\n &.active {\n visibility: visible;\n }\n`\n\nexport const onFeatureHover = css`\n label: feature-hovered;\n`\n\nexport const mapboxglCanvas = css`\n pointer-events: all;\n cursor: grab;\n\n &${`.${onFeatureHover}`} {\n cursor: default;\n }\n`\n\nexport const map = css`\n label: map;\n`\n"],"names":["leafletCSS"],"mappings":";;;;AAQA,YAAY,CAACA,QAAU,CAAC,CAAA;AAExB,MAAM,cAAc,GAAG;AACrB,IAAA,sCAAsC,EAAE,SAAS;;AAEjD,IAAA,6BAA6B,EAAE,SAAsB;AAErD,IAAA,oCAAoC,EAAE,SAAS;AAC/C,IAAA,iCAAiC,EAAE,SAAS;AAC5C,IAAA,sCAAsC,EAAE,SAAS;AACjD,IAAA,sCAAsC,EAAE,KAAK;AAC7C,IAAA,gCAAgC,EAAE,SAAS;AAE3C,IAAA,sCAAsC,EAAE,MAAM;AAC9C,IAAA,wCAAwC,EAAE,SAAS;AACnD,IAAA,wCAAwC,EAAE,OAAO;AACjD,IAAA,oCAAoC,EAAE,SAAS;AAE/C,IAAA,+CAA+C,EAAE,SAAS;AAC1D,IAAA,gDAAgD,EAAE,MAAM;AAExD,IAAA,6CAA6C,EAAE,SAAS;AACxD,IAAA,8CAA8C,EAAE,MAAM;AAEtD,IAAA,yCAAyC,EAAE,SAAS;AACpD,IAAA,wCAAwC,EAAE,MAAM;AAEhD,IAAA,kDAAkD,EAAE,MAAM;;AAG1D,IAAA,2CAA2C,EAAE,SAAS;AACtD,IAAA,yCAAyC,EAAE,SAAS;AACpD,IAAA,2CAA2C,EAAE,SAAS;AACtD,IAAA,sCAAsC,EAAE,SAAS;AAEjD,IAAA,2CAA2C,EAAE,SAAS;AACtD,IAAA,6CAA6C,EAAE,SAAS;AACxD,IAAA,yCAAyC,EAAE,SAAS;AAEpD,IAAA,oDAAoD,EAAE,SAAS;AAC/D,IAAA,qDAAqD,EAAE,MAAM;AAE7D,IAAA,kDAAkD,EAAE,SAAS;AAC7D,IAAA,mDA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YAAA,EAAA,SAAS,CAAC,+BAA+B,CAAA;EACtD;AAEM,MAAM,WAAW,GAAG,GAAG,CAAA;;;;AAIhB,YAAA,EAAA,SAAS,CAAC,4BAA4B,CAAA;AAC/B,mBAAA,EAAA,SAAS,CAAC,kBAAkB,CAAA;;;EAGhD;AAEM,MAAM,YAAY,GAAG,GAAG,CAAA;;;;;;AAMf,cAAA,EAAA,SAAS,CAAC,wBAAwB,CAAA;;;;;;;EAOjD;AAEM,MAAM,UAAU,GAAG,GAAG,CAAA;;;;EAI5B;AAEM,MAAM,cAAc,GAAG,GAAG,CAAA;;;;EAIhC;AAEM,MAAM,iBAAiB,GAAG,GAAG,CAAA;;;AAGtB,YAAA,EAAA,SAAS,CAAC,qCAAqC,CAAA;;;;;;;EAO5D;AAEM,MAAM,cAAc,GAAG,GAAG,CAAA;;EAEhC;AAEM,MAAM,cAAc,GAAG,GAAG,CAAA;;;;AAI5B,GAAA,EAAA,CAAA,CAAA,EAAI,cAAc,CAAE,CAAA,CAAA;;;EAGxB;AAEM,MAAM,GAAG,GAAG,GAAG,CAAA;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.js","sources":["../../../src/components/line/style.ts"],"sourcesContent":["import { css, injectGlobal } from '@emotion/css'\n\nexport const globalStyles = injectGlobal`\n :root {\n --vis-line-cursor: default;\n --vis-line-stroke-dasharray: none;\n --vis-line-stroke-dashoffset: 0;\n }\n`\n\nexport const root = css`\n label: line-component;\n`\n\nexport const line = css`\n label: line;\n transition: opacity 200ms;\n cursor: var(--vis-line-cursor);\n`\n\nexport const linePath = css`\n label: linePath;\n fill: none;\n stroke-dasharray: var(--vis-line-stroke-dasharray);\n stroke-dashoffset: var(--vis-line-stroke-dashoffset);\n`\n\nexport const lineSelectionHelper = css`\n label: lineSelectionHelper;\n fill: none;\n stroke: rgba(0, 0, 0, 0);\n stroke-width: 8px;\n`\n\nexport const dim = css`\n opacity: 0.2;\n`\n"],"names":[],"mappings":";;AAEO,MAAM,YAAY,GAAG,YAAY,CAAA
|
|
1
|
+
{"version":3,"file":"style.js","sources":["../../../src/components/line/style.ts"],"sourcesContent":["import { css, injectGlobal } from '@emotion/css'\n\nexport const globalStyles = injectGlobal`\n :root {\n --vis-line-cursor: default;\n --vis-line-stroke-dasharray: none;\n --vis-line-stroke-dashoffset: 0;\n }\n`\n\nexport const root = css`\n label: line-component;\n`\n\nexport const line = css`\n label: line;\n transition: opacity 200ms;\n cursor: var(--vis-line-cursor);\n`\n\nexport const linePath = css`\n label: linePath;\n fill: none;\n stroke-dasharray: var(--vis-line-stroke-dasharray);\n stroke-dashoffset: var(--vis-line-stroke-dashoffset);\n`\n\nexport const lineSelectionHelper = css`\n label: lineSelectionHelper;\n fill: none;\n stroke: rgba(0, 0, 0, 0);\n stroke-width: 8px;\n`\n\nexport const dim = css`\n opacity: 0.2;\n`\n"],"names":[],"mappings":";;AAEO,MAAM,YAAY,GAAG,YAAY,CAAA;;;;;;EAMvC;AAEM,MAAM,IAAI,GAAG,GAAG,CAAA;;EAEtB;AAEM,MAAM,IAAI,GAAG,GAAG,CAAA;;;;EAItB;AAEM,MAAM,QAAQ,GAAG,GAAG,CAAA;;;;;EAK1B;AAEM,MAAM,mBAAmB,GAAG,GAAG,CAAA;;;;;EAKrC;AAEM,MAAM,GAAG,GAAG,GAAG,CAAA;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.js","sources":["../../../src/components/nested-donut/style.ts"],"sourcesContent":["import { css } from '@emotion/css'\n\n// Utils\nimport { getCssVarNames, injectGlobalCssVariables } from 'utils/style'\n\nconst cssVarDefaults = {\n // Undefined by default to allow proper fallback to var(--vis-font-family)\n '--vis-nested-donut-font-family': undefined as undefined,\n\n // Background\n '--vis-nested-donut-background-color': '#E7E9F3',\n\n // Central label\n '--vis-nested-donut-central-label-font-size': '16px',\n '--vis-nested-donut-central-label-font-weight': 600,\n '--vis-nested-donut-central-label-text-color': '#5b5f6d',\n\n // Central sub-label\n '--vis-nested-donut-central-sublabel-font-size': '12px;',\n '--vis-nested-donut-central-sublabel-font-weight': 500,\n '--vis-nested-donut-central-sublabel-text-color': '#5b5f6d',\n\n // Segments\n '--vis-nested-donut-segment-stroke-width': '1px',\n '--vis-nested-donut-segment-stroke-color': 'var(--vis-nested-donut-background-color)',\n '--vis-nested-donut-segment-label-text-color-light': '#5b5f6d',\n '--vis-nested-donut-segment-label-text-color-dark': '#fff',\n '--vis-nested-donut-segment-label-font-size': '1em',\n\n /* Dark theme */\n '--vis-dark-nested-donut-background-color': '#18160C',\n '--vis-dark-nested-donut-central-label-text-color': '#fff',\n '--vis-dark-nested-donut-central-sublabel-text-color': '#fff',\n}\n\nexport const root = css`\n label: nested-donut-component;\n`\n\nexport const segmentsGroup = css`\n label: nested-donut-segments-group;\n`\n\nexport const variables = getCssVarNames(cssVarDefaults)\ninjectGlobalCssVariables(cssVarDefaults, root)\n\nexport const background = css`\n label: background;\n fill: var(--vis-nested-donut-background-color);\n stroke-width: var(--vis-nested-donut-segment-stroke-width);\n stroke: var(--vis-nested-donut-segment-stroke-color);\n`\n\nexport const segment = css`\n label: segment;\n `\n\nexport const segmentExit = css`\n label: segment-exit;\n`\n\nexport const segmentArc = css`\n label: segment-arc;\n stroke-width: var(--vis-nested-donut-segment-stroke-width);\n stroke: var(--vis-nested-donut-segment-stroke-color);\n`\n\nexport const segmentLabel = css`\n label: segment-label;\n text-anchor: middle;\n dominant-baseline: middle;\n user-select: none;\n font-size: var(--vis-nested-donut-segment-label-font-size);\n`\n\nexport const centralLabel = css`\n label: central-label;\n text-anchor: middle;\n dominant-baseline: middle;\n font-size: var(--vis-nested-donut-central-label-font-size);\n font-family: var(--vis-nested-donut-central-label-font-family, var(--vis-font-family));\n font-weight: var(--vis-nested-donut-central-label-font-weight);\n fill: var(--vis-nested-donut-central-label-text-color);\n`\n\nexport const centralSubLabel = css`\n label: central-sub-label;\n text-anchor: middle;\n dominant-baseline: middle;\n font-size: var(--vis-nested-donut-central-sublabel-font-size);\n font-family: var(--vis-nested-donut-central-sublabel-font-family, var(--vis-font-family));\n font-weight: var(--vis-nested-donut-central-sublabel-font-weight);\n fill: var(--vis-nested-donut-central-sublabel-text-color);\n`\n"],"names":[],"mappings":";;;AAKA,MAAM,cAAc,GAAG;;AAErB,IAAA,gCAAgC,EAAE,SAAsB;;AAGxD,IAAA,qCAAqC,EAAE,SAAS;;AAGhD,IAAA,4CAA4C,EAAE,MAAM;AACpD,IAAA,8CAA8C,EAAE,GAAG;AACnD,IAAA,6CAA6C,EAAE,SAAS;;AAGxD,IAAA,+CAA+C,EAAE,OAAO;AACxD,IAAA,iDAAiD,EAAE,GAAG;AACtD,IAAA,gDAAgD,EAAE,SAAS;;AAG3D,IAAA,yCAAyC,EAAE,KAAK;AAChD,IAAA,yCAAyC,EAAE,0CAA0C;AACrF,IAAA,mDAAmD,EAAE,SAAS;AAC9D,IAAA,kDAAkD,EAAE,MAAM;AAC1D,IAAA,4CAA4C,EAAE,KAAK;;AAGnD,IAAA,0CAA0C,EAAE,SAAS;AACrD,IAAA,kDAAkD,EAAE,MAAM;AAC1D,IAAA,qDAAqD,EAAE,MAAM;CAC9D,CAAA;AAEM,MAAM,IAAI,GAAG,GAAG,CAAA
|
|
1
|
+
{"version":3,"file":"style.js","sources":["../../../src/components/nested-donut/style.ts"],"sourcesContent":["import { css } from '@emotion/css'\n\n// Utils\nimport { getCssVarNames, injectGlobalCssVariables } from 'utils/style'\n\nconst cssVarDefaults = {\n // Undefined by default to allow proper fallback to var(--vis-font-family)\n '--vis-nested-donut-font-family': undefined as undefined,\n\n // Background\n '--vis-nested-donut-background-color': '#E7E9F3',\n\n // Central label\n '--vis-nested-donut-central-label-font-size': '16px',\n '--vis-nested-donut-central-label-font-weight': 600,\n '--vis-nested-donut-central-label-text-color': '#5b5f6d',\n\n // Central sub-label\n '--vis-nested-donut-central-sublabel-font-size': '12px;',\n '--vis-nested-donut-central-sublabel-font-weight': 500,\n '--vis-nested-donut-central-sublabel-text-color': '#5b5f6d',\n\n // Segments\n '--vis-nested-donut-segment-stroke-width': '1px',\n '--vis-nested-donut-segment-stroke-color': 'var(--vis-nested-donut-background-color)',\n '--vis-nested-donut-segment-label-text-color-light': '#5b5f6d',\n '--vis-nested-donut-segment-label-text-color-dark': '#fff',\n '--vis-nested-donut-segment-label-font-size': '1em',\n\n /* Dark theme */\n '--vis-dark-nested-donut-background-color': '#18160C',\n '--vis-dark-nested-donut-central-label-text-color': '#fff',\n '--vis-dark-nested-donut-central-sublabel-text-color': '#fff',\n}\n\nexport const root = css`\n label: nested-donut-component;\n`\n\nexport const segmentsGroup = css`\n label: nested-donut-segments-group;\n`\n\nexport const variables = getCssVarNames(cssVarDefaults)\ninjectGlobalCssVariables(cssVarDefaults, root)\n\nexport const background = css`\n label: background;\n fill: var(--vis-nested-donut-background-color);\n stroke-width: var(--vis-nested-donut-segment-stroke-width);\n stroke: var(--vis-nested-donut-segment-stroke-color);\n`\n\nexport const segment = css`\n label: segment;\n `\n\nexport const segmentExit = css`\n label: segment-exit;\n`\n\nexport const segmentArc = css`\n label: segment-arc;\n stroke-width: var(--vis-nested-donut-segment-stroke-width);\n stroke: var(--vis-nested-donut-segment-stroke-color);\n`\n\nexport const segmentLabel = css`\n label: segment-label;\n text-anchor: middle;\n dominant-baseline: middle;\n user-select: none;\n font-size: var(--vis-nested-donut-segment-label-font-size);\n`\n\nexport const centralLabel = css`\n label: central-label;\n text-anchor: middle;\n dominant-baseline: middle;\n font-size: var(--vis-nested-donut-central-label-font-size);\n font-family: var(--vis-nested-donut-central-label-font-family, var(--vis-font-family));\n font-weight: var(--vis-nested-donut-central-label-font-weight);\n fill: var(--vis-nested-donut-central-label-text-color);\n`\n\nexport const centralSubLabel = css`\n label: central-sub-label;\n text-anchor: middle;\n dominant-baseline: middle;\n font-size: var(--vis-nested-donut-central-sublabel-font-size);\n font-family: var(--vis-nested-donut-central-sublabel-font-family, var(--vis-font-family));\n font-weight: var(--vis-nested-donut-central-sublabel-font-weight);\n fill: var(--vis-nested-donut-central-sublabel-text-color);\n`\n"],"names":[],"mappings":";;;AAKA,MAAM,cAAc,GAAG;;AAErB,IAAA,gCAAgC,EAAE,SAAsB;;AAGxD,IAAA,qCAAqC,EAAE,SAAS;;AAGhD,IAAA,4CAA4C,EAAE,MAAM;AACpD,IAAA,8CAA8C,EAAE,GAAG;AACnD,IAAA,6CAA6C,EAAE,SAAS;;AAGxD,IAAA,+CAA+C,EAAE,OAAO;AACxD,IAAA,iDAAiD,EAAE,GAAG;AACtD,IAAA,gDAAgD,EAAE,SAAS;;AAG3D,IAAA,yCAAyC,EAAE,KAAK;AAChD,IAAA,yCAAyC,EAAE,0CAA0C;AACrF,IAAA,mDAAmD,EAAE,SAAS;AAC9D,IAAA,kDAAkD,EAAE,MAAM;AAC1D,IAAA,4CAA4C,EAAE,KAAK;;AAGnD,IAAA,0CAA0C,EAAE,SAAS;AACrD,IAAA,kDAAkD,EAAE,MAAM;AAC1D,IAAA,qDAAqD,EAAE,MAAM;CAC9D,CAAA;AAEM,MAAM,IAAI,GAAG,GAAG,CAAA;;EAEtB;AAEM,MAAM,aAAa,GAAG,GAAG,CAAA;;EAE/B;MAEY,SAAS,GAAG,cAAc,CAAC,cAAc,EAAC;AACvD,wBAAwB,CAAC,cAAc,EAAE,IAAI,CAAC,CAAA;AAEvC,MAAM,UAAU,GAAG,GAAG,CAAA;;;;;EAK5B;AAEM,MAAM,OAAO,GAAG,GAAG,CAAA;;GAExB;AAEK,MAAM,WAAW,GAAG,GAAG,CAAA;;EAE7B;AAEM,MAAM,UAAU,GAAG,GAAG,CAAA;;;;EAI5B;AAEM,MAAM,YAAY,GAAG,GAAG,CAAA;;;;;;EAM9B;AAEM,MAAM,YAAY,GAAG,GAAG,CAAA;;;;;;;;EAQ9B;AAEM,MAAM,eAAe,GAAG,GAAG,CAAA;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { RollingPinLegendItem } from "./types";
|
|
2
|
+
export interface RollingPinLegendConfigInterface {
|
|
3
|
+
/** Rects forming a legend. Array of `string`, representing colors.
|
|
4
|
+
*
|
|
5
|
+
* Default: `[]` */
|
|
6
|
+
rects: RollingPinLegendItem[];
|
|
7
|
+
/** Label on the left side of the legend. Default: `undefined` */
|
|
8
|
+
leftLabelText?: string;
|
|
9
|
+
/** Label on the right side of the legend. Default: `undefined` */
|
|
10
|
+
rightLabelText?: string;
|
|
11
|
+
/** Apply a specific class to the labels. Default: `''` */
|
|
12
|
+
labelClassName?: string;
|
|
13
|
+
/** Label text (<span> element) font-size CSS. Default: `null` */
|
|
14
|
+
labelFontSize?: string | null;
|
|
15
|
+
/** If set to true, the legend will be rendered directly into the HTML element provided to the constructor
|
|
16
|
+
* without creating additional `div` element. Default: `false` */
|
|
17
|
+
renderIntoProvidedDomNode?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare const RollingPinLegendDefaultConfig: RollingPinLegendConfigInterface;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sources":["../../../src/components/rolling-pin-legend/config.ts"],"sourcesContent":["import { RollingPinLegendItem } from 'components/rolling-pin-legend/types'\n\nexport interface RollingPinLegendConfigInterface {\n /** Rects forming a legend. Array of `string`, representing colors.\n *\n * Default: `[]` */\n rects: RollingPinLegendItem[];\n /** Label on the left side of the legend. Default: `undefined` */\n leftLabelText?: string;\n /** Label on the right side of the legend. Default: `undefined` */\n rightLabelText?: string;\n /** Apply a specific class to the labels. Default: `''` */\n labelClassName?: string;\n /** Label text (<span> element) font-size CSS. Default: `null` */\n labelFontSize?: string | null;\n /** If set to true, the legend will be rendered directly into the HTML element provided to the constructor\n * without creating additional `div` element. Default: `false` */\n renderIntoProvidedDomNode?: boolean;\n}\n\nexport const RollingPinLegendDefaultConfig: RollingPinLegendConfigInterface = {\n rects: [],\n labelClassName: '',\n labelFontSize: null,\n renderIntoProvidedDomNode: false,\n}\n"],"names":[],"mappings":"AAoBa,MAAA,6BAA6B,GAAoC;AAC5E,IAAA,KAAK,EAAE,EAAE;AACT,IAAA,cAAc,EAAE,EAAE;AAClB,IAAA,aAAa,EAAE,IAAI;AACnB,IAAA,yBAAyB,EAAE,KAAK;;;;;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Selection } from 'd3-selection';
|
|
2
|
+
import { RollingPinLegendConfigInterface } from './config';
|
|
3
|
+
import * as s from './style';
|
|
4
|
+
export declare class RollingPinLegend {
|
|
5
|
+
static selectors: typeof s;
|
|
6
|
+
protected _defaultConfig: RollingPinLegendConfigInterface;
|
|
7
|
+
config: RollingPinLegendConfigInterface;
|
|
8
|
+
div: Selection<HTMLElement, unknown, null, undefined>;
|
|
9
|
+
element: HTMLElement;
|
|
10
|
+
prevConfig: RollingPinLegendConfigInterface;
|
|
11
|
+
protected _container: HTMLElement;
|
|
12
|
+
constructor(element: HTMLElement, config?: RollingPinLegendConfigInterface);
|
|
13
|
+
setConfig(config: RollingPinLegendConfigInterface): void;
|
|
14
|
+
render(): void;
|
|
15
|
+
destroy(): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { select } from 'd3-selection';
|
|
2
|
+
import { merge } from '../../utils/data.js';
|
|
3
|
+
import { RollingPinLegendDefaultConfig } from './config.js';
|
|
4
|
+
import * as style from './style.js';
|
|
5
|
+
import { root, label, rectsContainer, rect } from './style.js';
|
|
6
|
+
|
|
7
|
+
class RollingPinLegend {
|
|
8
|
+
constructor(element, config) {
|
|
9
|
+
this._defaultConfig = RollingPinLegendDefaultConfig;
|
|
10
|
+
this.config = this._defaultConfig;
|
|
11
|
+
this._container = element;
|
|
12
|
+
this.div = (config === null || config === void 0 ? void 0 : config.renderIntoProvidedDomNode) ? select(this._container) : select(this._container).append('div');
|
|
13
|
+
this.div.classed(root, true);
|
|
14
|
+
this.element = this.div.node();
|
|
15
|
+
if (config)
|
|
16
|
+
this.setConfig(config);
|
|
17
|
+
}
|
|
18
|
+
setConfig(config) {
|
|
19
|
+
this.prevConfig = this.config;
|
|
20
|
+
this.config = merge(this._defaultConfig, config);
|
|
21
|
+
this.render();
|
|
22
|
+
}
|
|
23
|
+
render() {
|
|
24
|
+
const { config } = this;
|
|
25
|
+
const newRoot = this.div
|
|
26
|
+
.selectAll(`.${root}`)
|
|
27
|
+
.data([0])
|
|
28
|
+
.enter()
|
|
29
|
+
.append('div')
|
|
30
|
+
.attr('class', root);
|
|
31
|
+
newRoot
|
|
32
|
+
.append('span')
|
|
33
|
+
.attr('class', label);
|
|
34
|
+
newRoot
|
|
35
|
+
.append('div')
|
|
36
|
+
.attr('class', rectsContainer);
|
|
37
|
+
newRoot
|
|
38
|
+
.append('span')
|
|
39
|
+
.attr('class', label);
|
|
40
|
+
const root$1 = this.div
|
|
41
|
+
.select(`.${root}`);
|
|
42
|
+
root$1.selectAll(`.${label}`)
|
|
43
|
+
.data([config.leftLabelText, config.rightLabelText])
|
|
44
|
+
.text(d => d);
|
|
45
|
+
const rectsContainer$1 = root$1.select(`.${rectsContainer}`);
|
|
46
|
+
const rects = rectsContainer$1.selectAll(`.${rect}`).data(config.rects);
|
|
47
|
+
const rectsEnter = rects.enter()
|
|
48
|
+
.append('div')
|
|
49
|
+
.attr('class', rect);
|
|
50
|
+
const rectsMerged = rectsEnter.merge(rects);
|
|
51
|
+
rectsMerged
|
|
52
|
+
.style('background-color', d => d);
|
|
53
|
+
rects.exit().remove();
|
|
54
|
+
}
|
|
55
|
+
destroy() {
|
|
56
|
+
if (this.element !== this._container)
|
|
57
|
+
this.div.remove();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
RollingPinLegend.selectors = style;
|
|
61
|
+
|
|
62
|
+
export { RollingPinLegend };
|
|
63
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/rolling-pin-legend/index.ts"],"sourcesContent":["import { select, Selection } from 'd3-selection'\n\n// Utils\nimport { merge } from 'utils/data'\n\n// Config\nimport { RollingPinLegendConfigInterface, RollingPinLegendDefaultConfig } from './config'\n\n// Styles\nimport * as s from './style'\n\nexport class RollingPinLegend {\n static selectors = s\n protected _defaultConfig = RollingPinLegendDefaultConfig as RollingPinLegendConfigInterface\n public config: RollingPinLegendConfigInterface = this._defaultConfig\n\n div: Selection<HTMLElement, unknown, null, undefined>\n element: HTMLElement\n prevConfig: RollingPinLegendConfigInterface\n protected _container: HTMLElement\n\n constructor (element: HTMLElement, config?: RollingPinLegendConfigInterface) {\n this._container = element\n\n this.div = config?.renderIntoProvidedDomNode ? select(this._container) : select(this._container).append<HTMLElement>('div')\n this.div.classed(s.root, true)\n\n this.element = this.div.node()\n\n if (config) this.setConfig(config)\n }\n\n setConfig (config: RollingPinLegendConfigInterface): void {\n this.prevConfig = this.config\n this.config = merge(this._defaultConfig, config)\n this.render()\n }\n\n render (): void {\n const { config } = this\n\n const newRoot = this.div\n .selectAll<HTMLDivElement, unknown>(`.${s.root}`)\n .data([0])\n .enter()\n .append('div')\n .attr('class', s.root)\n\n newRoot\n .append('span')\n .attr('class', s.label)\n\n newRoot\n .append('div')\n .attr('class', s.rectsContainer)\n\n newRoot\n .append('span')\n .attr('class', s.label)\n\n const root = this.div\n .select<HTMLDivElement>(`.${s.root}`)\n\n root.selectAll<HTMLDivElement, unknown>(`.${s.label}`)\n .data([config.leftLabelText, config.rightLabelText])\n .text(d => d)\n\n const rectsContainer = root.select<HTMLDivElement>(`.${s.rectsContainer}`)\n\n const rects = rectsContainer.selectAll<HTMLDivElement, unknown>(`.${s.rect}`).data(config.rects)\n\n const rectsEnter = rects.enter()\n .append('div')\n .attr('class', s.rect)\n\n const rectsMerged = rectsEnter.merge(rects)\n rectsMerged\n .style('background-color', d => d)\n\n rects.exit().remove()\n }\n\n public destroy (): void {\n if (this.element !== this._container) this.div.remove()\n }\n}\n"],"names":["s.root","s.label","s.rectsContainer","root","rectsContainer","s.rect","s"],"mappings":";;;;;;MAWa,gB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