@unovis/ts 1.5.1-xplg.4 → 1.6.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/components/annotations/style.js.map +1 -1
- package/components/area/config.d.ts +7 -3
- package/components/area/config.js +1 -1
- package/components/area/config.js.map +1 -1
- package/components/area/index.js +25 -9
- package/components/area/index.js.map +1 -1
- package/components/area/style.js.map +1 -1
- package/components/axis/index.d.ts +1 -0
- package/components/axis/index.js +10 -2
- package/components/axis/index.js.map +1 -1
- package/components/axis/style.js.map +1 -1
- package/components/brush/config.d.ts +1 -1
- package/components/brush/config.js.map +1 -1
- package/components/brush/style.js.map +1 -1
- package/components/bullet-legend/style.js.map +1 -1
- package/components/chord-diagram/index.js +3 -1
- package/components/chord-diagram/index.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/index.js +3 -4
- package/components/graph/index.js.map +1 -1
- package/components/graph/modules/link/index.js +1 -2
- package/components/graph/modules/link/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/grouped-bar/style.js.map +1 -1
- package/components/leaflet-flow-map/config.js +0 -1
- 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 +0 -1
- 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/config.d.ts +5 -0
- package/components/line/config.js +1 -1
- package/components/line/config.js.map +1 -1
- package/components/line/index.js +41 -2
- package/components/line/index.js.map +1 -1
- package/components/line/style.d.ts +1 -0
- package/components/line/style.js +12 -1
- package/components/line/style.js.map +1 -1
- package/components/line/types.d.ts +1 -0
- package/components/nested-donut/config.d.ts +1 -1
- package/components/nested-donut/config.js.map +1 -1
- package/components/nested-donut/style.js.map +1 -1
- 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/config.d.ts +14 -65
- package/components/timeline/config.js +1 -15
- package/components/timeline/config.js.map +1 -1
- package/components/timeline/index.d.ts +10 -21
- package/components/timeline/index.js +93 -379
- package/components/timeline/index.js.map +1 -1
- package/components/timeline/style.d.ts +0 -7
- package/components/timeline/style.js +1 -40
- package/components/timeline/style.js.map +1 -1
- package/components/tooltip/config.d.ts +6 -4
- package/components/tooltip/config.js +3 -1
- package/components/tooltip/config.js.map +1 -1
- package/components/tooltip/index.d.ts +7 -3
- package/components/tooltip/index.js +39 -9
- package/components/tooltip/index.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/vis-controls/style.js.map +1 -1
- package/components/xy-labels/style.js.map +1 -1
- package/components.d.ts +0 -4
- package/components.js +0 -2
- package/components.js.map +1 -1
- package/containers/single-container/config.d.ts +0 -3
- package/containers/single-container/config.js.map +1 -1
- package/containers/single-container/index.js +1 -2
- package/containers/single-container/index.js.map +1 -1
- package/containers/xy-container/config.d.ts +0 -5
- package/containers/xy-container/config.js +1 -1
- package/containers/xy-container/config.js.map +1 -1
- package/containers/xy-container/index.d.ts +0 -1
- package/containers/xy-container/index.js +11 -15
- package/containers/xy-container/index.js.map +1 -1
- package/core/container/config.js +0 -1
- package/core/container/config.js.map +1 -1
- package/index.js +3 -5
- 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 +6 -5
- package/styles/index.js.map +1 -1
- package/styles/patterns.js.map +1 -1
- package/styles/sizes.js.map +1 -1
- package/types/position.d.ts +1 -2
- package/types/position.js +0 -1
- package/types/position.js.map +1 -1
- package/types.d.ts +0 -2
- package/types.js +1 -4
- package/types.js.map +1 -1
- package/utils/color.d.ts +0 -14
- package/utils/color.js +2 -26
- package/utils/color.js.map +1 -1
- package/utils/data.d.ts +1 -1
- package/utils/data.js +1 -1
- package/utils/data.js.map +1 -1
- package/utils/index.js +3 -3
- package/utils/path.d.ts +0 -8
- package/utils/path.js +1 -109
- package/utils/path.js.map +1 -1
- package/utils/text.d.ts +1 -2
- package/utils/text.js +2 -10
- package/utils/text.js.map +1 -1
- package/components/rolling-pin-legend/config.d.ts +0 -19
- package/components/rolling-pin-legend/config.js +0 -9
- package/components/rolling-pin-legend/config.js.map +0 -1
- package/components/rolling-pin-legend/index.d.ts +0 -16
- package/components/rolling-pin-legend/index.js +0 -63
- package/components/rolling-pin-legend/index.js.map +0 -1
- package/components/rolling-pin-legend/style.d.ts +0 -5
- package/components/rolling-pin-legend/style.js +0 -40
- package/components/rolling-pin-legend/style.js.map +0 -1
- package/components/rolling-pin-legend/types.d.ts +0 -1
- package/components/timeline/constants.d.ts +0 -3
- package/components/timeline/constants.js +0 -6
- package/components/timeline/constants.js.map +0 -1
- package/components/timeline/types.d.ts +0 -62
- package/components/timeline/types.js +0 -2
- package/components/timeline/types.js.map +0 -1
- package/components/timeline/utils.d.ts +0 -2
- package/components/timeline/utils.js +0 -16
- package/components/timeline/utils.js.map +0 -1
- package/components/treemap/config.d.ts +0 -44
- package/components/treemap/config.js +0 -6
- package/components/treemap/config.js.map +0 -1
- package/components/treemap/index.d.ts +0 -16
- package/components/treemap/index.js +0 -263
- package/components/treemap/index.js.map +0 -1
- package/components/treemap/style.d.ts +0 -22
- package/components/treemap/style.js +0 -62
- package/components/treemap/style.js.map +0 -1
- package/components/treemap/types.d.ts +0 -11
- package/components/treemap/types.js +0 -2
- package/components/treemap/types.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.js","sources":["../../../../../src/components/graph/modules/link/style.ts"],"sourcesContent":["import { css, injectGlobal } from '@emotion/css'\n\nexport const links = css`\n label: links;\n`\n\nexport const variables = injectGlobal`\n :root {\n --vis-graph-link-stroke-color: #e6e9f3;\n --vis-graph-link-stroke-opacity: 1.0;\n --vis-graph-link-greyout-opacity: 0.3;\n --vis-graph-link-dashed-stroke-dasharray: 6 6;\n\n --vis-graph-link-label-font-size: 9pt;\n --vis-graph-link-label-background: #e6e9f3;\n --vis-graph-link-label-text-color-dark: #18181B;\n --vis-graph-link-label-text-color-bright: #fff;\n --vis-graph-link-label-text-color: var(--vis-graph-link-label-text-color-dark);\n\n --vis-graph-link-band-opacity: 0.35;\n --vis-graph-link-support-stroke-width: 10px;\n --vis-graph-link-flow-opacity: 1;\n\n --vis-dark-graph-link-stroke-color: #494b56;\n --vis-dark-graph-link-label-background: #3f3f45;\n --vis-dark-graph-link-label-text-color: var(--vis-graph-link-label-text-color-bright);\n\n\n --vis-graph-link-dominant-baseline: middle;\n }\n\n body.theme-dark ${`.${links}`} {\n --vis-graph-link-stroke-color: var(--vis-dark-graph-link-stroke-color);\n --vis-graph-link-label-stroke-color: var(--vis-dark-graph-link-label-stroke-color);\n --vis-graph-link-label-text-color: var(--vis-dark-graph-link-label-text-color);\n --vis-graph-link-label-background: var(--vis-dark-graph-link-label-background);\n }\n`\n\nexport const linkSupport = css`\n label: link-support;\n\n fill: none;\n stroke-linecap: round;\n stroke-width: var(--vis-graph-link-support-stroke-width);\n stroke-opacity: 0;\n stroke: var(--vis-graph-link-stroke-color);\n transition: stroke-opacity 0.2s;\n`\n\nexport const link = css`\n label: link;\n\n fill: none;\n stroke: var(--vis-graph-link-stroke-color);\n stroke-opacity: var(--vis-graph-link-stroke-opacity);\n transition: stroke 800ms;\n stroke-linecap: round;\n pointer-events: none;\n`\n\nexport const linkDashed = css`\n label: dashed;\n\n ${`.${link}`} {\n stroke-dasharray: var(--vis-graph-link-dashed-stroke-dasharray);\n }\n`\n\nexport const linkArrow = css`\n label: link-arrow;\n fill: var(--vis-graph-link-stroke-color);\n`\n\nexport const gLink = css`\n label: g-link;\n`\n\nexport const gLinkExit = css`\n label: g-link-exit;\n pointer-events: none;\n`\n\nexport const greyedOutLink = css`\n label: greyed-out;\n opacity: var(--vis-graph-link-greyout-opacity);\n`\n\nexport const linkBand = css`\n label: link-band;\n\n stroke-opacity: var(--vis-graph-link-band-opacity);\n pointer-events: none;\n stroke: var(--vis-graph-node-stroke-color);\n fill: none;\n`\n\nexport const flowGroup = css`\n label: flow-group;\n \n pointer-events: none;\n`\n\nexport const flowCircle = css`\n label: flow-circle;\n\n fill: var(--vis-graph-link-stroke-color);\n opacity: var(--vis-graph-link-flow-opacity);\n`\n\nexport const linkLabelGroup = css`\n label: label-group;\n`\n\nexport const linkLabelBackground = css`\n label: label-background;\n\n fill: var(--vis-graph-link-label-background);\n`\n\nexport const linkLabelContent = css`\n label: label-content;\n\n font-size: var(--vis-graph-link-label-font-size);\n font-family: var(--vis-font-family);\n fill: var(--vis-graph-link-label-text-color);\n text-anchor: middle;\n dominant-baseline: var(--vis-graph-link-dominant-baseline);\n user-select: none;\n`\n"],"names":[],"mappings":";;AAEO,MAAM,KAAK,GAAG,GAAG,CAAA;;EAEvB;AAEM,MAAM,SAAS,GAAG,YAAY,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;AAyBjB,kBAAA,EAAA,CAAA,CAAA,EAAI,KAAK,CAAE,CAAA,CAAA;;;;;;EAM9B;AAEM,MAAM,WAAW,GAAG,GAAG,CAAA;;;;;;;;;EAS7B;AAEM,MAAM,IAAI,GAAG,GAAG,CAAA;;;;;;;;;EAStB;AAEM,MAAM,UAAU,GAAG,GAAG,CAAA;;;AAGzB,EAAA,EAAA,CAAA,CAAA,EAAI,IAAI,CAAE,CAAA,CAAA;;;EAGb;AAEM,MAAM,SAAS,GAAG,GAAG,CAAA;;;EAG3B;AAEM,MAAM,KAAK,GAAG,GAAG,CAAA;;EAEvB;AAEM,MAAM,SAAS,GAAG,GAAG,CAAA;;;EAG3B;AAEM,MAAM,aAAa,GAAG,GAAG,CAAA;;;EAG/B;AAEM,MAAM,QAAQ,GAAG,GAAG,CAAA;;;;;;;EAO1B;AAEM,MAAM,SAAS,GAAG,GAAG,CAAA;;;;EAI3B;AAEM,MAAM,UAAU,GAAG,GAAG,CAAA;;;;;EAK5B;AAEM,MAAM,cAAc,GAAG,GAAG,CAAA;;EAEhC;AAEM,MAAM,mBAAmB,GAAG,GAAG,CAAA;;;;EAIrC;AAEM,MAAM,gBAAgB,GAAG,GAAG,CAAA;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"style.js","sources":["../../../../../src/components/graph/modules/link/style.ts"],"sourcesContent":["import { css, injectGlobal } from '@emotion/css'\n\nexport const links = css`\n label: links;\n`\n\nexport const variables = injectGlobal`\n :root {\n --vis-graph-link-stroke-color: #e6e9f3;\n --vis-graph-link-stroke-opacity: 1.0;\n --vis-graph-link-greyout-opacity: 0.3;\n --vis-graph-link-dashed-stroke-dasharray: 6 6;\n\n --vis-graph-link-label-font-size: 9pt;\n --vis-graph-link-label-background: #e6e9f3;\n --vis-graph-link-label-text-color-dark: #18181B;\n --vis-graph-link-label-text-color-bright: #fff;\n --vis-graph-link-label-text-color: var(--vis-graph-link-label-text-color-dark);\n\n --vis-graph-link-band-opacity: 0.35;\n --vis-graph-link-support-stroke-width: 10px;\n --vis-graph-link-flow-opacity: 1;\n\n --vis-dark-graph-link-stroke-color: #494b56;\n --vis-dark-graph-link-label-background: #3f3f45;\n --vis-dark-graph-link-label-text-color: var(--vis-graph-link-label-text-color-bright);\n\n\n --vis-graph-link-dominant-baseline: middle;\n }\n\n body.theme-dark ${`.${links}`} {\n --vis-graph-link-stroke-color: var(--vis-dark-graph-link-stroke-color);\n --vis-graph-link-label-stroke-color: var(--vis-dark-graph-link-label-stroke-color);\n --vis-graph-link-label-text-color: var(--vis-dark-graph-link-label-text-color);\n --vis-graph-link-label-background: var(--vis-dark-graph-link-label-background);\n }\n`\n\nexport const linkSupport = css`\n label: link-support;\n\n fill: none;\n stroke-linecap: round;\n stroke-width: var(--vis-graph-link-support-stroke-width);\n stroke-opacity: 0;\n stroke: var(--vis-graph-link-stroke-color);\n transition: stroke-opacity 0.2s;\n`\n\nexport const link = css`\n label: link;\n\n fill: none;\n stroke: var(--vis-graph-link-stroke-color);\n stroke-opacity: var(--vis-graph-link-stroke-opacity);\n transition: stroke 800ms;\n stroke-linecap: round;\n pointer-events: none;\n`\n\nexport const linkDashed = css`\n label: dashed;\n\n ${`.${link}`} {\n stroke-dasharray: var(--vis-graph-link-dashed-stroke-dasharray);\n }\n`\n\nexport const linkArrow = css`\n label: link-arrow;\n fill: var(--vis-graph-link-stroke-color);\n`\n\nexport const gLink = css`\n label: g-link;\n`\n\nexport const gLinkExit = css`\n label: g-link-exit;\n pointer-events: none;\n`\n\nexport const greyedOutLink = css`\n label: greyed-out;\n opacity: var(--vis-graph-link-greyout-opacity);\n`\n\nexport const linkBand = css`\n label: link-band;\n\n stroke-opacity: var(--vis-graph-link-band-opacity);\n pointer-events: none;\n stroke: var(--vis-graph-node-stroke-color);\n fill: none;\n`\n\nexport const flowGroup = css`\n label: flow-group;\n \n pointer-events: none;\n`\n\nexport const flowCircle = css`\n label: flow-circle;\n\n fill: var(--vis-graph-link-stroke-color);\n opacity: var(--vis-graph-link-flow-opacity);\n`\n\nexport const linkLabelGroup = css`\n label: label-group;\n`\n\nexport const linkLabelBackground = css`\n label: label-background;\n\n fill: var(--vis-graph-link-label-background);\n`\n\nexport const linkLabelContent = css`\n label: label-content;\n\n font-size: var(--vis-graph-link-label-font-size);\n font-family: var(--vis-font-family);\n fill: var(--vis-graph-link-label-text-color);\n text-anchor: middle;\n dominant-baseline: var(--vis-graph-link-dominant-baseline);\n user-select: none;\n`\n"],"names":[],"mappings":";;AAEO,MAAM,KAAK,GAAG,GAAG,CAAA,CAAA;;EAEvB;AAEM,MAAM,SAAS,GAAG,YAAY,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;AAyBjB,kBAAA,EAAA,CAAA,CAAA,EAAI,KAAK,CAAE,CAAA,CAAA;;;;;;EAM9B;AAEM,MAAM,WAAW,GAAG,GAAG,CAAA,CAAA;;;;;;;;;EAS7B;AAEM,MAAM,IAAI,GAAG,GAAG,CAAA,CAAA;;;;;;;;;EAStB;AAEM,MAAM,UAAU,GAAG,GAAG,CAAA,CAAA;;;AAGzB,EAAA,EAAA,CAAA,CAAA,EAAI,IAAI,CAAE,CAAA,CAAA;;;EAGb;AAEM,MAAM,SAAS,GAAG,GAAG,CAAA,CAAA;;;EAG3B;AAEM,MAAM,KAAK,GAAG,GAAG,CAAA,CAAA;;EAEvB;AAEM,MAAM,SAAS,GAAG,GAAG,CAAA,CAAA;;;EAG3B;AAEM,MAAM,aAAa,GAAG,GAAG,CAAA,CAAA;;;EAG/B;AAEM,MAAM,QAAQ,GAAG,GAAG,CAAA,CAAA;;;;;;;EAO1B;AAEM,MAAM,SAAS,GAAG,GAAG,CAAA,CAAA;;;;EAI3B;AAEM,MAAM,UAAU,GAAG,GAAG,CAAA,CAAA;;;;;EAK5B;AAEM,MAAM,cAAc,GAAG,GAAG,CAAA,CAAA;;EAEhC;AAEM,MAAM,mBAAmB,GAAG,GAAG,CAAA,CAAA;;;;EAIrC;AAEM,MAAM,gBAAgB,GAAG,GAAG,CAAA,CAAA;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.js","sources":["../../../../../src/components/graph/modules/node/style.ts"],"sourcesContent":["import { css, injectGlobal } from '@emotion/css'\n\nexport const nodes = css`\n label: nodes;\n`\n\nexport const variables = injectGlobal`\n :root {\n /* Node Fill */\n --vis-graph-node-stroke-color: rgb(206, 211, 222);\n --vis-graph-node-fill-color: #fff;\n --vis-graph-node-gauge-color: #adb4c2;\n --vis-graph-node-selection-color: #acb3b8;\n\n --vis-dark-graph-node-stroke-color: rgba(30,30,30,.25);\n --vis-dark-graph-node-fill-color: #494b56;\n --vis-dark-graph-node-gauge-color: #989aa3;\n --vis-dark-graph-node-selection-color: #494b56;\n\n /* Node Central Icon */\n --vis-graph-node-icon-fill-color-bright: #ffffff;\n --vis-graph-node-icon-fill-color-dark: var(--vis-color-grey);\n --vis-graph-node-icon-fill-color: #9ea7b8;\n\n --vis-dark-graph-node-icon-fill-color: var(--vis-graph-node-icon-fill-color-bright);\n\n /* Node Bottom Icon */\n --vis-graph-node-bottom-icon-font-size: 14pt;\n --vis-graph-node-bottom-icon-fill-color: #a0a6ad;\n --vis-graph-node-bottom-icon-stroke-color: #fff;\n --vis-graph-node-bottom-icon-stroke-width: 2px;\n\n --vis-dark-graph-node-bottom-icon-fill-color: #a0a6ad;\n --vis-dark-graph-node-bottom-icon-stroke-color: #fff;\n\n /* Node Label */\n --vis-graph-node-label-font-size: 9pt;\n --vis-graph-node-label-background: #ffffff;\n --vis-graph-node-label-text-color: #0F1E57;\n --vis-graph-node-sublabel-text-color: #989aa3;\n --vis-graph-node-sublabel-font-size: 8pt;\n // Undefined by default to allow proper fallback to var(--vis-font-family)\n /* --vis-graph-node-label-font-family: */\n\n --vis-dark-graph-node-label-background: var(--vis-color-grey);\n --vis-dark-graph-node-label-text-color: #ffffff;\n --vis-dark-graph-node-sublabel-text-color: #989aa3;\n\n /* Node Side Labels (circular labels)*/\n --vis-graph-node-side-label-background-fill-color: #a0a9af;\n --vis-graph-node-side-label-background-stroke-color: #ffffff;\n --vis-graph-node-side-label-fill-color-bright: #ffffff;\n --vis-graph-node-side-label-fill-color-dark: #494b56;\n\n --vis-dark-graph-node-side-label-background-fill-color: #989aa3;\n --vis-dark-graph-node-side-label-background-stroke-color: var(--vis-color-grey);\n --vis-dark-graph-node-side-label-fill-color-bright: #f1f4f7;\n --vis-dark-graph-node-side-label-fill-color-dark: var(--vis-color-grey);\n\n /* Greyout */\n --vis-graph-node-greyout-opacity: 0.9;\n --vis-graph-node-greyout-filter: none;\n --vis-graph-node-greyout-color: #ebeff7;\n --vis-graph-node-icon-greyout-color: #c6cad1;\n --vis-graph-node-side-label-background-greyout-color: #f1f4f7;\n\n --vis-dark-graph-node-greyout-color: #494b56;\n --vis-dark-graph-node-icon-greyout-color: var(--vis-color-grey);\n --vis-dark-graph-node-side-label-background-greyout-color: #494B56;\n\n /* Brushed */\n --vis-graph-brushed-node-stroke-color: var(--vis-color-main);\n --vis-graph-brushed-node-label-text-color: var(--vis-color-main);\n --vis-graph-brushed-node-icon-fill-color: var(--vis-color-main);\n \n /* Misc */\n --vis-graph-node-dominant-baseline: middle;\n }\n\n body.theme-dark ${`.${nodes}`} {\n --vis-graph-node-stroke-color: var(--vis-dark-graph-node-stroke-color);\n --vis-graph-node-fill-color: var(--vis-dark-graph-node-fill-color);\n --vis-graph-node-gauge-color: var(--vis-dark-graph-node-gauge-color);\n --vis-graph-node-selection-color: var(--vis-dark-graph-node-selection-color);\n\n --vis-graph-node-icon-fill-color: var(--vis-dark-graph-node-icon-fill-color);\n\n --vis-graph-node-bottom-icon-fill-color: var(--vis-dark-graph-node-bottom-icon-fill-color);\n --vis-graph-node-bottom-icon-stroke-color: var(--vis-dark-graph-node-bottom-icon-stroke-color);\n\n --vis-graph-node-label-background: var(--vis-dark-graph-node-label-background);\n --vis-graph-node-label-text-color: var(--vis-dark-graph-node-label-text-color);\n --vis-graph-node-sublabel-text-color: var(--vis-dark-graph-node-sublabel-text-color);\n\n --vis-graph-node-side-label-background-fill-color: var(--vis-dark-graph-node-side-label-background-fill-color);\n --vis-graph-node-side-label-background-stroke-color: var(--vis-dark-graph-side-label-background-stroke-color);\n --vis-graph-node-side-label-fill-color-bright: var(--vis-dark-graph-node-side-label-fill-color-bright);\n --vis-graph-node-side-label-fill-color-dark: var(vis-dark-graph-node-side-label-fill-color-dark);\n\n --vis-graph-node-greyout-color: var(--vis-dark-graph-node-greyout-color);\n --vis-graph-node-icon-greyout-color: var(--vis-dark-graph-node-icon-greyout-color);\n --vis-graph-node-side-label-background-greyout-color: var(--vis-dark-graph-node-side-label-background-greyout-color);\n }\n`\n\nexport const brushable = css`\n label: brushable;\n`\n\n\nexport const node = css`\n label: node-shape;\n\n stroke: var(--vis-graph-node-stroke-color);\n fill: var(--vis-graph-node-fill-color);\n\n :not(.${brushable}) {\n transition: .4s fill, 4s stroke;\n }\n`\n\nexport const nodeIcon = css`\n label: icon;\n\n font-family: var(--vis-graph-icon-font-family), var(--vis-font-family);\n dominant-baseline: var(--vis-graph-node-dominant-baseline);\n text-anchor: middle;\n pointer-events: none;\n fill: var(--vis-graph-node-icon-fill-color);\n\n :not(.${brushable}) {\n transition: .4s all;\n }\n`\n\nexport const nodeBottomIcon = css`\n label: node-bottom-icon;\n font-family: var(--vis-graph-icon-font-family), var(--vis-font-family);\n font-size: var(--vis-graph-node-bottom-icon-font-size);\n dominant-baseline: var(--vis-graph-node-dominant-baseline);\n text-anchor: middle;\n pointer-events: none;\n fill: var(--vis-graph-node-bottom-icon-fill-color);\n stroke: var(--vis-graph-node-bottom-icon-stroke-color);\n stroke-width: var(--vis-graph-node-bottom-icon-stroke-width);\n\n :not(.${brushable}) {\n transition: .4s all;\n }\n`\n\nexport const nodeIsDragged = css`\n label: dragged;\n`\n\nexport const label = css`\n label: label;\n\n text-anchor: middle;\n font-weight: 300;\n font-size: var(--vis-graph-node-label-font-size);\n`\n\nexport const labelBackground = css`\n label: background;\n\n opacity: 0.9;\n -webkit-backdrop-filter: blur(2px);\n backdrop-filter: blur(2px);\n fill: var(--vis-graph-node-label-background);\n`\n\nexport const labelText = css`\n label: label-text;\n`\n\nexport const labelTextContent = css`\n label: label-text-content;\n\n fill: var(--vis-graph-node-label-text-color);\n font-family: var(--vis-graph-node-label-font-family, var(--vis-font-family));\n`\n\nexport const subLabelTextContent = css`\n label: sublabel-text-content;\n\n fill: var(--vis-graph-node-sublabel-text-color);\n font-family: var(--vis-graph-node-label-font-family, var(--vis-font-family));\n font-size: var(--vis-graph-node-sublabel-font-size);\n`\n\nexport const sideLabelsGroup = css`\n label: side-labels-group;\n`\n\nexport const sideLabelBackground = css`\n label: side-label-background;\n\n stroke-opacity: 0.8;\n stroke: var(--vis-graph-node-side-label-background-stroke-color);\n fill: var(--vis-graph-node-side-label-background-fill-color);\n`\n\nexport const sideLabel = css`\n label: side-label;\n\n font-family: var(--vis-graph-icon-font-family), var(--vis-font-family);\n dominant-baseline: var(--vis-graph-node-dominant-baseline);\n text-anchor: middle;\n font-size: 16px;\n fill: var(--vis-graph-node-side-label-fill-color-bright);\n`\n\nexport const sideLabelGroup = css`\n label: side-label-group;\n cursor: default;\n`\n\nexport const gNode = css`\n label: g-node;\n\n transition: .25s opacity;\n`\n\nexport const draggable = css`\n label: draggable;\n\n &:hover {\n cursor: grab;\n }\n\n &${`.${nodeIsDragged}`} {\n cursor: grabbing;\n }\n`\n\nexport const gNodeExit = css`\n label: g-node-exit;\n pointer-events: none;\n`\n\nexport const nodeSelectionActive = css`\n label: active;\n`\n\nexport const nodeSelection = css`\n label: node-selection;\n\n fill: none;\n stroke-width: 1;\n stroke-dasharray: 3 3;\n opacity: 0;\n transition: 350ms cubic-bezier(0.165, 0.840, 0.440, 1.000);\n transform: scale(.5);\n fill: var(--vis-graph-node-selection-color);\n fill-opacity: 0.1;\n stroke: var(--vis-graph-node-selection-color);\n stroke-opacity: 0.75;\n\n &${`.${nodeSelectionActive}`} {\n opacity: 1;\n transform: scale(1.2);\n }\n`\n\nexport const nodeGauge = css`\n label: node-gauge;\n\n fill: var(--vis-graph-node-gauge-color);\n transition: .4s fill;\n`\n\nexport const nodePolygon = css`\n label: polygon;\n\n ${`.${nodeGauge}`} {\n fill-opacity: 0;\n stroke-linecap: round;\n pointer-events: none;\n }\n`\n\nexport const customNode = css`\n label: custom-node;\n\n stroke-width: 0;\n`\n\nexport const greyedOutNode = css`\n label: greyed-out;\n opacity: var(--vis-graph-node-greyout-opacity);\n filter: var(--vis-graph-node-greyout-filter);\n\n ${`.${node}`} {\n fill: var(--vis-graph-node-greyout-color) !important;\n stroke: var(--vis-graph-node-greyout-color) !important;\n }\n\n ${`.${nodeIcon}`} {\n fill: var(--vis-graph-node-icon-greyout-color) !important;\n }\n\n ${`.${nodeGauge}`} {\n fill: var(--vis-graph-node-greyout-color) !important;\n stroke: var(--vis-graph-node-greyout-color) !important;\n }\n\n ${`.${label}`} {\n opacity: 0.5;\n }\n\n ${`.${sideLabelBackground}`} {\n fill: var(--vis-graph-node-side-label-background-greyout-color) !important;\n stroke-opacity: 0.5;\n }\n\n ${`.${sideLabel}`} {\n fill: var(--vis-graph-node-side-label-fill-color-bright) !important;\n opacity: 0.25;\n }\n`\n\nexport const brushed = css`\n label: brushed-node;\n\n ${`.${node}`} {\n stroke: var(--vis-graph-brushed-node-stroke-color);\n }\n ${`.${nodeIcon}`} {\n fill: var(--vis-graph-brushed-node-icon-fill-color);\n }\n ${`.${labelTextContent}`} {\n fill: var(--vis-graph-brushed-node-label-text-color);\n }\n`\n"],"names":[],"mappings":";;AAEO,MAAM,KAAK,GAAG,GAAG,CAAA;;EAEvB;AAEM,MAAM,SAAS,GAAG,YAAY,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyEjB,kBAAA,EAAA,CAAA,CAAA,EAAI,KAAK,CAAE,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;EAwB9B;AAEM,MAAM,SAAS,GAAG,GAAG,CAAA;;EAE3B;AAGM,MAAM,IAAI,GAAG,GAAG,CAAA;;;;;;UAMb,SAAS,CAAA;;;EAGlB;AAEM,MAAM,QAAQ,GAAG,GAAG,CAAA;;;;;;;;;UASjB,SAAS,CAAA;;;EAGlB;AAEM,MAAM,cAAc,GAAG,GAAG,CAAA;;;;;;;;;;;UAWvB,SAAS,CAAA;;;EAGlB;AAEM,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A;;;;AAId,EAAA,EAAA,CAAA,CAAA,EAAI,SAAS,CAAE,CAAA,CAAA;;;;;AAKf,EAAA,EAAA,CAAA,CAAA,EAAI,KAAK,CAAE,CAAA,CAAA;;;;AAIX,EAAA,EAAA,CAAA,CAAA,EAAI,mBAAmB,CAAE,CAAA,CAAA;;;;;AAKxB,GAAA,EAAA,CAAA,CAAA,EAAI,SAAS,CAAE,CAAA,CAAA;;;;EAInB;AAEM,MAAM,OAAO,GAAG,GAAG,CAAA;;;AAGtB,EAAA,EAAA,CAAA,CAAA,EAAI,IAAI,CAAE,CAAA,CAAA;;;AAGV,EAAA,EAAA,CAAA,CAAA,EAAI,QAAQ,CAAE,CAAA,CAAA;;;AAGd,EAAA,EAAA,CAAA,CAAA,EAAI,gBAAgB,CAAE,CAAA,CAAA;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"style.js","sources":["../../../../../src/components/graph/modules/node/style.ts"],"sourcesContent":["import { css, injectGlobal } from '@emotion/css'\n\nexport const nodes = css`\n label: nodes;\n`\n\nexport const variables = injectGlobal`\n :root {\n /* Node Fill */\n --vis-graph-node-stroke-color: rgb(206, 211, 222);\n --vis-graph-node-fill-color: #fff;\n --vis-graph-node-gauge-color: #adb4c2;\n --vis-graph-node-selection-color: #acb3b8;\n\n --vis-dark-graph-node-stroke-color: rgba(30,30,30,.25);\n --vis-dark-graph-node-fill-color: #494b56;\n --vis-dark-graph-node-gauge-color: #989aa3;\n --vis-dark-graph-node-selection-color: #494b56;\n\n /* Node Central Icon */\n --vis-graph-node-icon-fill-color-bright: #ffffff;\n --vis-graph-node-icon-fill-color-dark: var(--vis-color-grey);\n --vis-graph-node-icon-fill-color: #9ea7b8;\n\n --vis-dark-graph-node-icon-fill-color: var(--vis-graph-node-icon-fill-color-bright);\n\n /* Node Bottom Icon */\n --vis-graph-node-bottom-icon-font-size: 14pt;\n --vis-graph-node-bottom-icon-fill-color: #a0a6ad;\n --vis-graph-node-bottom-icon-stroke-color: #fff;\n --vis-graph-node-bottom-icon-stroke-width: 2px;\n\n --vis-dark-graph-node-bottom-icon-fill-color: #a0a6ad;\n --vis-dark-graph-node-bottom-icon-stroke-color: #fff;\n\n /* Node Label */\n --vis-graph-node-label-font-size: 9pt;\n --vis-graph-node-label-background: #ffffff;\n --vis-graph-node-label-text-color: #0F1E57;\n --vis-graph-node-sublabel-text-color: #989aa3;\n --vis-graph-node-sublabel-font-size: 8pt;\n // Undefined by default to allow proper fallback to var(--vis-font-family)\n /* --vis-graph-node-label-font-family: */\n\n --vis-dark-graph-node-label-background: var(--vis-color-grey);\n --vis-dark-graph-node-label-text-color: #ffffff;\n --vis-dark-graph-node-sublabel-text-color: #989aa3;\n\n /* Node Side Labels (circular labels)*/\n --vis-graph-node-side-label-background-fill-color: #a0a9af;\n --vis-graph-node-side-label-background-stroke-color: #ffffff;\n --vis-graph-node-side-label-fill-color-bright: #ffffff;\n --vis-graph-node-side-label-fill-color-dark: #494b56;\n\n --vis-dark-graph-node-side-label-background-fill-color: #989aa3;\n --vis-dark-graph-node-side-label-background-stroke-color: var(--vis-color-grey);\n --vis-dark-graph-node-side-label-fill-color-bright: #f1f4f7;\n --vis-dark-graph-node-side-label-fill-color-dark: var(--vis-color-grey);\n\n /* Greyout */\n --vis-graph-node-greyout-opacity: 0.9;\n --vis-graph-node-greyout-filter: none;\n --vis-graph-node-greyout-color: #ebeff7;\n --vis-graph-node-icon-greyout-color: #c6cad1;\n --vis-graph-node-side-label-background-greyout-color: #f1f4f7;\n\n --vis-dark-graph-node-greyout-color: #494b56;\n --vis-dark-graph-node-icon-greyout-color: var(--vis-color-grey);\n --vis-dark-graph-node-side-label-background-greyout-color: #494B56;\n\n /* Brushed */\n --vis-graph-brushed-node-stroke-color: var(--vis-color-main);\n --vis-graph-brushed-node-label-text-color: var(--vis-color-main);\n --vis-graph-brushed-node-icon-fill-color: var(--vis-color-main);\n \n /* Misc */\n --vis-graph-node-dominant-baseline: middle;\n }\n\n body.theme-dark ${`.${nodes}`} {\n --vis-graph-node-stroke-color: var(--vis-dark-graph-node-stroke-color);\n --vis-graph-node-fill-color: var(--vis-dark-graph-node-fill-color);\n --vis-graph-node-gauge-color: var(--vis-dark-graph-node-gauge-color);\n --vis-graph-node-selection-color: var(--vis-dark-graph-node-selection-color);\n\n --vis-graph-node-icon-fill-color: var(--vis-dark-graph-node-icon-fill-color);\n\n --vis-graph-node-bottom-icon-fill-color: var(--vis-dark-graph-node-bottom-icon-fill-color);\n --vis-graph-node-bottom-icon-stroke-color: var(--vis-dark-graph-node-bottom-icon-stroke-color);\n\n --vis-graph-node-label-background: var(--vis-dark-graph-node-label-background);\n --vis-graph-node-label-text-color: var(--vis-dark-graph-node-label-text-color);\n --vis-graph-node-sublabel-text-color: var(--vis-dark-graph-node-sublabel-text-color);\n\n --vis-graph-node-side-label-background-fill-color: var(--vis-dark-graph-node-side-label-background-fill-color);\n --vis-graph-node-side-label-background-stroke-color: var(--vis-dark-graph-side-label-background-stroke-color);\n --vis-graph-node-side-label-fill-color-bright: var(--vis-dark-graph-node-side-label-fill-color-bright);\n --vis-graph-node-side-label-fill-color-dark: var(vis-dark-graph-node-side-label-fill-color-dark);\n\n --vis-graph-node-greyout-color: var(--vis-dark-graph-node-greyout-color);\n --vis-graph-node-icon-greyout-color: var(--vis-dark-graph-node-icon-greyout-color);\n --vis-graph-node-side-label-background-greyout-color: var(--vis-dark-graph-node-side-label-background-greyout-color);\n }\n`\n\nexport const brushable = css`\n label: brushable;\n`\n\n\nexport const node = css`\n label: node-shape;\n\n stroke: var(--vis-graph-node-stroke-color);\n fill: var(--vis-graph-node-fill-color);\n\n :not(.${brushable}) {\n transition: .4s fill, 4s stroke;\n }\n`\n\nexport const nodeIcon = css`\n label: icon;\n\n font-family: var(--vis-graph-icon-font-family), var(--vis-font-family);\n dominant-baseline: var(--vis-graph-node-dominant-baseline);\n text-anchor: middle;\n pointer-events: none;\n fill: var(--vis-graph-node-icon-fill-color);\n\n :not(.${brushable}) {\n transition: .4s all;\n }\n`\n\nexport const nodeBottomIcon = css`\n label: node-bottom-icon;\n font-family: var(--vis-graph-icon-font-family), var(--vis-font-family);\n font-size: var(--vis-graph-node-bottom-icon-font-size);\n dominant-baseline: var(--vis-graph-node-dominant-baseline);\n text-anchor: middle;\n pointer-events: none;\n fill: var(--vis-graph-node-bottom-icon-fill-color);\n stroke: var(--vis-graph-node-bottom-icon-stroke-color);\n stroke-width: var(--vis-graph-node-bottom-icon-stroke-width);\n\n :not(.${brushable}) {\n transition: .4s all;\n }\n`\n\nexport const nodeIsDragged = css`\n label: dragged;\n`\n\nexport const label = css`\n label: label;\n\n text-anchor: middle;\n font-weight: 300;\n font-size: var(--vis-graph-node-label-font-size);\n`\n\nexport const labelBackground = css`\n label: background;\n\n opacity: 0.9;\n -webkit-backdrop-filter: blur(2px);\n backdrop-filter: blur(2px);\n fill: var(--vis-graph-node-label-background);\n`\n\nexport const labelText = css`\n label: label-text;\n`\n\nexport const labelTextContent = css`\n label: label-text-content;\n\n fill: var(--vis-graph-node-label-text-color);\n font-family: var(--vis-graph-node-label-font-family, var(--vis-font-family));\n`\n\nexport const subLabelTextContent = css`\n label: sublabel-text-content;\n\n fill: var(--vis-graph-node-sublabel-text-color);\n font-family: var(--vis-graph-node-label-font-family, var(--vis-font-family));\n font-size: var(--vis-graph-node-sublabel-font-size);\n`\n\nexport const sideLabelsGroup = css`\n label: side-labels-group;\n`\n\nexport const sideLabelBackground = css`\n label: side-label-background;\n\n stroke-opacity: 0.8;\n stroke: var(--vis-graph-node-side-label-background-stroke-color);\n fill: var(--vis-graph-node-side-label-background-fill-color);\n`\n\nexport const sideLabel = css`\n label: side-label;\n\n font-family: var(--vis-graph-icon-font-family), var(--vis-font-family);\n dominant-baseline: var(--vis-graph-node-dominant-baseline);\n text-anchor: middle;\n font-size: 16px;\n fill: var(--vis-graph-node-side-label-fill-color-bright);\n`\n\nexport const sideLabelGroup = css`\n label: side-label-group;\n cursor: default;\n`\n\nexport const gNode = css`\n label: g-node;\n\n transition: .25s opacity;\n`\n\nexport const draggable = css`\n label: draggable;\n\n &:hover {\n cursor: grab;\n }\n\n &${`.${nodeIsDragged}`} {\n cursor: grabbing;\n }\n`\n\nexport const gNodeExit = css`\n label: g-node-exit;\n pointer-events: none;\n`\n\nexport const nodeSelectionActive = css`\n label: active;\n`\n\nexport const nodeSelection = css`\n label: node-selection;\n\n fill: none;\n stroke-width: 1;\n stroke-dasharray: 3 3;\n opacity: 0;\n transition: 350ms cubic-bezier(0.165, 0.840, 0.440, 1.000);\n transform: scale(.5);\n fill: var(--vis-graph-node-selection-color);\n fill-opacity: 0.1;\n stroke: var(--vis-graph-node-selection-color);\n stroke-opacity: 0.75;\n\n &${`.${nodeSelectionActive}`} {\n opacity: 1;\n transform: scale(1.2);\n }\n`\n\nexport const nodeGauge = css`\n label: node-gauge;\n\n fill: var(--vis-graph-node-gauge-color);\n transition: .4s fill;\n`\n\nexport const nodePolygon = css`\n label: polygon;\n\n ${`.${nodeGauge}`} {\n fill-opacity: 0;\n stroke-linecap: round;\n pointer-events: none;\n }\n`\n\nexport const customNode = css`\n label: custom-node;\n\n stroke-width: 0;\n`\n\nexport const greyedOutNode = css`\n label: greyed-out;\n opacity: var(--vis-graph-node-greyout-opacity);\n filter: var(--vis-graph-node-greyout-filter);\n\n ${`.${node}`} {\n fill: var(--vis-graph-node-greyout-color) !important;\n stroke: var(--vis-graph-node-greyout-color) !important;\n }\n\n ${`.${nodeIcon}`} {\n fill: var(--vis-graph-node-icon-greyout-color) !important;\n }\n\n ${`.${nodeGauge}`} {\n fill: var(--vis-graph-node-greyout-color) !important;\n stroke: var(--vis-graph-node-greyout-color) !important;\n }\n\n ${`.${label}`} {\n opacity: 0.5;\n }\n\n ${`.${sideLabelBackground}`} {\n fill: var(--vis-graph-node-side-label-background-greyout-color) !important;\n stroke-opacity: 0.5;\n }\n\n ${`.${sideLabel}`} {\n fill: var(--vis-graph-node-side-label-fill-color-bright) !important;\n opacity: 0.25;\n }\n`\n\nexport const brushed = css`\n label: brushed-node;\n\n ${`.${node}`} {\n stroke: var(--vis-graph-brushed-node-stroke-color);\n }\n ${`.${nodeIcon}`} {\n fill: var(--vis-graph-brushed-node-icon-fill-color);\n }\n ${`.${labelTextContent}`} {\n fill: var(--vis-graph-brushed-node-label-text-color);\n }\n`\n"],"names":[],"mappings":";;AAEO,MAAM,KAAK,GAAG,GAAG,CAAA,CAAA;;EAEvB;AAEM,MAAM,SAAS,GAAG,YAAY,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyEjB,kBAAA,EAAA,CAAA,CAAA,EAAI,KAAK,CAAE,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;EAwB9B;AAEM,MAAM,SAAS,GAAG,GAAG,CAAA,CAAA;;EAE3B;AAGM,MAAM,IAAI,GAAG,GAAG,CAAA,CAAA;;;;;;UAMb,SAAS,CAAA;;;EAGlB;AAEM,MAAM,QAAQ,GAAG,GAAG,CAAA,CAAA;;;;;;;;;UASjB,SAAS,CAAA;;;EAGlB;AAEM,MAAM,cAAc,GAAG,GAAG,CAAA,CAAA;;;;;;;;;;;UAWvB,SAAS,CAAA;;;EAGlB;AAEM,MAAM,aAAa,GAAG,GAAG,CAAA,CAAA;;EAE/B;AAEM,MAAM,KAAK,GAAG,GAAG,CAAA,CAAA;;;;;;EAMvB;AAEM,MAAM,eAAe,GAAG,GAAG,CAAA,CAAA;;;;;;;EAOjC;AAEM,MAAM,SAAS,GAAG,GAAG,CAAA,CAAA;;EAE3B;AAEM,MAAM,gBAAgB,GAAG,GAAG,CAAA,CAAA;;;;;EAKlC;AAEM,MAAM,mBAAmB,GAAG,GAAG,CAAA,CAAA;;;;;;EAMrC;AAEM,MAAM,eAAe,GAAG,GAAG,CAAA,CAAA;;EAEjC;AAEM,MAAM,mBAAmB,GAAG,GAAG,CAAA,CAAA;;;;;;EAMrC;AAEM,MAAM,SAAS,GAAG,GAA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AAA,EAAI,IAAI,CAAE,CAAA,CAAA;;;AAGV,EAAA,EAAA,CAAA,CAAA,EAAI,QAAQ,CAAE,CAAA,CAAA;;;AAGd,EAAA,EAAA,CAAA,CAAA,EAAI,gBAAgB,CAAE,CAAA,CAAA;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.js","sources":["../../../../../src/components/graph/modules/panel/style.ts"],"sourcesContent":["import { css, injectGlobal } from '@emotion/css'\n\nexport const panels = css`\n label: panels;\n`\n\nexport const variables = injectGlobal`\n :root {\n --vis-graph-panel-border-color: #E6E9F3;\n --vis-graph-panel-border-opacity: 0.9;\n --vis-graph-panel-fill-color: #ffffff;\n\n --vis-graph-panel-label-color: #6c778c;\n --vis-graph-panel-label-background: #ffffff;\n\n // Undefined by default to allow proper fallback to var(--vis-font-family)\n /* --vis-graph-panel-label-font-family: */\n --vis-graph-panel-label-font-size: 10pt;\n --vis-graph-panel-label-font-weight: 300;\n\n --vis-graph-panel-dashed-outline-color: #b7b7b7;\n\n --vis-graph-panel-side-icon-symbol-color: #9ea7b8;\n --vis-graph-panel-side-icon-shape-fill-color: #ffffff;\n\n --vis-dark-graph-panel-border-color: var(--vis-color-grey);\n --vis-dark-graph-panel-fill-color: #292b34;\n --vis-dark-graph-panel-label-color: #E6E9F3;\n --vis-dark-graph-panel-label-background: var(--vis-color-grey);\n --vis-dark-graph-panel-side-icon-symbol-color: #ffffff;\n --vis-dark-graph-panel-side-icon-shape-fill-color: #6c778c;\n --vis-dark-graph-panel-border-color: #a0a6ad;\n }\n\n body.theme-dark ${`.${panels}`} {\n --vis-graph-panel-border-color: var(--vis-dark-graph-panel-border-color);\n --vis-graph-panel-fill-color: var(--vis-dark-graph-panel-fill-color);\n --vis-graph-panel-label-color: var(--vis-dark-graph-panel-label-color);\n --vis-graph-panel-label-background: var(--vis-dark-graph-panel-label-background);\n --vis-graph-panel-side-icon-symbol-color: var(--vis-dark-graph-panel-side-icon-symbol-color);\n --vis-graph-panel-side-icon-shape-fill-color: var(--vis-dark-graph-panel-side-icon-shape-fill-color);\n --vis-graph-panel-border-color: var(--vis-dark-graph-panel-border-color);\n }\n`\n\nexport const gPanel = css`\n label: g-panel;\n`\n\nexport const panel = css`\n label: panel;\n\n stroke: var(--vis-graph-panel-border-color);\n stroke-opacity: var(--vis-graph-panel-border-opacity);\n fill: var(--vis-graph-panel-fill-color);\n`\n\nexport const label = css`\n label: label;\n\n fill: var(--vis-graph-panel-label-color);\n`\n\nexport const background = css`\n label: background;\n\n opacity: 0.9;\n -webkit-backdrop-filter: blur(2px);\n backdrop-filter: blur(2px);\n fill: var(--vis-graph-panel-label-background);\n stroke: none;\n`\n\nexport const labelText = css`\n label: label-text;\n\n text-anchor: middle;\n font-size: var(--vis-graph-panel-label-font-size);\n font-weight: var(--vis-graph-panel-label-font-weight);;\n cursor: default;\n stroke: none;\n font-family: var(--vis-graph-panel-label-font-family, var(--vis-font-family));\n`\n\nexport const panelSelectionActive = css`\n label: active;\n`\n\nexport const panelSelection = css`\n label: panel-selection-outline;\n\n opacity: 0;\n stroke-width: 1;\n stroke-dasharray: 3 3;\n fill: var(--vis-graph-node-selection-color);\n fill-opacity: 0.1;\n stroke: var(--vis-graph-panel-dashed-outline-color);\n stroke-opacity: 0;\n\n &${`.${panelSelectionActive}`} {\n opacity: 1;\n stroke-opacity: 0.75;\n }\n`\n\nexport const greyout = css`\n label: greyout;\n opacity: 0.4;\n`\n\nexport const sideIconGroup = css`\n label: side-icon-group;\n`\n\nexport const sideIconShape = css`\n label: side-icon-shape;\n\n fill: var(--vis-graph-panel-side-icon-shape-fill-color);\n stroke-width: 2px;\n`\n\nexport const customSideIcon = css`\n label: side-icon-custom;\n`\n\nexport const sideIconSymbol = css`\n label: side-label-icon-text;\n font-family: var(--vis-graph-icon-font-family), var(--vis-font-family);\n fill: var(--vis-graph-panel-side-icon-symbol-color);\n stroke: none;\n dominant-baseline: middle;\n text-anchor: middle;\n pointer-events: none;\n cursor: default;\n`\n"],"names":[],"mappings":";;AAEO,MAAM,MAAM,GAAG,GAAG,CAAA;;EAExB;AAEM,MAAM,SAAS,GAAG,YAAY,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BjB,kBAAA,EAAA,CAAA,CAAA,EAAI,MAAM,CAAE,CAAA,CAAA;;;;;;;;;EAS/B;AAEM,MAAM,MAAM,GAAG,GAAG,CAAA;;EAExB;AAEM,MAAM,KAAK,GAAG,GAAG,CAAA;;;;;;EAMvB;AAEM,MAAM,KAAK,GAAG,GAAG,CAAA;;;;EAIvB;AAEM,MAAM,UAAU,GAAG,GAAG,CAAA;;;;;;;;EAQ5B;AAEM,MAAM,SAAS,GAAG,GAAG,CAAA;;;;;;;;;EAS3B;AAEM,MAAM,oBAAoB,GAAG,GAAG,CAAA;;EAEtC;AAEM,MAAM,cAAc,GAAG,GAAG,CAAA;;;;;;;;;;;AAW5B,GAAA,EAAA,CAAA,CAAA,EAAI,oBAAoB,CAAE,CAAA,CAAA;;;;EAI9B;AAEM,MAAM,OAAO,GAAG,GAAG,CAAA;;;EAGzB;AAEM,MAAM,aAAa,GAAG,GAAG,CAAA;;EAE/B;AAEM,MAAM,aAAa,GAAG,GAAG,CAAA;;;;;EAK/B;AAEM,MAAM,cAAc,GAAG,GAAG,CAAA;;EAEhC;AAEM,MAAM,cAAc,GAAG,GAAG,CAAA;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"style.js","sources":["../../../../../src/components/graph/modules/panel/style.ts"],"sourcesContent":["import { css, injectGlobal } from '@emotion/css'\n\nexport const panels = css`\n label: panels;\n`\n\nexport const variables = injectGlobal`\n :root {\n --vis-graph-panel-border-color: #E6E9F3;\n --vis-graph-panel-border-opacity: 0.9;\n --vis-graph-panel-fill-color: #ffffff;\n\n --vis-graph-panel-label-color: #6c778c;\n --vis-graph-panel-label-background: #ffffff;\n\n // Undefined by default to allow proper fallback to var(--vis-font-family)\n /* --vis-graph-panel-label-font-family: */\n --vis-graph-panel-label-font-size: 10pt;\n --vis-graph-panel-label-font-weight: 300;\n\n --vis-graph-panel-dashed-outline-color: #b7b7b7;\n\n --vis-graph-panel-side-icon-symbol-color: #9ea7b8;\n --vis-graph-panel-side-icon-shape-fill-color: #ffffff;\n\n --vis-dark-graph-panel-border-color: var(--vis-color-grey);\n --vis-dark-graph-panel-fill-color: #292b34;\n --vis-dark-graph-panel-label-color: #E6E9F3;\n --vis-dark-graph-panel-label-background: var(--vis-color-grey);\n --vis-dark-graph-panel-side-icon-symbol-color: #ffffff;\n --vis-dark-graph-panel-side-icon-shape-fill-color: #6c778c;\n --vis-dark-graph-panel-border-color: #a0a6ad;\n }\n\n body.theme-dark ${`.${panels}`} {\n --vis-graph-panel-border-color: var(--vis-dark-graph-panel-border-color);\n --vis-graph-panel-fill-color: var(--vis-dark-graph-panel-fill-color);\n --vis-graph-panel-label-color: var(--vis-dark-graph-panel-label-color);\n --vis-graph-panel-label-background: var(--vis-dark-graph-panel-label-background);\n --vis-graph-panel-side-icon-symbol-color: var(--vis-dark-graph-panel-side-icon-symbol-color);\n --vis-graph-panel-side-icon-shape-fill-color: var(--vis-dark-graph-panel-side-icon-shape-fill-color);\n --vis-graph-panel-border-color: var(--vis-dark-graph-panel-border-color);\n }\n`\n\nexport const gPanel = css`\n label: g-panel;\n`\n\nexport const panel = css`\n label: panel;\n\n stroke: var(--vis-graph-panel-border-color);\n stroke-opacity: var(--vis-graph-panel-border-opacity);\n fill: var(--vis-graph-panel-fill-color);\n`\n\nexport const label = css`\n label: label;\n\n fill: var(--vis-graph-panel-label-color);\n`\n\nexport const background = css`\n label: background;\n\n opacity: 0.9;\n -webkit-backdrop-filter: blur(2px);\n backdrop-filter: blur(2px);\n fill: var(--vis-graph-panel-label-background);\n stroke: none;\n`\n\nexport const labelText = css`\n label: label-text;\n\n text-anchor: middle;\n font-size: var(--vis-graph-panel-label-font-size);\n font-weight: var(--vis-graph-panel-label-font-weight);;\n cursor: default;\n stroke: none;\n font-family: var(--vis-graph-panel-label-font-family, var(--vis-font-family));\n`\n\nexport const panelSelectionActive = css`\n label: active;\n`\n\nexport const panelSelection = css`\n label: panel-selection-outline;\n\n opacity: 0;\n stroke-width: 1;\n stroke-dasharray: 3 3;\n fill: var(--vis-graph-node-selection-color);\n fill-opacity: 0.1;\n stroke: var(--vis-graph-panel-dashed-outline-color);\n stroke-opacity: 0;\n\n &${`.${panelSelectionActive}`} {\n opacity: 1;\n stroke-opacity: 0.75;\n }\n`\n\nexport const greyout = css`\n label: greyout;\n opacity: 0.4;\n`\n\nexport const sideIconGroup = css`\n label: side-icon-group;\n`\n\nexport const sideIconShape = css`\n label: side-icon-shape;\n\n fill: var(--vis-graph-panel-side-icon-shape-fill-color);\n stroke-width: 2px;\n`\n\nexport const customSideIcon = css`\n label: side-icon-custom;\n`\n\nexport const sideIconSymbol = css`\n label: side-label-icon-text;\n font-family: var(--vis-graph-icon-font-family), var(--vis-font-family);\n fill: var(--vis-graph-panel-side-icon-symbol-color);\n stroke: none;\n dominant-baseline: middle;\n text-anchor: middle;\n pointer-events: none;\n cursor: default;\n`\n"],"names":[],"mappings":";;AAEO,MAAM,MAAM,GAAG,GAAG,CAAA,CAAA;;EAExB;AAEM,MAAM,SAAS,GAAG,YAAY,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BjB,kBAAA,EAAA,CAAA,CAAA,EAAI,MAAM,CAAE,CAAA,CAAA;;;;;;;;;EAS/B;AAEM,MAAM,MAAM,GAAG,GAAG,CAAA,CAAA;;EAExB;AAEM,MAAM,KAAK,GAAG,GAAG,CAAA,CAAA;;;;;;EAMvB;AAEM,MAAM,KAAK,GAAG,GAAG,CAAA,CAAA;;;;EAIvB;AAEM,MAAM,UAAU,GAAG,GAAG,CAAA,CAAA;;;;;;;;EAQ5B;AAEM,MAAM,SAAS,GAAG,GAAG,CAAA,CAAA;;;;;;;;;EAS3B;AAEM,MAAM,oBAAoB,GAAG,GAAG,CAAA,CAAA;;EAEtC;AAEM,MAAM,cAAc,GAAG,GAAG,CAAA,CAAA;;;;;;;;;;;AAW5B,GAAA,EAAA,CAAA,CAAA,EAAI,oBAAoB,CAAE,CAAA,CAAA;;;;EAI9B;AAEM,MAAM,OAAO,GAAG,GAAG,CAAA,CAAA;;;EAGzB;AAEM,MAAM,aAAa,GAAG,GAAG,CAAA,CAAA;;EAE/B;AAEM,MAAM,aAAa,GAAG,GAAG,CAAA,CAAA;;;;;EAK/B;AAEM,MAAM,cAAc,GAAG,GAAG,CAAA,CAAA;;EAEhC;AAEM,MAAM,cAAc,GAAG,GAAG,CAAA,CAAA;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.js","sources":["../../../src/components/graph/style.ts"],"sourcesContent":["import { css, injectGlobal } from '@emotion/css'\nimport { UNOVIS_ICON_FONT_FAMILY_DEFAULT } from 'styles/index'\n\n// Nodes\nimport * as nodeSelectors from './modules/node/style'\n\n// Links\nimport * as linkSelectors from './modules/link/style'\n\nexport const variables = injectGlobal`\n :root {\n --vis-graph-icon-font-family: ${UNOVIS_ICON_FONT_FAMILY_DEFAULT};\n\n /* Brush */\n --vis-graph-brush-selection-opacity: 0.2;\n }\n`\n\n// General\nexport const root = css`\n label: graph-component;\n`\n\nexport const background = css`\n label: background;\n`\n\nexport const graphGroup = css`\n label: graph-group;\n`\n\nexport const brush = css`\n label: brush;\n\n :not(.active) {\n display: none;\n }\n\n .active {\n .selection {\n fill-opacity: 0;\n stroke: none;\n }\n\n .handle {\n display: none;\n }\n }\n`\n\nexport const zoomOutLevel1 = css`\n label: zoom-out-level-1;\n\n ${`.${nodeSelectors.label}`} {\n rect {\n stroke: none;\n }\n }\n`\n\nexport const zoomOutLevel2 = css`\n label: zoom-out-level-2;\n\n ${`.${nodeSelectors.label}`} {\n visibility: visible;\n }\n\n ${`.${nodeSelectors.nodeGauge}`} {\n visibility: visible;\n }\n\n ${`.${nodeSelectors.node}`} {\n stroke-width: 4px;\n }\n\n rect${`.${nodeSelectors.node}`} {\n stroke-width: 2px;\n }\n\n ${`.${linkSelectors.gLink}`} {\n animation: none;\n stroke-dasharray: none;\n }\n\n ${`.${linkSelectors.flowCircle}`} {\n display: none;\n }\n\n ${`.${nodeSelectors.nodeSelection}`} {\n &${`.${nodeSelectors.nodeSelectionActive}`} {\n transform: scale(1.15);\n }\n }\n`\n"],"names":["nodeSelectors.label","nodeSelectors.nodeGauge","nodeSelectors.node","linkSelectors.gLink","linkSelectors.flowCircle","nodeSelectors.nodeSelection","nodeSelectors.nodeSelectionActive"],"mappings":";;;;;AASO,MAAM,SAAS,GAAG,YAAY,CAAA;;oCAED,+BAA+B,CAAA;;;;;EAKlE;AAED;AACO,MAAM,IAAI,GAAG,GAAG,CAAA;;EAEtB;AAEM,MAAM,UAAU,GAAG,GAAG,CAAA;;EAE5B;AAEM,MAAM,UAAU,GAAG,GAAG,CAAA;;EAE5B;AAEM,MAAM,KAAK,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;EAiBvB;AAEM,MAAM,aAAa,GAAG,GAAG,CAAA;;;IAG5B,CAAI,CAAA,EAAAA,KAAmB,CAAE,CAAA,CAAA;;;;;EAK5B;AAEM,MAAM,aAAa,GAAG,GAAG,CAAA;;;IAG5B,CAAI,CAAA,EAAAA,KAAmB,CAAE,CAAA,CAAA;;;;IAIzB,CAAI,CAAA,EAAAC,SAAuB,CAAE,CAAA,CAAA;;;;IAI7B,CAAI,CAAA,EAAAC,IAAkB,CAAE,CAAA,CAAA;;;;QAIpB,CAAI,CAAA,EAAAA,IAAkB,CAAE,CAAA,CAAA;;;;IAI5B,CAAI,CAAA,EAAAC,KAAmB,CAAE,CAAA,CAAA;;;;;IAKzB,CAAI,CAAA,EAAAC,UAAwB,CAAE,CAAA,CAAA;;;;IAI9B,CAAI,CAAA,EAAAC,aAA2B,CAAE,CAAA,CAAA;OAC9B,CAAI,CAAA,EAAAC,mBAAiC,CAAE,CAAA,CAAA;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"style.js","sources":["../../../src/components/graph/style.ts"],"sourcesContent":["import { css, injectGlobal } from '@emotion/css'\nimport { UNOVIS_ICON_FONT_FAMILY_DEFAULT } from 'styles/index'\n\n// Nodes\nimport * as nodeSelectors from './modules/node/style'\n\n// Links\nimport * as linkSelectors from './modules/link/style'\n\nexport const variables = injectGlobal`\n :root {\n --vis-graph-icon-font-family: ${UNOVIS_ICON_FONT_FAMILY_DEFAULT};\n\n /* Brush */\n --vis-graph-brush-selection-opacity: 0.2;\n }\n`\n\n// General\nexport const root = css`\n label: graph-component;\n`\n\nexport const background = css`\n label: background;\n`\n\nexport const graphGroup = css`\n label: graph-group;\n`\n\nexport const brush = css`\n label: brush;\n\n :not(.active) {\n display: none;\n }\n\n .active {\n .selection {\n fill-opacity: 0;\n stroke: none;\n }\n\n .handle {\n display: none;\n }\n }\n`\n\nexport const zoomOutLevel1 = css`\n label: zoom-out-level-1;\n\n ${`.${nodeSelectors.label}`} {\n rect {\n stroke: none;\n }\n }\n`\n\nexport const zoomOutLevel2 = css`\n label: zoom-out-level-2;\n\n ${`.${nodeSelectors.label}`} {\n visibility: visible;\n }\n\n ${`.${nodeSelectors.nodeGauge}`} {\n visibility: visible;\n }\n\n ${`.${nodeSelectors.node}`} {\n stroke-width: 4px;\n }\n\n rect${`.${nodeSelectors.node}`} {\n stroke-width: 2px;\n }\n\n ${`.${linkSelectors.gLink}`} {\n animation: none;\n stroke-dasharray: none;\n }\n\n ${`.${linkSelectors.flowCircle}`} {\n display: none;\n }\n\n ${`.${nodeSelectors.nodeSelection}`} {\n &${`.${nodeSelectors.nodeSelectionActive}`} {\n transform: scale(1.15);\n }\n }\n`\n"],"names":["nodeSelectors.label","nodeSelectors.nodeGauge","nodeSelectors.node","linkSelectors.gLink","linkSelectors.flowCircle","nodeSelectors.nodeSelection","nodeSelectors.nodeSelectionActive"],"mappings":";;;;;AASO,MAAM,SAAS,GAAG,YAAY,CAAA,CAAA;;oCAED,+BAA+B,CAAA;;;;;EAKlE;AAED;AACO,MAAM,IAAI,GAAG,GAAG,CAAA,CAAA;;EAEtB;AAEM,MAAM,UAAU,GAAG,GAAG,CAAA,CAAA;;EAE5B;AAEM,MAAM,UAAU,GAAG,GAAG,CAAA,CAAA;;EAE5B;AAEM,MAAM,KAAK,GAAG,GAAG,CAAA,CAAA;;;;;;;;;;;;;;;;;EAiBvB;AAEM,MAAM,aAAa,GAAG,GAAG,CAAA,CAAA;;;IAG5B,CAAI,CAAA,EAAAA,KAAmB,CAAE,CAAA,CAAA;;;;;EAK5B;AAEM,MAAM,aAAa,GAAG,GAAG,CAAA,CAAA;;;IAG5B,CAAI,CAAA,EAAAA,KAAmB,CAAE,CAAA,CAAA;;;;IAIzB,CAAI,CAAA,EAAAC,SAAuB,CAAE,CAAA,CAAA;;;;IAI7B,CAAI,CAAA,EAAAC,IAAkB,CAAE,CAAA,CAAA;;;;QAIpB,CAAI,CAAA,EAAAA,IAAkB,CAAE,CAAA,CAAA;;;;IAI5B,CAAI,CAAA,EAAAC,KAAmB,CAAE,CAAA,CAAA;;;;;IAKzB,CAAI,CAAA,EAAAC,UAAwB,CAAE,CAAA,CAAA;;;;IAI9B,CAAI,CAAA,EAAAC,aAA2B,CAAE,CAAA,CAAA;OAC9B,CAAI,CAAA,EAAAC,mBAAiC,CAAE,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;;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
|
+
{"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,CAAA;;EAEtB;AAEM,MAAM,YAAY,GAAG,YAAY,CAAA,CAAA;;;;;;;;;;;;;;AAcpB,kBAAA,EAAA,CAAA,CAAA,EAAI,IAAI,CAAE,CAAA,CAAA;;;EAG7B;AAEM,MAAM,GAAG,GAAG,GAAG,CAAA,CAAA;;;;;;;;;;;EAWrB;AAEM,MAAM,QAAQ,GAAG,GAAG,CAAA,CAAA;;EAE1B;AAEM,MAAM,YAAY,GAAG,GAAG,CAAA,CAAA;;;;;;"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { LeafletMapDefaultConfig } from '../leaflet-map/config.js';
|
|
2
2
|
|
|
3
3
|
/* eslint-disable dot-notation */
|
|
4
|
-
// Config
|
|
5
4
|
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 });
|
|
6
5
|
|
|
7
6
|
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;AAwCa,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;;;;;;;;;;EAUrB;AACY,MAAA,QAAQ,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,CAAA;;;;;;;;;;EAUrB;AACY,MAAA,QAAQ,GAAG,CAAA;;;;;;;;;;;;;;;;"}
|
|
@@ -2,7 +2,6 @@ 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
|
|
6
5
|
const LeafletMapDefaultConfig = Object.assign(Object.assign({}, ComponentDefaultConfig), {
|
|
7
6
|
// General
|
|
8
7
|
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;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;;;;"}
|
|
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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ateTopoJson(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
|
|
79
|
+
const { style, renderer, topoJSONLayer } = config;
|
|
80
80
|
const leaflet = yield import('leaflet');
|
|
81
81
|
const L = leaflet.default;
|
|
82
|
-
if (!style
|
|
82
|
+
if (!style) {
|
|
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);
|
|
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":["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,OA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WAAW,CAAC,qBAAqB,CAAC,KAAK,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;gBACxF,iBAAiB,CAAC,KAAK,CAAC,QAAQ,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
|
+
{"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,IAA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BACrD,MAAM,KAAK,GAAG,WAAW,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAA;AAC7C,gBAAA,IAAI,CAAC,KAAK;oBAAE,OAAM;AAElB,gBAAA,MAAM,QAAQ,GAAG,WAAW,CAAC,qBAAqB,CAAC,KAAK,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;gBACxF,iBAAiB,CAAC,KAAK,CAAC,QAAQ,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":[],"mappings":"AAAA;AACO,SAAS,eAAe,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE;AAC7D;AACA,EAAE,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC;AACrC,IAAI,OAAO,EAAE;AACb,MAAM,cAAc,EAAE,EAAE;AACxB;AACA;AACA,MAAM,OAAO,EAAE,GAAG;AAClB;AACA;AACA,MAAM,WAAW,EAAE,KAAK;AACxB;AACA,MAAM,IAAI,EAAE,UAAU;AACtB,KAAK;;AAEL,IAAI,UAAU,EAAE,UAAU,OAAO,EAAE;AACnC,MAAM,OAAO,CAAC,UAAU,CAAC,IAAI,EAAE,OAAO;;AAEtC;AACA,MAAM,IAAI,CAAC,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,IAAI;AACnG,KAAK;;AAEL,IAAI,KAAK,EAAE,UAAU,GAAG,EAAE;AAC1B,MAAM,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;AAC5B,QAAQ,IAAI,CAAC,cAAc;AAC3B;;AAEA,MAAM,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW;AACvC,MAAM,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU;;AAEvD,MAAM,IAAI,CAAC,OAAO;;AAElB,MAAM,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC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CAAC,EAAE;AAC1B,MAAM,IAAI,CAAC,cAAc,CAAC,CAAC;AAC3B,KAAK;AACL,GAAG;;AAEH,EAAE,OAAO,IAAI,KAAK,CAAC,OAAO;AAC1B;;;;"}
|
|
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":"AAAA;AACO,SAAS,eAAe,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE;AAC7D;AACA,EAAE,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC;AACrC,IAAI,OAAO,EAAE;AACb,MAAM,cAAc,EAAE,EAAE;AACxB;AACA;AACA,MAAM,OAAO,EAAE,GAAG;AAClB;AACA;AACA,MAAM,WAAW,EAAE,KAAK;AACxB;AACA,MAAM,IAAI,EAAE,UAAU;AACtB,KAAK;AACL;AACA,IAAI,UAAU,EAAE,UAAU,OAAO,EAAE;AACnC,MAAM,OAAO,CAAC,UAAU,CAAC,IAAI,EAAE,OAAO,EAAC;AACvC;AACA;AACA,MAAM,IAAI,CAAC,gBAAgB,GAAG,OAAO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C,cAAc,CAAC,CAAC,EAAC;AAC5B,KAAK;AACL,GAAG,EAAC;AACJ;AACA,EAAE,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC;AAC3B;;;;"}
|
|
@@ -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,sC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;;;;;;;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
|
+
{"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,IAA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CAAA;;;;EAI5B;AAEM,MAAM,cAAc,GAAG,GAAG,CAAA,CAAA;;;;EAIhC;AAEM,MAAM,iBAAiB,GAAG,GAAG,CAAA,CAAA;;;AAGtB,YAAA,EAAA,SAAS,CAAC,qCAAqC,CAAA;;;;;;;EAO5D;AAEM,MAAM,cAAc,GAAG,GAAG,CAAA,CAAA;;EAEhC;AAEM,MAAM,cAAc,GAAG,GAAG,CAAA,CAAA;;;;AAI5B,GAAA,EAAA,CAAA,CAAA,EAAI,cAAc,CAAE,CAAA,CAAA;;;EAGxB;AAEM,MAAM,GAAG,GAAG,GAAG,CAAA,CAAA;;;;;;"}
|
|
@@ -21,5 +21,10 @@ export interface LineConfigInterface<Datum> extends XYComponentConfigInterface<D
|
|
|
21
21
|
highlightOnHover?: boolean;
|
|
22
22
|
/** Optional link cursor. Default: `null` */
|
|
23
23
|
cursor?: StringAccessor<Datum[]>;
|
|
24
|
+
/** Enable interpolated line where data points are missing or fallbackValue is used.
|
|
25
|
+
* You can customize the line's appearance with `--vis-line-gapfill-stroke-dasharray`
|
|
26
|
+
* and `--vis-line-gapfill-stroke-opacity` CSS variables.
|
|
27
|
+
* Default: `false` */
|
|
28
|
+
interpolateMissingData?: boolean;
|
|
24
29
|
}
|
|
25
30
|
export declare const LineDefaultConfig: LineConfigInterface<unknown>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { XYComponentDefaultConfig } from '../../core/xy-component/config.js';
|
|
2
2
|
import { CurveType } from '../../types/curve.js';
|
|
3
3
|
|
|
4
|
-
const LineDefaultConfig = Object.assign(Object.assign({}, XYComponentDefaultConfig), { curveType: CurveType.MonotoneX, lineWidth: 2, lineDashArray: undefined, fallbackValue: undefined, highlightOnHover: false, cursor: null });
|
|
4
|
+
const LineDefaultConfig = Object.assign(Object.assign({}, XYComponentDefaultConfig), { curveType: CurveType.MonotoneX, lineWidth: 2, lineDashArray: undefined, fallbackValue: undefined, highlightOnHover: false, cursor: null, interpolateMissingData: false });
|
|
5
5
|
|
|
6
6
|
export { LineDefaultConfig };
|
|
7
7
|
//# sourceMappingURL=config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sources":["../../../src/components/line/config.ts"],"sourcesContent":["import { XYComponentConfigInterface, XYComponentDefaultConfig } from 'core/xy-component/config'\n\n// Types\nimport { CurveType } from 'types/curve'\nimport { ColorAccessor, GenericAccessor, StringAccessor } from 'types/accessor'\n\nexport interface LineConfigInterface<Datum> extends XYComponentConfigInterface<Datum> {\n /** Line color accessor function. The whole data array will be passed as the first argument. Default: `undefined` */\n color?: ColorAccessor<Datum[]>;\n /** Curve type from the CurveType enum. Default: `CurveType.MonotoneX` */\n curveType?: CurveType;\n /** Line width in pixels. Default: `2` */\n lineWidth?: number;\n /** Line dash array, see SVG's stroke-dasharray. Default: `undefined` */\n lineDashArray?: GenericAccessor<number[], Datum[]>;\n /** When a data point has an `undefined`, `NaN`, or other no-data value, they'll be replaced with a value specified here.\n * Setting this property to `undefined` will lead to having the line break when there's no data, and continue when\n * the data appears again. If you set it to `null`, the values will be treated as numerical `0` values and the line\n * won't break; however if the whole dataset consists of only `null`s, the line won't be displayed.\n * Default: `undefined`\n */\n fallbackValue?: number | undefined | null;\n /** Highlight line on hover. Default: `false` */\n highlightOnHover?: boolean;\n /** Optional link cursor. Default: `null` */\n cursor?: StringAccessor<Datum[]>;\n}\n\nexport const LineDefaultConfig: LineConfigInterface<unknown> = {\n ...XYComponentDefaultConfig,\n curveType: CurveType.MonotoneX,\n lineWidth: 2,\n lineDashArray: undefined,\n fallbackValue: undefined,\n highlightOnHover: false,\n cursor: null,\n}\n"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"config.js","sources":["../../../src/components/line/config.ts"],"sourcesContent":["import { XYComponentConfigInterface, XYComponentDefaultConfig } from 'core/xy-component/config'\n\n// Types\nimport { CurveType } from 'types/curve'\nimport { ColorAccessor, GenericAccessor, StringAccessor } from 'types/accessor'\n\nexport interface LineConfigInterface<Datum> extends XYComponentConfigInterface<Datum> {\n /** Line color accessor function. The whole data array will be passed as the first argument. Default: `undefined` */\n color?: ColorAccessor<Datum[]>;\n /** Curve type from the CurveType enum. Default: `CurveType.MonotoneX` */\n curveType?: CurveType;\n /** Line width in pixels. Default: `2` */\n lineWidth?: number;\n /** Line dash array, see SVG's stroke-dasharray. Default: `undefined` */\n lineDashArray?: GenericAccessor<number[], Datum[]>;\n /** When a data point has an `undefined`, `NaN`, or other no-data value, they'll be replaced with a value specified here.\n * Setting this property to `undefined` will lead to having the line break when there's no data, and continue when\n * the data appears again. If you set it to `null`, the values will be treated as numerical `0` values and the line\n * won't break; however if the whole dataset consists of only `null`s, the line won't be displayed.\n * Default: `undefined`\n */\n fallbackValue?: number | undefined | null;\n /** Highlight line on hover. Default: `false` */\n highlightOnHover?: boolean;\n /** Optional link cursor. Default: `null` */\n cursor?: StringAccessor<Datum[]>;\n /** Enable interpolated line where data points are missing or fallbackValue is used.\n * You can customize the line's appearance with `--vis-line-gapfill-stroke-dasharray`\n * and `--vis-line-gapfill-stroke-opacity` CSS variables.\n * Default: `false` */\n interpolateMissingData?: boolean;\n}\n\nexport const LineDefaultConfig: LineConfigInterface<unknown> = {\n ...XYComponentDefaultConfig,\n curveType: CurveType.MonotoneX,\n lineWidth: 2,\n lineDashArray: undefined,\n fallbackValue: undefined,\n highlightOnHover: false,\n cursor: null,\n interpolateMissingData: false,\n}\n"],"names":[],"mappings":";;;AAiCa,MAAA,iBAAiB,GACzB,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAA,wBAAwB,KAC3B,SAAS,EAAE,SAAS,CAAC,SAAS,EAC9B,SAAS,EAAE,CAAC,EACZ,aAAa,EAAE,SAAS,EACxB,aAAa,EAAE,SAAS,EACxB,gBAAgB,EAAE,KAAK,EACvB,MAAM,EAAE,IAAI,EACZ,sBAAsB,EAAE,KAAK;;;;"}
|