@unovis/ts 1.6.2 → 1.7.0-pre.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/area/config.d.ts +2 -0
- package/components/area/config.js +1 -1
- package/components/area/config.js.map +1 -1
- package/components/area/index.js +6 -3
- package/components/area/index.js.map +1 -1
- package/components/crosshair/config.d.ts +1 -1
- package/components/crosshair/config.js.map +1 -1
- package/components/crosshair/index.d.ts +1 -1
- package/components/crosshair/index.js.map +1 -1
- package/components/free-brush/types.js +1 -0
- package/components/free-brush/types.js.map +1 -1
- package/components/graph/index.d.ts +1 -0
- package/components/graph/index.js +35 -14
- package/components/graph/index.js.map +1 -1
- package/components/graph/modules/link/index.js +1 -1
- package/components/graph/modules/link/index.js.map +1 -1
- package/components/leaflet-map/leaflet.css.js +2 -2
- package/components/leaflet-map/modules/map.js +2 -2
- package/components/leaflet-map/modules/map.js.map +1 -1
- package/components/leaflet-map/renderer/mapboxgl-utils.d.ts +0 -1
- package/components/leaflet-map/renderer/mapboxgl-utils.js +1 -2
- package/components/leaflet-map/renderer/mapboxgl-utils.js.map +1 -1
- package/components/sankey/config.d.ts +25 -2
- package/components/sankey/config.js +2 -2
- package/components/sankey/config.js.map +1 -1
- package/components/sankey/index.d.ts +26 -2
- package/components/sankey/index.js +341 -46
- package/components/sankey/index.js.map +1 -1
- package/components/sankey/modules/label.d.ts +8 -5
- package/components/sankey/modules/label.js +70 -32
- package/components/sankey/modules/label.js.map +1 -1
- package/components/sankey/modules/link.d.ts +1 -0
- package/components/sankey/modules/link.js +20 -25
- package/components/sankey/modules/link.js.map +1 -1
- package/components/sankey/modules/node.d.ts +5 -4
- package/components/sankey/modules/node.js +65 -16
- package/components/sankey/modules/node.js.map +1 -1
- package/components/sankey/style.d.ts +67 -1
- package/components/sankey/style.js +77 -77
- package/components/sankey/style.js.map +1 -1
- package/components/sankey/types.d.ts +5 -0
- package/components/sankey/types.js +9 -2
- package/components/sankey/types.js.map +1 -1
- package/components/treemap/index.js +2 -4
- package/components/treemap/index.js.map +1 -1
- package/containers/single-container/config.d.ts +3 -0
- package/containers/single-container/config.js.map +1 -1
- package/containers/single-container/index.js +2 -1
- package/containers/single-container/index.js.map +1 -1
- package/containers/xy-container/config.d.ts +3 -0
- package/containers/xy-container/config.js.map +1 -1
- package/containers/xy-container/index.d.ts +1 -0
- package/containers/xy-container/index.js +13 -9
- package/containers/xy-container/index.js.map +1 -1
- package/index.js +1 -1
- package/package.json +42 -10
- package/types.js +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var css_248z = ".leaflet-image-layer,.leaflet-layer,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-pane,.leaflet-pane>canvas,.leaflet-pane>svg,.leaflet-tile,.leaflet-tile-container,.leaflet-zoom-box{left:0;position:absolute;top:0}.leaflet-container{overflow:hidden}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile{-webkit-user-drag:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{height:1600px;-webkit-transform-origin:0 0;width:1600px}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-overlay-pane svg,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer{max-height:none!important;max-width:none!important}.leaflet-container.leaflet-touch-zoom{-ms-touch-action:pan-x pan-y;touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{-ms-touch-action:pinch-zoom;touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{-ms-touch-action:none;touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:rgba(51,181,229,.4)}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{-moz-box-sizing:border-box;box-sizing:border-box;height:0;width:0;z-index:800}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-overlay-pane{z-index:1}.leaflet-vml-shape{height:1px;width:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{pointer-events:visiblePainted;pointer-events:auto;position:relative;z-index:800}.leaflet-bottom,.leaflet-top{pointer-events:none;position:absolute;z-index:1}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{clear:both;float:left}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-tile{will-change:opacity}.leaflet-fade-anim .leaflet-popup{opacity:0;-webkit-transition:opacity .2s linear;-moz-transition:opacity .2s linear;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{-webkit-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0}.leaflet-zoom-anim .leaflet-zoom-animated{-webkit-transition:-webkit-transform .25s cubic-bezier(0,0,.25,1);-moz-transition:-moz-transform .25s cubic-bezier(0,0,.25,1);transition:transform .25s cubic-bezier(0,0,.25,1);will-change:transform}.leaflet-pan-anim .leaflet-tile,.leaflet-zoom-anim .leaflet-tile{-webkit-transition:none;-moz-transition:none;transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-control,.leaflet-popup-pane{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.leaflet-image-layer,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-image-layer.leaflet-interactive,.leaflet-marker-icon.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{background:#dfe5eb;outline:0}.leaflet-container a{color:#0078a8}.leaflet-container a.leaflet-active{outline:2px solid orange}.leaflet-zoom-box{background:rgba(255,255,255,.5);border:2px dotted #38f}.leaflet-container{font:12px/1.5 Helvetica Neue,Arial,Helvetica,sans-serif}.leaflet-bar{border-radius:4px;box-shadow:0 1px 5px rgba(0,0,0,.65)}.leaflet-bar a,.leaflet-bar a:hover{background-color:#fff;border-bottom:1px solid rgba(130,130,130,.2);color:#000;display:block;height:26px;line-height:26px;text-align:center;text-decoration:none;width:26px}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50% 50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom:none;border-bottom-left-radius:4px;border-bottom-right-radius:4px}.leaflet-bar a.leaflet-disabled{background-color:#f4f4f4;color:#bbb;cursor:default}.leaflet-touch .leaflet-bar a{height:30px;line-height:30px;width:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.leaflet-control-zoom-in,.leaflet-control-zoom-out{font:700 18px Lucida Console,Monaco,monospace;text-indent:1px}.leaflet-touch .leaflet-control-zoom-in,.leaflet-touch .leaflet-control-zoom-out{font-size:22px}.leaflet-control-layers{background:#fff;border-radius:5px;box-shadow:0 1px 5px rgba(0,0,0,.4)}.leaflet-touch .leaflet-control-layers-toggle{height:44px;width:44px}.leaflet-control-layers-expanded .leaflet-control-layers-toggle,.leaflet-control-layers .leaflet-control-layers-list{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{background:#fff;color:#333;padding:6px 10px 6px 6px}.leaflet-control-layers-scrollbar{overflow-x:hidden;overflow-y:scroll;padding-right:5px}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{display:block}.leaflet-control-layers-separator{border-top:1px solid #ddd;height:0;margin:5px -10px 5px -6px}.leaflet-container .leaflet-control-attribution{background:#fff;background:hsla(0,0%,100%,.7);margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{color:#333;padding:0 5px}.leaflet-control-attribution a{color:#333;font-size:7pt;opacity:.6;text-decoration:none}.leaflet-control-attribution a:hover{text-decoration:underline}.leaflet-container .leaflet-control-attribution,.leaflet-container .leaflet-control-scale{font-size:11px}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{background:#fff;background:hsla(0,0%,100%,.5);border:2px solid #777;border-top:none;-moz-box-sizing:border-box;box-sizing:border-box;font-size:11px;line-height:1.1;overflow:hidden;padding:2px 5px 1px;white-space:nowrap}.leaflet-control-scale-line:not(:first-child){border-bottom:none;border-top:2px solid #777;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-bar,.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers{box-shadow:none}.leaflet-touch .leaflet-bar,.leaflet-touch .leaflet-control-layers{background-clip:padding-box;border:1px solid rgba(0,0,0,.15)}.leaflet-popup{margin-bottom:20px;position:absolute;text-align:center}.leaflet-popup-content-wrapper{border-radius:12px;padding:1px;text-align:left}.leaflet-popup-content{line-height:1.4;margin:13px 19px}.leaflet-popup-content p{margin:18px 0}.leaflet-popup-tip-container{height:20px;left:50%;margin-left:-20px;overflow:hidden;pointer-events:none;position:absolute;width:40px}.leaflet-popup-tip{height:17px;margin:-10px auto 0;padding:1px;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg);width:17px}.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:#fff;box-shadow:0 3px 14px rgba(0,0,0,.4);color:#333}.leaflet-container a.leaflet-popup-close-button{background:transparent;border:none;color:#c3c3c3;font:16px/14px Tahoma,Verdana,sans-serif;font-weight:700;height:14px;padding:4px 4px 0 0;position:absolute;right:0;text-align:center;text-decoration:none;top:0;width:18px}.leaflet-container a.leaflet-popup-close-button:hover{color:#999}.leaflet-popup-scrolled{border-bottom:1px solid #ddd;border-top:1px solid #ddd;overflow:auto}.leaflet-oldie .leaflet-popup-content-wrapper{zoom:1}.leaflet-oldie .leaflet-popup-tip{-ms-filter:\"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)\";filter:progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678,M12=0.70710678,M21=-0.70710678,M22=0.70710678);margin:0 auto;width:24px}.leaflet-oldie .leaflet-popup-tip-container{margin-top:-1px}.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-control-zoom,.leaflet-oldie .leaflet-popup-content-wrapper,.leaflet-oldie .leaflet-popup-tip{border:1px solid #999}.leaflet-div-icon{background:#fff;border:1px solid #666}.leaflet-tooltip{background-color:#fff;border:1px solid #fff;border-radius:3px;box-shadow:0 1px 3px rgba(0,0,0,.4);color:#222;padding:6px;pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap}.leaflet-tooltip.leaflet-clickable{cursor:pointer;pointer-events:auto}.leaflet-tooltip-bottom:before,.leaflet-tooltip-left:before,.leaflet-tooltip-right:before,.leaflet-tooltip-top:before{background:transparent;border:6px solid transparent;content:\"\";pointer-events:none;position:absolute}.leaflet-tooltip-bottom{margin-top:6px}.leaflet-tooltip-top{margin-top:-6px}.leaflet-tooltip-bottom:before,.leaflet-tooltip-top:before{left:50%;margin-left:-6px}.leaflet-tooltip-top:before{border-top-color:#fff;bottom:0;margin-bottom:-12px}.leaflet-tooltip-bottom:before{border-bottom-color:#fff;margin-left:-6px;margin-top:-12px;top:0}.leaflet-tooltip-left{margin-left:-6px}.leaflet-tooltip-right{margin-left:6px}.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{margin-top:-6px;top:50%}.leaflet-tooltip-left:before{border-left-color:#fff;margin-right:-12px;right:0}.leaflet-tooltip-right:before{border-right-color:#fff;left:0;margin-left:-12px}";
|
|
2
|
-
var stylesheet=".leaflet-image-layer,.leaflet-layer,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-pane,.leaflet-pane>canvas,.leaflet-pane>svg,.leaflet-tile,.leaflet-tile-container,.leaflet-zoom-box{left:0;position:absolute;top:0}.leaflet-container{overflow:hidden}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile{-webkit-user-drag:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{height:1600px;-webkit-transform-origin:0 0;width:1600px}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-overlay-pane svg,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer{max-height:none!important;max-width:none!important}.leaflet-container.leaflet-touch-zoom{-ms-touch-action:pan-x pan-y;touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{-ms-touch-action:pinch-zoom;touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{-ms-touch-action:none;touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:rgba(51,181,229,.4)}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{-moz-box-sizing:border-box;box-sizing:border-box;height:0;width:0;z-index:800}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-overlay-pane{z-index:1}.leaflet-vml-shape{height:1px;width:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{pointer-events:visiblePainted;pointer-events:auto;position:relative;z-index:800}.leaflet-bottom,.leaflet-top{pointer-events:none;position:absolute;z-index:1}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{clear:both;float:left}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-tile{will-change:opacity}.leaflet-fade-anim .leaflet-popup{opacity:0;-webkit-transition:opacity .2s linear;-moz-transition:opacity .2s linear;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{-webkit-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0}.leaflet-zoom-anim .leaflet-zoom-animated{-webkit-transition:-webkit-transform .25s cubic-bezier(0,0,.25,1);-moz-transition:-moz-transform .25s cubic-bezier(0,0,.25,1);transition:transform .25s cubic-bezier(0,0,.25,1);will-change:transform}.leaflet-pan-anim .leaflet-tile,.leaflet-zoom-anim .leaflet-tile{-webkit-transition:none;-moz-transition:none;transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-control,.leaflet-popup-pane{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.leaflet-image-layer,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-image-layer.leaflet-interactive,.leaflet-marker-icon.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{background:#dfe5eb;outline:0}.leaflet-container a{color:#0078a8}.leaflet-container a.leaflet-active{outline:2px solid orange}.leaflet-zoom-box{background:rgba(255,255,255,.5);border:2px dotted #38f}.leaflet-container{font:12px/1.5 Helvetica Neue,Arial,Helvetica,sans-serif}.leaflet-bar{border-radius:4px;box-shadow:0 1px 5px rgba(0,0,0,.65)}.leaflet-bar a,.leaflet-bar a:hover{background-color:#fff;border-bottom:1px solid rgba(130,130,130,.2);color:#000;display:block;height:26px;line-height:26px;text-align:center;text-decoration:none;width:26px}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50% 50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom:none;border-bottom-left-radius:4px;border-bottom-right-radius:4px}.leaflet-bar a.leaflet-disabled{background-color:#f4f4f4;color:#bbb;cursor:default}.leaflet-touch .leaflet-bar a{height:30px;line-height:30px;width:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.leaflet-control-zoom-in,.leaflet-control-zoom-out{font:700 18px Lucida Console,Monaco,monospace;text-indent:1px}.leaflet-touch .leaflet-control-zoom-in,.leaflet-touch .leaflet-control-zoom-out{font-size:22px}.leaflet-control-layers{background:#fff;border-radius:5px;box-shadow:0 1px 5px rgba(0,0,0,.4)}.leaflet-touch .leaflet-control-layers-toggle{height:44px;width:44px}.leaflet-control-layers-expanded .leaflet-control-layers-toggle,.leaflet-control-layers .leaflet-control-layers-list{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{background:#fff;color:#333;padding:6px 10px 6px 6px}.leaflet-control-layers-scrollbar{overflow-x:hidden;overflow-y:scroll;padding-right:5px}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{display:block}.leaflet-control-layers-separator{border-top:1px solid #ddd;height:0;margin:5px -10px 5px -6px}.leaflet-container .leaflet-control-attribution{background:#fff;background:hsla(0,0%,100%,.7);margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{color:#333;padding:0 5px}.leaflet-control-attribution a{color:#333;font-size:7pt;opacity:.6;text-decoration:none}.leaflet-control-attribution a:hover{text-decoration:underline}.leaflet-container .leaflet-control-attribution,.leaflet-container .leaflet-control-scale{font-size:11px}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{background:#fff;background:hsla(0,0%,100%,.5);border:2px solid #777;border-top:none;-moz-box-sizing:border-box;box-sizing:border-box;font-size:11px;line-height:1.1;overflow:hidden;padding:2px 5px 1px;white-space:nowrap}.leaflet-control-scale-line:not(:first-child){border-bottom:none;border-top:2px solid #777;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-bar,.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers{box-shadow:none}.leaflet-touch .leaflet-bar,.leaflet-touch .leaflet-control-layers{background-clip:padding-box;border:1px solid rgba(0,0,0,.15)}.leaflet-popup{margin-bottom:20px;position:absolute;text-align:center}.leaflet-popup-content-wrapper{border-radius:12px;padding:1px;text-align:left}.leaflet-popup-content{line-height:1.4;margin:13px 19px}.leaflet-popup-content p{margin:18px 0}.leaflet-popup-tip-container{height:20px;left:50%;margin-left:-20px;overflow:hidden;pointer-events:none;position:absolute;width:40px}.leaflet-popup-tip{height:17px;margin:-10px auto 0;padding:1px;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg);width:17px}.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:#fff;box-shadow:0 3px 14px rgba(0,0,0,.4);color:#333}.leaflet-container a.leaflet-popup-close-button{background:transparent;border:none;color:#c3c3c3;font:16px/14px Tahoma,Verdana,sans-serif;font-weight:700;height:14px;padding:4px 4px 0 0;position:absolute;right:0;text-align:center;text-decoration:none;top:0;width:18px}.leaflet-container a.leaflet-popup-close-button:hover{color:#999}.leaflet-popup-scrolled{border-bottom:1px solid #ddd;border-top:1px solid #ddd;overflow:auto}.leaflet-oldie .leaflet-popup-content-wrapper{zoom:1}.leaflet-oldie .leaflet-popup-tip{-ms-filter:\"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)\";filter:progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678,M12=0.70710678,M21=-0.70710678,M22=0.70710678);margin:0 auto;width:24px}.leaflet-oldie .leaflet-popup-tip-container{margin-top:-1px}.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-control-zoom,.leaflet-oldie .leaflet-popup-content-wrapper,.leaflet-oldie .leaflet-popup-tip{border:1px solid #999}.leaflet-div-icon{background:#fff;border:1px solid #666}.leaflet-tooltip{background-color:#fff;border:1px solid #fff;border-radius:3px;box-shadow:0 1px 3px rgba(0,0,0,.4);color:#222;padding:6px;pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap}.leaflet-tooltip.leaflet-clickable{cursor:pointer;pointer-events:auto}.leaflet-tooltip-bottom:before,.leaflet-tooltip-left:before,.leaflet-tooltip-right:before,.leaflet-tooltip-top:before{background:transparent;border:6px solid transparent;content:\"\";pointer-events:none;position:absolute}.leaflet-tooltip-bottom{margin-top:6px}.leaflet-tooltip-top{margin-top:-6px}.leaflet-tooltip-bottom:before,.leaflet-tooltip-top:before{left:50%;margin-left:-6px}.leaflet-tooltip-top:before{border-top-color:#fff;bottom:0;margin-bottom:-12px}.leaflet-tooltip-bottom:before{border-bottom-color:#fff;margin-left:-6px;margin-top:-12px;top:0}.leaflet-tooltip-left{margin-left:-6px}.leaflet-tooltip-right{margin-left:6px}.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{margin-top:-6px;top:50%}.leaflet-tooltip-left:before{border-left-color:#fff;margin-right:-12px;right:0}.leaflet-tooltip-right:before{border-right-color:#fff;left:0;margin-left:-12px}";
|
|
1
|
+
var css_248z = ".leaflet-image-layer,.leaflet-layer,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-pane,.leaflet-pane>canvas,.leaflet-pane>svg,.leaflet-tile,.leaflet-tile-container,.leaflet-zoom-box{left:0;position:absolute;top:0}.leaflet-container{overflow:hidden}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile{-webkit-user-drag:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{height:1600px;-webkit-transform-origin:0 0;width:1600px}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-overlay-pane svg,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer{max-height:none!important;max-width:none!important}.leaflet-container.leaflet-touch-zoom{-ms-touch-action:pan-x pan-y;touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{-ms-touch-action:pinch-zoom;touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{-ms-touch-action:none;touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:rgba(51,181,229,.4)}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{-moz-box-sizing:border-box;box-sizing:border-box;height:0;width:0;z-index:800}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-overlay-pane{z-index:1}.leaflet-vml-shape{height:1px;width:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{pointer-events:visiblePainted;pointer-events:auto;position:relative;z-index:800}.leaflet-bottom,.leaflet-top{pointer-events:none;position:absolute;z-index:1}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{clear:both;float:left}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-tile{will-change:opacity}.leaflet-fade-anim .leaflet-popup{opacity:0;-webkit-transition:opacity .2s linear;-moz-transition:opacity .2s linear;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{-webkit-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0}.leaflet-zoom-anim .leaflet-zoom-animated{-webkit-transition:-webkit-transform .25s cubic-bezier(0,0,.25,1);-moz-transition:-moz-transform .25s cubic-bezier(0,0,.25,1);transition:transform .25s cubic-bezier(0,0,.25,1);will-change:transform}.leaflet-pan-anim .leaflet-tile,.leaflet-zoom-anim .leaflet-tile{-webkit-transition:none;-moz-transition:none;transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-control,.leaflet-popup-pane{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.leaflet-image-layer,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-image-layer.leaflet-interactive,.leaflet-marker-icon.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{background:#dfe5eb;outline:0}.leaflet-container a{color:#0078a8}.leaflet-container a.leaflet-active{outline:2px solid orange}.leaflet-zoom-box{background:hsla(0,0%,100%,.5);border:2px dotted #38f}.leaflet-container{font:12px/1.5 Helvetica Neue,Arial,Helvetica,sans-serif}.leaflet-bar{border-radius:4px;box-shadow:0 1px 5px rgba(0,0,0,.65)}.leaflet-bar a,.leaflet-bar a:hover{background-color:#fff;border-bottom:1px solid hsla(0,0%,51%,.2);color:#000;display:block;height:26px;line-height:26px;text-align:center;text-decoration:none;width:26px}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50% 50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom:none;border-bottom-left-radius:4px;border-bottom-right-radius:4px}.leaflet-bar a.leaflet-disabled{background-color:#f4f4f4;color:#bbb;cursor:default}.leaflet-touch .leaflet-bar a{height:30px;line-height:30px;width:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.leaflet-control-zoom-in,.leaflet-control-zoom-out{font:700 18px Lucida Console,Monaco,monospace;text-indent:1px}.leaflet-touch .leaflet-control-zoom-in,.leaflet-touch .leaflet-control-zoom-out{font-size:22px}.leaflet-control-layers{background:#fff;border-radius:5px;box-shadow:0 1px 5px rgba(0,0,0,.4)}.leaflet-touch .leaflet-control-layers-toggle{height:44px;width:44px}.leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{background:#fff;color:#333;padding:6px 10px 6px 6px}.leaflet-control-layers-scrollbar{overflow-x:hidden;overflow-y:scroll;padding-right:5px}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{display:block}.leaflet-control-layers-separator{border-top:1px solid #ddd;height:0;margin:5px -10px 5px -6px}.leaflet-container .leaflet-control-attribution{background:#fff;background:hsla(0,0%,100%,.7);margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{color:#333;padding:0 5px}.leaflet-control-attribution a{color:#333;font-size:7pt;opacity:.6;text-decoration:none}.leaflet-control-attribution a:hover{text-decoration:underline}.leaflet-container .leaflet-control-attribution,.leaflet-container .leaflet-control-scale{font-size:11px}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{background:#fff;background:hsla(0,0%,100%,.5);border:2px solid #777;border-top:none;-moz-box-sizing:border-box;box-sizing:border-box;font-size:11px;line-height:1.1;overflow:hidden;padding:2px 5px 1px;white-space:nowrap}.leaflet-control-scale-line:not(:first-child){border-bottom:none;border-top:2px solid #777;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-bar,.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers{box-shadow:none}.leaflet-touch .leaflet-bar,.leaflet-touch .leaflet-control-layers{background-clip:padding-box;border:1px solid rgba(0,0,0,.15)}.leaflet-popup{margin-bottom:20px;position:absolute;text-align:center}.leaflet-popup-content-wrapper{border-radius:12px;padding:1px;text-align:left}.leaflet-popup-content{line-height:1.4;margin:13px 19px}.leaflet-popup-content p{margin:18px 0}.leaflet-popup-tip-container{height:20px;left:50%;margin-left:-20px;overflow:hidden;pointer-events:none;position:absolute;width:40px}.leaflet-popup-tip{height:17px;margin:-10px auto 0;padding:1px;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg);width:17px}.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:#fff;box-shadow:0 3px 14px rgba(0,0,0,.4);color:#333}.leaflet-container a.leaflet-popup-close-button{background:transparent;border:none;color:#c3c3c3;font:16px/14px Tahoma,Verdana,sans-serif;font-weight:700;height:14px;padding:4px 4px 0 0;position:absolute;right:0;text-align:center;text-decoration:none;top:0;width:18px}.leaflet-container a.leaflet-popup-close-button:hover{color:#999}.leaflet-popup-scrolled{border-bottom:1px solid #ddd;border-top:1px solid #ddd;overflow:auto}.leaflet-oldie .leaflet-popup-content-wrapper{zoom:1}.leaflet-oldie .leaflet-popup-tip{-ms-filter:\"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)\";filter:progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678,M12=0.70710678,M21=-0.70710678,M22=0.70710678);margin:0 auto;width:24px}.leaflet-oldie .leaflet-popup-tip-container{margin-top:-1px}.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-control-zoom,.leaflet-oldie .leaflet-popup-content-wrapper,.leaflet-oldie .leaflet-popup-tip{border:1px solid #999}.leaflet-div-icon{background:#fff;border:1px solid #666}.leaflet-tooltip{background-color:#fff;border:1px solid #fff;border-radius:3px;box-shadow:0 1px 3px rgba(0,0,0,.4);color:#222;padding:6px;pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap}.leaflet-tooltip.leaflet-clickable{cursor:pointer;pointer-events:auto}.leaflet-tooltip-bottom:before,.leaflet-tooltip-left:before,.leaflet-tooltip-right:before,.leaflet-tooltip-top:before{background:transparent;border:6px solid transparent;content:\"\";pointer-events:none;position:absolute}.leaflet-tooltip-bottom{margin-top:6px}.leaflet-tooltip-top{margin-top:-6px}.leaflet-tooltip-bottom:before,.leaflet-tooltip-top:before{left:50%;margin-left:-6px}.leaflet-tooltip-top:before{border-top-color:#fff;bottom:0;margin-bottom:-12px}.leaflet-tooltip-bottom:before{border-bottom-color:#fff;margin-left:-6px;margin-top:-12px;top:0}.leaflet-tooltip-left{margin-left:-6px}.leaflet-tooltip-right{margin-left:6px}.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{margin-top:-6px;top:50%}.leaflet-tooltip-left:before{border-left-color:#fff;margin-right:-12px;right:0}.leaflet-tooltip-right:before{border-right-color:#fff;left:0;margin-left:-12px}";
|
|
2
|
+
var stylesheet=".leaflet-image-layer,.leaflet-layer,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-pane,.leaflet-pane>canvas,.leaflet-pane>svg,.leaflet-tile,.leaflet-tile-container,.leaflet-zoom-box{left:0;position:absolute;top:0}.leaflet-container{overflow:hidden}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile{-webkit-user-drag:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{height:1600px;-webkit-transform-origin:0 0;width:1600px}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-overlay-pane svg,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer{max-height:none!important;max-width:none!important}.leaflet-container.leaflet-touch-zoom{-ms-touch-action:pan-x pan-y;touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{-ms-touch-action:pinch-zoom;touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{-ms-touch-action:none;touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:rgba(51,181,229,.4)}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{-moz-box-sizing:border-box;box-sizing:border-box;height:0;width:0;z-index:800}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-overlay-pane{z-index:1}.leaflet-vml-shape{height:1px;width:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{pointer-events:visiblePainted;pointer-events:auto;position:relative;z-index:800}.leaflet-bottom,.leaflet-top{pointer-events:none;position:absolute;z-index:1}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{clear:both;float:left}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-tile{will-change:opacity}.leaflet-fade-anim .leaflet-popup{opacity:0;-webkit-transition:opacity .2s linear;-moz-transition:opacity .2s linear;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{-webkit-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0}.leaflet-zoom-anim .leaflet-zoom-animated{-webkit-transition:-webkit-transform .25s cubic-bezier(0,0,.25,1);-moz-transition:-moz-transform .25s cubic-bezier(0,0,.25,1);transition:transform .25s cubic-bezier(0,0,.25,1);will-change:transform}.leaflet-pan-anim .leaflet-tile,.leaflet-zoom-anim .leaflet-tile{-webkit-transition:none;-moz-transition:none;transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-control,.leaflet-popup-pane{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.leaflet-image-layer,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-image-layer.leaflet-interactive,.leaflet-marker-icon.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{background:#dfe5eb;outline:0}.leaflet-container a{color:#0078a8}.leaflet-container a.leaflet-active{outline:2px solid orange}.leaflet-zoom-box{background:hsla(0,0%,100%,.5);border:2px dotted #38f}.leaflet-container{font:12px/1.5 Helvetica Neue,Arial,Helvetica,sans-serif}.leaflet-bar{border-radius:4px;box-shadow:0 1px 5px rgba(0,0,0,.65)}.leaflet-bar a,.leaflet-bar a:hover{background-color:#fff;border-bottom:1px solid hsla(0,0%,51%,.2);color:#000;display:block;height:26px;line-height:26px;text-align:center;text-decoration:none;width:26px}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50% 50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom:none;border-bottom-left-radius:4px;border-bottom-right-radius:4px}.leaflet-bar a.leaflet-disabled{background-color:#f4f4f4;color:#bbb;cursor:default}.leaflet-touch .leaflet-bar a{height:30px;line-height:30px;width:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.leaflet-control-zoom-in,.leaflet-control-zoom-out{font:700 18px Lucida Console,Monaco,monospace;text-indent:1px}.leaflet-touch .leaflet-control-zoom-in,.leaflet-touch .leaflet-control-zoom-out{font-size:22px}.leaflet-control-layers{background:#fff;border-radius:5px;box-shadow:0 1px 5px rgba(0,0,0,.4)}.leaflet-touch .leaflet-control-layers-toggle{height:44px;width:44px}.leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{background:#fff;color:#333;padding:6px 10px 6px 6px}.leaflet-control-layers-scrollbar{overflow-x:hidden;overflow-y:scroll;padding-right:5px}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{display:block}.leaflet-control-layers-separator{border-top:1px solid #ddd;height:0;margin:5px -10px 5px -6px}.leaflet-container .leaflet-control-attribution{background:#fff;background:hsla(0,0%,100%,.7);margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{color:#333;padding:0 5px}.leaflet-control-attribution a{color:#333;font-size:7pt;opacity:.6;text-decoration:none}.leaflet-control-attribution a:hover{text-decoration:underline}.leaflet-container .leaflet-control-attribution,.leaflet-container .leaflet-control-scale{font-size:11px}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{background:#fff;background:hsla(0,0%,100%,.5);border:2px solid #777;border-top:none;-moz-box-sizing:border-box;box-sizing:border-box;font-size:11px;line-height:1.1;overflow:hidden;padding:2px 5px 1px;white-space:nowrap}.leaflet-control-scale-line:not(:first-child){border-bottom:none;border-top:2px solid #777;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-bar,.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers{box-shadow:none}.leaflet-touch .leaflet-bar,.leaflet-touch .leaflet-control-layers{background-clip:padding-box;border:1px solid rgba(0,0,0,.15)}.leaflet-popup{margin-bottom:20px;position:absolute;text-align:center}.leaflet-popup-content-wrapper{border-radius:12px;padding:1px;text-align:left}.leaflet-popup-content{line-height:1.4;margin:13px 19px}.leaflet-popup-content p{margin:18px 0}.leaflet-popup-tip-container{height:20px;left:50%;margin-left:-20px;overflow:hidden;pointer-events:none;position:absolute;width:40px}.leaflet-popup-tip{height:17px;margin:-10px auto 0;padding:1px;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg);width:17px}.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:#fff;box-shadow:0 3px 14px rgba(0,0,0,.4);color:#333}.leaflet-container a.leaflet-popup-close-button{background:transparent;border:none;color:#c3c3c3;font:16px/14px Tahoma,Verdana,sans-serif;font-weight:700;height:14px;padding:4px 4px 0 0;position:absolute;right:0;text-align:center;text-decoration:none;top:0;width:18px}.leaflet-container a.leaflet-popup-close-button:hover{color:#999}.leaflet-popup-scrolled{border-bottom:1px solid #ddd;border-top:1px solid #ddd;overflow:auto}.leaflet-oldie .leaflet-popup-content-wrapper{zoom:1}.leaflet-oldie .leaflet-popup-tip{-ms-filter:\"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)\";filter:progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678,M12=0.70710678,M21=-0.70710678,M22=0.70710678);margin:0 auto;width:24px}.leaflet-oldie .leaflet-popup-tip-container{margin-top:-1px}.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-control-zoom,.leaflet-oldie .leaflet-popup-content-wrapper,.leaflet-oldie .leaflet-popup-tip{border:1px solid #999}.leaflet-div-icon{background:#fff;border:1px solid #666}.leaflet-tooltip{background-color:#fff;border:1px solid #fff;border-radius:3px;box-shadow:0 1px 3px rgba(0,0,0,.4);color:#222;padding:6px;pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap}.leaflet-tooltip.leaflet-clickable{cursor:pointer;pointer-events:auto}.leaflet-tooltip-bottom:before,.leaflet-tooltip-left:before,.leaflet-tooltip-right:before,.leaflet-tooltip-top:before{background:transparent;border:6px solid transparent;content:\"\";pointer-events:none;position:absolute}.leaflet-tooltip-bottom{margin-top:6px}.leaflet-tooltip-top{margin-top:-6px}.leaflet-tooltip-bottom:before,.leaflet-tooltip-top:before{left:50%;margin-left:-6px}.leaflet-tooltip-top:before{border-top-color:#fff;bottom:0;margin-bottom:-12px}.leaflet-tooltip-bottom:before{border-bottom-color:#fff;margin-left:-6px;margin-top:-12px;top:0}.leaflet-tooltip-left{margin-left:-6px}.leaflet-tooltip-right{margin-left:6px}.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{margin-top:-6px;top:50%}.leaflet-tooltip-left:before{border-left-color:#fff;margin-right:-12px;right:0}.leaflet-tooltip-right:before{border-right-color:#fff;left:0;margin-left:-12px}";
|
|
3
3
|
|
|
4
4
|
export { css_248z as default, stylesheet };
|
|
5
5
|
//# sourceMappingURL=leaflet.css.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __awaiter } from 'tslib';
|
|
2
2
|
import { select } from 'd3-selection';
|
|
3
3
|
import { feature } from 'topojson-client';
|
|
4
|
-
import {
|
|
4
|
+
import { mapboxglWheelEvent, constraintMapView } from '../renderer/mapboxgl-utils.js';
|
|
5
5
|
import { mapboxglCanvas, onFeatureHover } from '../style.js';
|
|
6
6
|
import { LeafletMapRenderer } from '../types.js';
|
|
7
7
|
|
|
@@ -112,7 +112,7 @@ function setupMap(mapContainer, config) {
|
|
|
112
112
|
maplibreMap = (_b = (_a = layer).getMaplibreMap) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
113
113
|
select(mapContainer).on('wheel', (event) => {
|
|
114
114
|
event.preventDefault();
|
|
115
|
-
|
|
115
|
+
mapboxglWheelEvent(leafletMap, layer, event);
|
|
116
116
|
});
|
|
117
117
|
break;
|
|
118
118
|
case LeafletMapRenderer.Raster:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map.js","sources":["../../../../src/components/leaflet-map/modules/map.ts"],"sourcesContent":["import type L from 'leaflet'\nimport { select, Selection } from 'd3-selection'\nimport type { GeoJSONSource, Map } from 'maplibre-gl'\nimport { feature } from 'topojson-client'\n\n// Types\nimport { GenericDataRecord } from 'types/data'\n\n// Config\nimport { LeafletMapConfigInterface } from '../config'\n\n// Local Types\n\n// Utils\nimport { constraintMapView, mapboxglWheelEventThrottled } from '../renderer/mapboxgl-utils'\n\n// Styles\nimport * as s from '../style'\nimport { LeafletMapRenderer } from '../types'\n\nexport const initialMapCenter: L.LatLngExpression = [36, 14]\nexport const initialMapZoom = 1.9\n\nexport function updateTopoJson<T extends GenericDataRecord> (maplibreMap: Map, config: LeafletMapConfigInterface<T>): void {\n const { topoJSONLayer } = config\n\n if (topoJSONLayer.sources) {\n const featureObject = topoJSONLayer.sources?.objects?.[topoJSONLayer.featureName]\n if (featureObject) {\n const mapSource = maplibreMap.getSource(topoJSONLayer.featureName) as GeoJSONSource\n const featureCollection = feature(topoJSONLayer.sources, featureObject)\n if (mapSource) {\n mapSource.setData(featureCollection)\n } else {\n maplibreMap.addSource(topoJSONLayer.featureName, { type: 'geojson', data: featureCollection })\n }\n }\n }\n\n const fillLayer = maplibreMap.getLayer(`${topoJSONLayer.featureName}-area`)\n if (topoJSONLayer.fillProperty) {\n if (!fillLayer) {\n maplibreMap.addLayer({\n id: `${topoJSONLayer.featureName}-area`,\n type: 'fill',\n source: topoJSONLayer.featureName,\n paint: {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n 'fill-antialias': false,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n 'fill-opacity': topoJSONLayer.fillOpacity,\n },\n })\n }\n maplibreMap.setPaintProperty(`${topoJSONLayer.featureName}-area`, 'fill-color', [\n 'case',\n ['!', ['has', topoJSONLayer.fillProperty]],\n 'rgba(255, 255, 255, 0)',\n ['get', topoJSONLayer.fillProperty],\n ])\n } else if (fillLayer) maplibreMap.removeLayer(`${topoJSONLayer.featureName}-area`)\n\n const strokeLayer = maplibreMap.getLayer(`${topoJSONLayer.featureName}-stroke`)\n if (topoJSONLayer.strokeProperty) {\n if (!strokeLayer) {\n maplibreMap.addLayer({\n id: `${topoJSONLayer.featureName}-stroke`,\n type: 'line',\n source: topoJSONLayer.featureName,\n paint: {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n 'line-opacity': topoJSONLayer.strokeOpacity,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n 'line-width': topoJSONLayer.strokeWidth,\n },\n })\n }\n maplibreMap.setPaintProperty(`${topoJSONLayer.featureName}-stroke`, 'line-color', [\n 'case',\n ['!', ['has', topoJSONLayer.strokeProperty]],\n 'rgba(255, 255, 255, 0)',\n ['get', topoJSONLayer.strokeProperty],\n ])\n } else if (strokeLayer) { maplibreMap.removeLayer(`${topoJSONLayer.featureName}-stroke`) }\n}\n\nexport async function setupMap<T extends GenericDataRecord> (mapContainer: HTMLElement, config: LeafletMapConfigInterface<T>): Promise<{\n leaflet: L.Map;\n layer: L.Layer;\n svgOverlay: Selection<SVGSVGElement, unknown, null, undefined>;\n svgGroup: Selection<SVGGElement, unknown, SVGElement, undefined>;\n}> {\n const { style, renderer, topoJSONLayer } = config\n const leaflet = await import('leaflet')\n const L = leaflet.default\n\n if (!style) {\n console.error('Unovis | Leaflet Map: Please provide style settings in the map configuration object')\n return\n }\n\n const leafletMap = L.map(mapContainer, {\n scrollWheelZoom: renderer === LeafletMapRenderer.Raster, // We define custom scroll event for MapboxGL to enabling smooth zooming\n zoomControl: false,\n zoomDelta: renderer === LeafletMapRenderer.Raster ? 1 : 0.5,\n zoomSnap: renderer === LeafletMapRenderer.Raster ? 1 : 0,\n attributionControl: true,\n center: initialMapCenter,\n zoom: initialMapZoom,\n minZoom: Math.sqrt(mapContainer.offsetWidth) / 17,\n maxZoom: 23,\n maxBounds: L.latLngBounds(\n [-75, -290],\n [85, 290]\n ),\n maxBoundsViscosity: 1,\n })\n\n for (const attr of config.attribution) {\n leafletMap.attributionControl.addAttribution(attr)\n }\n\n let layer: L.Layer | (L.Layer & { getMaplibreMap(): Map })\n let maplibreMap: Map = null\n\n switch (renderer) {\n case LeafletMapRenderer.MapLibre:\n // eslint-disable-next-line no-case-declarations\n const maplibre = await import('maplibre-gl')\n // eslint-disable-next-line no-case-declarations\n const { getMaplibreGLLayer } = await import('../renderer/mapboxgl-layer')\n layer = getMaplibreGLLayer(config, L, maplibre.default)\n layer.addTo(leafletMap)\n maplibreMap = (layer as ReturnType<typeof getMaplibreGLLayer>).getMaplibreMap?.()\n\n select(mapContainer).on('wheel', (event: WheelEvent) => {\n event.preventDefault()\n mapboxglWheelEventThrottled(leafletMap, layer as (L.Layer & { getMaplibreMap(): Map }), event)\n })\n break\n case LeafletMapRenderer.Raster:\n layer = L.tileLayer(style as string)\n layer.addTo(leafletMap)\n break\n }\n // leaflet-mapbox-gl has a layer positioning issue on far zoom levels which leads to having wrong\n // map points projection. We constrain the view to prevent that.\n constraintMapView(leafletMap)\n\n if (maplibreMap && topoJSONLayer?.sources) {\n const canvas = maplibreMap.getCanvas()\n const canvasSelection = select(canvas).classed(s.mapboxglCanvas, true)\n const tilePaneSelection = select(leafletMap.getPanes().tilePane)\n\n maplibreMap.on('mousemove', (event) => {\n const layerName = `${topoJSONLayer.featureName}-area`\n const layer = maplibreMap.getLayer(layerName)\n if (!layer) return\n\n const features = maplibreMap.queryRenderedFeatures(event.point, { layers: [layerName] })\n tilePaneSelection.datum(features[0])\n canvasSelection.classed(s.onFeatureHover, Boolean(features[0]))\n })\n\n maplibreMap.on('load', () => {\n updateTopoJson(maplibreMap, config)\n })\n }\n\n const svgOverlay = select(leafletMap.getPanes().overlayPane).append('svg')\n const svgGroup = svgOverlay.append('g')\n\n return {\n leaflet: leafletMap,\n layer,\n svgOverlay,\n svgGroup,\n }\n}\n"],"names":["s.mapboxglCanvas","s.onFeatureHover"],"mappings":";;;;;;;MAoBa,gBAAgB,GAAuB,CAAC,EAAE,EAAE,EAAE,EAAC;AACrD,MAAM,cAAc,GAAG,IAAG;AAEjB,SAAA,cAAc,CAA+B,WAAgB,EAAE,MAAoC,EAAA;;AACjH,IAAA,MAAM,EAAE,aAAa,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;;;;"}
|
|
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, mapboxglWheelEvent } 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 mapboxglWheelEvent(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,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AG,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;QAEvC,OAAO;AACL,YAAA,OAAO,EAAE,UAAU;YACnB,KAAK;YACL,UAAU;YACV,QAAQ;SACT,CAAA;;AACF;;;;"}
|
|
@@ -4,5 +4,4 @@ export declare function constraintMapView(map: L.Map, latMin?: number, latMax?:
|
|
|
4
4
|
export declare function mapboxglWheelEvent(map: L.Map, layer: L.Layer & {
|
|
5
5
|
getMaplibreMap(): Map;
|
|
6
6
|
}, event: WheelEvent): void;
|
|
7
|
-
export declare const mapboxglWheelEventThrottled: import("throttle-debounce").throttle<typeof mapboxglWheelEvent>;
|
|
8
7
|
export declare const constraintMapViewThrottled: import("throttle-debounce").throttle<typeof constraintMapView>;
|
|
@@ -32,8 +32,7 @@ function mapboxglWheelEvent(map, layer, event) {
|
|
|
32
32
|
const xy = map.mouseEventToLayerPoint(event);
|
|
33
33
|
map.setZoomAround(xy, zoom + 1, { animate: false });
|
|
34
34
|
}
|
|
35
|
-
const mapboxglWheelEventThrottled = throttle(mapboxglWheelEvent, 32);
|
|
36
35
|
const constraintMapViewThrottled = throttle(constraintMapView, 1000);
|
|
37
36
|
|
|
38
|
-
export { constraintMapView, constraintMapViewThrottled, mapboxglWheelEvent
|
|
37
|
+
export { constraintMapView, constraintMapViewThrottled, mapboxglWheelEvent };
|
|
39
38
|
//# sourceMappingURL=mapboxgl-utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapboxgl-utils.js","sources":["../../../../src/components/leaflet-map/renderer/mapboxgl-utils.ts"],"sourcesContent":["import type L from 'leaflet'\nimport type { Map } from 'maplibre-gl'\n\n// Utils\nimport { throttle } from 'utils/data'\n\nexport function constraintMapView (map: L.Map, latMin = -75, latMax = 85): void {\n const bounds = map.getBounds()\n const northEast = bounds.getNorthEast()\n const southWest = bounds.getSouthWest()\n\n if (northEast.lat > latMax && southWest.lat < latMin) {\n map.fitBounds([\n [latMin, 0],\n [latMax, 0],\n ])\n }\n}\n\nexport function mapboxglWheelEvent (\n map: L.Map,\n layer: L.Layer & { getMaplibreMap(): Map },\n event: WheelEvent\n): void {\n const { deltaY } = event\n if (!layer || !layer.getMaplibreMap) return\n const mapboxmap = layer.getMaplibreMap()\n const delta = deltaY * -1\n\n // Prevent Map from being zoomed-out too far away\n const bounds = map.getBounds()\n const northEast = bounds.getNorthEast()\n const southWest = bounds.getSouthWest()\n const latMin = -70\n const latMax = 80\n if (delta < 0 && northEast.lat > latMax && southWest.lat < latMin) {\n constraintMapView(map)\n return\n }\n\n const zoom = mapboxmap.getZoom() + delta * 0.001\n const xy = map.mouseEventToLayerPoint(event)\n map.setZoomAround(xy, zoom + 1, { animate: false })\n}\n\nexport const
|
|
1
|
+
{"version":3,"file":"mapboxgl-utils.js","sources":["../../../../src/components/leaflet-map/renderer/mapboxgl-utils.ts"],"sourcesContent":["import type L from 'leaflet'\nimport type { Map } from 'maplibre-gl'\n\n// Utils\nimport { throttle } from 'utils/data'\n\nexport function constraintMapView (map: L.Map, latMin = -75, latMax = 85): void {\n const bounds = map.getBounds()\n const northEast = bounds.getNorthEast()\n const southWest = bounds.getSouthWest()\n\n if (northEast.lat > latMax && southWest.lat < latMin) {\n map.fitBounds([\n [latMin, 0],\n [latMax, 0],\n ])\n }\n}\n\nexport function mapboxglWheelEvent (\n map: L.Map,\n layer: L.Layer & { getMaplibreMap(): Map },\n event: WheelEvent\n): void {\n const { deltaY } = event\n if (!layer || !layer.getMaplibreMap) return\n const mapboxmap = layer.getMaplibreMap()\n const delta = deltaY * -1\n\n // Prevent Map from being zoomed-out too far away\n const bounds = map.getBounds()\n const northEast = bounds.getNorthEast()\n const southWest = bounds.getSouthWest()\n const latMin = -70\n const latMax = 80\n if (delta < 0 && northEast.lat > latMax && southWest.lat < latMin) {\n constraintMapView(map)\n return\n }\n\n const zoom = mapboxmap.getZoom() + delta * 0.001\n const xy = map.mouseEventToLayerPoint(event)\n map.setZoomAround(xy, zoom + 1, { animate: false })\n}\n\n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AC,GAAG,GAAG,MAAM,EAAE;QACjE,iBAAiB,CAAC,GAAG,CAAC,CAAA;QACtB,OAAM;AACP,KAAA;IAED,MAAM,IAAI,GAAG,SAAS,CAAC,OAAO,EAAE,GAAG,KAAK,GAAG,KAAK,CAAA;IAChD,MAAM,EAAE,GAAG,GAAG,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAA;AAC5C,IAAA,GAAG,CAAC,aAAa,CAAC,EAAE,EAAE,IAAI,GAAG,CAAC,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAA;AACrD,CAAC;AAEY,MAAA,0BAA0B,GAAG,QAAQ,CAAC,iBAAiB,EAAE,IAAI;;;;"}
|
|
@@ -1,13 +1,24 @@
|
|
|
1
|
+
import { D3ZoomEvent } from 'd3-zoom';
|
|
1
2
|
import { ComponentConfigInterface } from "../../core/component/config";
|
|
2
3
|
import { ColorAccessor, GenericAccessor, NumericAccessor, StringAccessor } from "../../types/accessor";
|
|
3
4
|
import { TrimMode, VerticalAlign, FitMode } from "../../types/text";
|
|
4
5
|
import { Position } from "../../types/position";
|
|
5
|
-
import { SankeyInputLink, SankeyInputNode, SankeyNodeAlign, SankeySubLabelPlacement, SankeyExitTransitionType, SankeyEnterTransitionType, SankeyLink, SankeyNode } from './types';
|
|
6
|
+
import { SankeyInputLink, SankeyInputNode, SankeyNodeAlign, SankeySubLabelPlacement, SankeyExitTransitionType, SankeyEnterTransitionType, SankeyLink, SankeyNode, SankeyZoomMode } from './types';
|
|
6
7
|
export interface SankeyConfigInterface<N extends SankeyInputNode, L extends SankeyInputLink> extends ComponentConfigInterface {
|
|
7
8
|
/** Node / Link id accessor function. Used for mapping of data updates to corresponding SVG objects. Default: `(d, i) => d.id ?? i.toString()` */
|
|
8
9
|
id?: (d: SankeyInputNode | SankeyInputLink, i: number, ...any: unknown[]) => string;
|
|
9
10
|
/** Coefficient to scale the height of the diagram when the amount of links is low: `C * links.length`, clamped to `[height / 2, height]`. Default: `1/16` */
|
|
10
11
|
heightNormalizationCoeff?: number;
|
|
12
|
+
/** Horizontal and vertical scale factor applied to the computed layout (column spacing). Keeps node width intact. Default: `undefined` */
|
|
13
|
+
zoomScale?: [number, number];
|
|
14
|
+
/** Pan offset in pixels. Default: `undefined` */
|
|
15
|
+
zoomPan?: [number, number];
|
|
16
|
+
/** Enable interactive zoom/pan behavior. Default: `true` */
|
|
17
|
+
enableZoom?: boolean;
|
|
18
|
+
/** Allowed interactive zoom scale extent. Default: `[1, 5]` */
|
|
19
|
+
zoomExtent?: [number, number];
|
|
20
|
+
/** Zoom interaction mode. Default: `SankeyZoomMode.XY` */
|
|
21
|
+
zoomMode?: SankeyZoomMode | string;
|
|
11
22
|
/** Type of animation on removing nodes. Default: `ExitTransitionType.Default` */
|
|
12
23
|
exitTransitionType?: SankeyExitTransitionType;
|
|
13
24
|
/** Type of animation on creating nodes. Default: `EnterTransitionType.Default` */
|
|
@@ -77,10 +88,14 @@ export interface SankeyConfigInterface<N extends SankeyInputNode, L extends Sank
|
|
|
77
88
|
labelVerticalAlign?: VerticalAlign | string;
|
|
78
89
|
/** Label background */
|
|
79
90
|
labelBackground?: boolean;
|
|
80
|
-
/** Label fit mode (wrap or trim). Default: `FitMode.
|
|
91
|
+
/** Label fit mode (wrap or trim). Default: `FitMode.Trim` **/
|
|
81
92
|
labelFit?: FitMode;
|
|
82
93
|
/** Maximum label with in pixels. Default: `70` */
|
|
83
94
|
labelMaxWidth?: number;
|
|
95
|
+
/** Whether to take the available space for the label. This property is used only if `labelMaxWidth` is not provided. Default: `false` */
|
|
96
|
+
labelMaxWidthTakeAvailableSpace?: boolean;
|
|
97
|
+
/** Tolerance for the available space for the label. This property is used only if `labelMaxWidthTakeAvailableSpace` is `true`. Default: `undefined` (use label and sub-label font sizes) */
|
|
98
|
+
labelMaxWidthTakeAvailableSpaceTolerance?: number;
|
|
84
99
|
/** Expand trimmed label on hover. Default: `true` */
|
|
85
100
|
labelExpandTrimmedOnHover?: boolean;
|
|
86
101
|
/** Label trimming mode. Default: `TrimMode.Middle` */
|
|
@@ -89,6 +104,8 @@ export interface SankeyConfigInterface<N extends SankeyInputNode, L extends Sank
|
|
|
89
104
|
labelFontSize?: number;
|
|
90
105
|
/** Label text separators for wrapping. Default: `[' ', '-']` */
|
|
91
106
|
labelTextSeparator?: string[];
|
|
107
|
+
/** Label text decoration. Default: `undefined` */
|
|
108
|
+
labelTextDecoration?: StringAccessor<SankeyNode<N, L>>;
|
|
92
109
|
/** Force break words to fit long labels. Default: `true` */
|
|
93
110
|
labelForceWordBreak?: boolean;
|
|
94
111
|
/** Label color. Default: `undefined` */
|
|
@@ -108,10 +125,16 @@ export interface SankeyConfigInterface<N extends SankeyInputNode, L extends Sank
|
|
|
108
125
|
subLabelColor?: ColorAccessor<SankeyNode<N, L>>;
|
|
109
126
|
/** Sub-label position. Default: `SankeySubLabelPlacement.Below` */
|
|
110
127
|
subLabelPlacement?: SankeySubLabelPlacement | string;
|
|
128
|
+
/** Sub-label text decoration. Default: `undefined` */
|
|
129
|
+
subLabelTextDecoration?: StringAccessor<SankeyNode<N, L>>;
|
|
111
130
|
/**
|
|
112
131
|
* Sub-label to label width ratio when `subLabelPlacement` is set to `SankeySubLabelPlacement.Inline`
|
|
113
132
|
* Default: `0.4`, which means that 40% of `labelMaxWidth` will be given to sub-label, and 60% to the main label.
|
|
114
133
|
*/
|
|
115
134
|
subLabelToLabelInlineWidthRatio?: number;
|
|
135
|
+
/** Zoom event callback. Default: `undefined` */
|
|
136
|
+
onZoom?: (horizontalScale: number, verticalScale: number, panX: number, panY: number, zoomExtent: [number, number], event: D3ZoomEvent<SVGGElement, unknown> | undefined) => void;
|
|
137
|
+
/** Set selected nodes by unique id. Default: `undefined` */
|
|
138
|
+
selectedNodeIds?: string[];
|
|
116
139
|
}
|
|
117
140
|
export declare const SankeyDefaultConfig: SankeyConfigInterface<SankeyInputNode, SankeyInputLink>;
|
|
@@ -2,10 +2,10 @@ import { ComponentDefaultConfig } from '../../core/component/config.js';
|
|
|
2
2
|
import { getNumber } from '../../utils/data.js';
|
|
3
3
|
import { VerticalAlign, FitMode, TrimMode } from '../../types/text.js';
|
|
4
4
|
import { Position } from '../../types/position.js';
|
|
5
|
-
import { SankeyExitTransitionType, SankeyEnterTransitionType, SankeyNodeAlign, SankeySubLabelPlacement } from './types.js';
|
|
5
|
+
import { SankeyZoomMode, SankeyExitTransitionType, SankeyEnterTransitionType, SankeyNodeAlign, SankeySubLabelPlacement } from './types.js';
|
|
6
6
|
|
|
7
7
|
// Config
|
|
8
|
-
const SankeyDefaultConfig = (Object.assign(Object.assign({}, ComponentDefaultConfig), { heightNormalizationCoeff: 1 / 16, exitTransitionType: SankeyExitTransitionType.Default, enterTransitionType: SankeyEnterTransitionType.Default, id: (d, i) => { var _a; return (_a = d._id) !== null && _a !== void 0 ? _a : `${i}`; }, highlightSubtreeOnHover: false, highlightDuration: 300, highlightDelay: 1000, iterations: 32, nodeSort: undefined, nodeWidth: 25, nodeAlign: SankeyNodeAlign.Justify, nodeHorizontalSpacing: 150, nodeMinHeight: 20, nodeMaxHeight: 100, nodePadding: 2, nodeColor: (d) => d.color, nodeFixedValue: (d) => d.fixedValue, showSingleNode: true, nodeCursor: undefined, nodeIcon: undefined, nodeIconColor: undefined, label: (d) => d.label, labelPosition: Position.Auto, labelVerticalAlign: VerticalAlign.Middle, labelBackground: false, labelTextSeparator: [' ', '-'], labelFit: FitMode.Trim, labelTrimMode: TrimMode.Middle, labelForceWordBreak: true, labelFontSize: undefined, labelCursor: undefined, labelColor: undefined, labelMaxWidth:
|
|
8
|
+
const SankeyDefaultConfig = (Object.assign(Object.assign({}, ComponentDefaultConfig), { heightNormalizationCoeff: 1 / 16, zoomScale: undefined, zoomPan: undefined, enableZoom: false, zoomExtent: [1, 5], zoomMode: SankeyZoomMode.Y, exitTransitionType: SankeyExitTransitionType.Default, enterTransitionType: SankeyEnterTransitionType.Default, id: (d, i) => { var _a; return (_a = d._id) !== null && _a !== void 0 ? _a : `${i}`; }, highlightSubtreeOnHover: false, highlightDuration: 300, highlightDelay: 1000, iterations: 32, nodeSort: undefined, nodeWidth: 25, nodeAlign: SankeyNodeAlign.Justify, nodeHorizontalSpacing: 150, nodeMinHeight: 20, nodeMaxHeight: 100, nodePadding: 2, nodeColor: (d) => d.color, nodeFixedValue: (d) => d.fixedValue, showSingleNode: true, nodeCursor: undefined, nodeIcon: undefined, nodeIconColor: undefined, label: (d) => d.label, labelPosition: Position.Auto, labelVerticalAlign: VerticalAlign.Middle, labelBackground: false, labelTextSeparator: [' ', '-'], labelTextDecoration: undefined, labelFit: FitMode.Trim, labelTrimMode: TrimMode.Middle, labelForceWordBreak: true, labelFontSize: undefined, labelCursor: undefined, labelColor: undefined, labelMaxWidth: undefined, labelMaxWidthTakeAvailableSpace: false, labelMaxWidthTakeAvailableSpaceTolerance: undefined, labelExpandTrimmedOnHover: true, labelVisibility: undefined, subLabel: undefined, subLabelFontSize: undefined, subLabelColor: undefined, subLabelPlacement: SankeySubLabelPlacement.Below, subLabelToLabelInlineWidthRatio: 0.4, subLabelTextDecoration: undefined, linkValue: (d) => d.value, linkColor: (d) => d.color, linkCursor: undefined, onZoom: undefined, selectedNodeIds: undefined,
|
|
9
9
|
// https://stackoverflow.com/a/21648197/2040291
|
|
10
10
|
init: function () {
|
|
11
11
|
this.linkSort =
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sources":["../../../src/components/sankey/config.ts"],"sourcesContent":["// Config\nimport { ComponentConfigInterface, ComponentDefaultConfig } from 'core/component/config'\n\n// Utils\nimport { getNumber } from 'utils/data'\n\n// Types\nimport { ColorAccessor, GenericAccessor, NumericAccessor, StringAccessor } from 'types/accessor'\nimport { TrimMode, VerticalAlign, FitMode } from 'types/text'\nimport { Position } from 'types/position'\nimport {\n SankeyInputLink,\n SankeyInputNode,\n SankeyNodeAlign,\n SankeySubLabelPlacement,\n SankeyExitTransitionType,\n SankeyEnterTransitionType,\n SankeyLink,\n SankeyNode,\n} from './types'\n\nexport interface SankeyConfigInterface<N extends SankeyInputNode, L extends SankeyInputLink> extends ComponentConfigInterface {\n // General\n /** Node / Link id accessor function. Used for mapping of data updates to corresponding SVG objects. Default: `(d, i) => d.id ?? i.toString()` */\n id?: (d: SankeyInputNode | SankeyInputLink, i: number, ...any: unknown[]) => string;\n /** Coefficient to scale the height of the diagram when the amount of links is low: `C * links.length`, clamped to `[height / 2, height]`. Default: `1/16` */\n heightNormalizationCoeff?: number;\n /** Type of animation on removing nodes. Default: `ExitTransitionType.Default` */\n exitTransitionType?: SankeyExitTransitionType;\n /** Type of animation on creating nodes. Default: `EnterTransitionType.Default` */\n enterTransitionType?: SankeyEnterTransitionType;\n /** Highlight the corresponding subtree on node / link hover. Default: `false` */\n highlightSubtreeOnHover?: boolean;\n /** Highlight animation duration, ms. Default: `400` */\n highlightDuration?: number;\n /** Highlight delay, ms. Default: `1000` */\n highlightDelay?: number;\n /** Sankey algorithm iterations. Default: `32` */\n iterations?: number;\n\n // Sorting\n /** Sankey node sorting function. Default: `undefined`.\n * Node sorting is applied to nodes in one layer (column). Layer by layer.\n * Options: `undefined` - the order is determined by the layout;\n * `null` - the order is fixed by the input;\n * sort function - the order is determined by the function.\n */\n nodeSort?: ((node1: SankeyNode<N, L>, node2: SankeyNode<N, L>) => number) | null | undefined;\n /** Sankey link sorting function. Default: `(link2, link1) => link1.value - link2.value`.\n * Link sorting is applied to the source (exiting) links within one node.\n * Options: `undefined` - the order is determined by the layout;\n * `null` - the order is fixed by the input;\n * sort function - the order is determined by the function.\n */\n linkSort?: ((link1: SankeyLink<N, L>, link2: SankeyLink<N, L>) => number) | null | undefined;\n\n // Nodes\n /** Sankey node width in pixels */\n nodeWidth?: number;\n /** Sankey node alignment method */\n nodeAlign?: SankeyNodeAlign;\n /** Horizontal space between the nodes. Extended Sizing property only. Default: `150` */\n nodeHorizontalSpacing?: number;\n /** Minimum node height. Extended Sizing property only. Default: `20` */\n nodeMinHeight?: number;\n /** Maximum node height. Extended Sizing property only. Default: `100` */\n nodeMaxHeight?: number;\n /** Sankey vertical separation between nodes in pixels. Default: `2` */\n nodePadding?: number;\n /** Display the graph when data has just one element */\n showSingleNode?: boolean;\n /** Node cursor on hover. Default: `undefined` */\n nodeCursor?: StringAccessor<SankeyNode<N, L>>;\n /** Node icon accessor function or value. Default: `undefined` */\n nodeIcon?: StringAccessor<SankeyNode<N, L>>;\n /** Node color accessor function or value. Default: `undefined` */\n nodeColor?: ColorAccessor<SankeyNode<N, L>>;\n /** Node `fixedValue` accessor function or constant. It defines the node value that will be used to calculate\n * the height of the nodes by d3-sankey (by default the height will be based on aggregated `linkValue`).\n * Default: `n => n.fixedValue`\n */\n nodeFixedValue?: NumericAccessor<N>;\n /** Icon color accessor function or value. Default: `undefined` */\n nodeIconColor?: ColorAccessor<SankeyNode<N, L>>;\n\n // Links\n /** Link color accessor function or value. Default: `l => l.color` */\n linkColor?: StringAccessor<SankeyLink<N, L>>;\n /** Link flow accessor function or value. Default: `l => l.value` */\n linkValue?: NumericAccessor<L>;\n /** Link cursor on hover. Default: `undefined` */\n linkCursor?: StringAccessor<SankeyLink<N, L>>;\n\n // Labels\n /** Node label accessor function or value. Default: `n => n.label` */\n label?: StringAccessor<SankeyNode<N, L>>;\n /** Node sub-label accessor function or value. Default: `undefined` */\n subLabel?: StringAccessor<SankeyNode<N, L>>;\n /** Label position relative to the Node. Default: `Position.AUTO` */\n labelPosition?: GenericAccessor<Position.Auto | Position.Left | Position.Right | string, SankeyNode<N, L>>;\n /** Label vertical alignment */\n labelVerticalAlign?: VerticalAlign | string;\n /** Label background */\n labelBackground?: boolean;\n /** Label fit mode (wrap or trim). Default: `FitMode.TRIM` **/\n labelFit?: FitMode;\n /** Maximum label with in pixels. Default: `70` */\n labelMaxWidth?: number;\n /** Expand trimmed label on hover. Default: `true` */\n labelExpandTrimmedOnHover?: boolean;\n /** Label trimming mode. Default: `TrimMode.Middle` */\n labelTrimMode?: TrimMode;\n /** Label font size in pixels. If not provided, the value of CSS variable `--vis-sankey-node-label-font-size` will be used. Default: `undefined` */\n labelFontSize?: number;\n /** Label text separators for wrapping. Default: `[' ', '-']` */\n labelTextSeparator?: string[];\n /** Force break words to fit long labels. Default: `true` */\n labelForceWordBreak?: boolean;\n /** Label color. Default: `undefined` */\n labelColor?: ColorAccessor<SankeyNode<N, L>>;\n /** Label cursor on hover. Default: `undefined` */\n labelCursor?: StringAccessor<SankeyNode<N, L>>;\n /** Custom function to set the label visibility. Default: `undefined` */\n labelVisibility?: ((d: SankeyNode<N, L>, bbox: { x: number; y: number; width: number; height: number }, hovered: boolean) => boolean) | undefined;\n /** Sub-label font size in pixels. If not provided, the value of CSS variable `--vis-sankey-node-sublabel-font-size` will be used. Default: `undefined` */\n subLabelFontSize?: number;\n /** Sub-label color. Default: `undefined` */\n subLabelColor?: ColorAccessor<SankeyNode<N, L>>;\n /** Sub-label position. Default: `SankeySubLabelPlacement.Below` */\n subLabelPlacement?: SankeySubLabelPlacement | string;\n /**\n * Sub-label to label width ratio when `subLabelPlacement` is set to `SankeySubLabelPlacement.Inline`\n * Default: `0.4`, which means that 40% of `labelMaxWidth` will be given to sub-label, and 60% to the main label.\n */\n subLabelToLabelInlineWidthRatio?: number;\n}\n\nexport const SankeyDefaultConfig: SankeyConfigInterface<SankeyInputNode, SankeyInputLink> = ({\n ...ComponentDefaultConfig,\n heightNormalizationCoeff: 1 / 16,\n exitTransitionType: SankeyExitTransitionType.Default,\n enterTransitionType: SankeyEnterTransitionType.Default,\n id: (d: SankeyInputNode, i: number) => (d as { _id: string })._id ?? `${i}`,\n highlightSubtreeOnHover: false,\n highlightDuration: 300,\n highlightDelay: 1000,\n iterations: 32,\n nodeSort: undefined,\n nodeWidth: 25,\n nodeAlign: SankeyNodeAlign.Justify,\n nodeHorizontalSpacing: 150,\n nodeMinHeight: 20,\n nodeMaxHeight: 100,\n nodePadding: 2,\n nodeColor: (d: SankeyInputNode) => (d as { color: string }).color,\n nodeFixedValue: (d: SankeyInputNode) => (d as { fixedValue: number }).fixedValue,\n showSingleNode: true,\n nodeCursor: undefined,\n nodeIcon: undefined,\n nodeIconColor: undefined,\n label: (d: SankeyInputNode) => (d as { label: string }).label,\n labelPosition: Position.Auto,\n labelVerticalAlign: VerticalAlign.Middle,\n labelBackground: false,\n labelTextSeparator: [' ', '-'],\n labelFit: FitMode.Trim,\n labelTrimMode: TrimMode.Middle,\n labelForceWordBreak: true,\n labelFontSize: undefined,\n labelCursor: undefined,\n labelColor: undefined,\n labelMaxWidth: 70,\n labelExpandTrimmedOnHover: true,\n labelVisibility: undefined,\n subLabel: undefined,\n subLabelFontSize: undefined,\n subLabelColor: undefined,\n subLabelPlacement: SankeySubLabelPlacement.Below,\n subLabelToLabelInlineWidthRatio: 0.4,\n linkValue: (d: SankeyInputNode) => (d as { value: number }).value,\n linkColor: (d: SankeyInputNode) => (d as { color: string }).color,\n linkCursor: undefined,\n\n // https://stackoverflow.com/a/21648197/2040291\n init: function () {\n (this as SankeyConfigInterface<SankeyInputNode, SankeyInputLink>).linkSort =\n (link2, link1) => getNumber(link1, this.linkValue) - getNumber(link2, this.linkValue)\n delete this.init\n return this\n },\n}).init()\n\n"],"names":[],"mappings":";;;;;;AAAA;AAyIa,MAAA,mBAAmB,GAA4D,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACvF,sBAAsB,CAAA,EAAA,EACzB,wBAAwB,EAAE,CAAC,GAAG,EAAE,EAChC,kBAAkB,EAAE,wBAAwB,CAAC,OAAO,EACpD,mBAAmB,EAAE,yBAAyB,CAAC,OAAO,EACtD,EAAE,EAAE,CAAC,CAAkB,EAAE,CAAS,KAAK,EAAA,IAAA,EAAA,CAAA,CAAA,OAAA,CAAC,EAAA,GAAA,CAAqB,CAAC,GAAG,MAAI,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAA,CAAA,EAAG,CAAC,CAAA,CAAE,CAAA,EAAA,EAC3E,uBAAuB,EAAE,K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AAI,EAAE,YAAA;AACH,QAAA,IAAgE,CAAC,QAAQ;YACxE,CAAC,KAAK,EAAE,KAAK,KAAK,SAAS,CAAC,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,CAAA;QACvF,OAAO,IAAI,CAAC,IAAI,CAAA;AAChB,QAAA,OAAO,IAAI,CAAA;AACb,KAAC,EACD,CAAA,EAAC,IAAI;;;;"}
|
|
1
|
+
{"version":3,"file":"config.js","sources":["../../../src/components/sankey/config.ts"],"sourcesContent":["import { D3ZoomEvent } from 'd3-zoom'\n\n// Config\nimport { ComponentConfigInterface, ComponentDefaultConfig } from 'core/component/config'\n\n// Utils\nimport { getNumber } from 'utils/data'\n\n// Types\nimport { ColorAccessor, GenericAccessor, NumericAccessor, StringAccessor } from 'types/accessor'\nimport { TrimMode, VerticalAlign, FitMode } from 'types/text'\nimport { Position } from 'types/position'\nimport {\n SankeyInputLink,\n SankeyInputNode,\n SankeyNodeAlign,\n SankeySubLabelPlacement,\n SankeyExitTransitionType,\n SankeyEnterTransitionType,\n SankeyLink,\n SankeyNode,\n SankeyZoomMode,\n} from './types'\n\nexport interface SankeyConfigInterface<N extends SankeyInputNode, L extends SankeyInputLink> extends ComponentConfigInterface {\n // General\n /** Node / Link id accessor function. Used for mapping of data updates to corresponding SVG objects. Default: `(d, i) => d.id ?? i.toString()` */\n id?: (d: SankeyInputNode | SankeyInputLink, i: number, ...any: unknown[]) => string;\n /** Coefficient to scale the height of the diagram when the amount of links is low: `C * links.length`, clamped to `[height / 2, height]`. Default: `1/16` */\n heightNormalizationCoeff?: number;\n /** Horizontal and vertical scale factor applied to the computed layout (column spacing). Keeps node width intact. Default: `undefined` */\n zoomScale?: [number, number];\n /** Pan offset in pixels. Default: `undefined` */\n zoomPan?: [number, number];\n /** Enable interactive zoom/pan behavior. Default: `true` */\n enableZoom?: boolean;\n /** Allowed interactive zoom scale extent. Default: `[1, 5]` */\n zoomExtent?: [number, number];\n /** Zoom interaction mode. Default: `SankeyZoomMode.XY` */\n zoomMode?: SankeyZoomMode | string;\n /** Type of animation on removing nodes. Default: `ExitTransitionType.Default` */\n exitTransitionType?: SankeyExitTransitionType;\n /** Type of animation on creating nodes. Default: `EnterTransitionType.Default` */\n enterTransitionType?: SankeyEnterTransitionType;\n /** Highlight the corresponding subtree on node / link hover. Default: `false` */\n highlightSubtreeOnHover?: boolean;\n /** Highlight animation duration, ms. Default: `400` */\n highlightDuration?: number;\n /** Highlight delay, ms. Default: `1000` */\n highlightDelay?: number;\n /** Sankey algorithm iterations. Default: `32` */\n iterations?: number;\n\n // Sorting\n /** Sankey node sorting function. Default: `undefined`.\n * Node sorting is applied to nodes in one layer (column). Layer by layer.\n * Options: `undefined` - the order is determined by the layout;\n * `null` - the order is fixed by the input;\n * sort function - the order is determined by the function.\n */\n nodeSort?: ((node1: SankeyNode<N, L>, node2: SankeyNode<N, L>) => number) | null | undefined;\n /** Sankey link sorting function. Default: `(link2, link1) => link1.value - link2.value`.\n * Link sorting is applied to the source (exiting) links within one node.\n * Options: `undefined` - the order is determined by the layout;\n * `null` - the order is fixed by the input;\n * sort function - the order is determined by the function.\n */\n linkSort?: ((link1: SankeyLink<N, L>, link2: SankeyLink<N, L>) => number) | null | undefined;\n\n // Nodes\n /** Sankey node width in pixels */\n nodeWidth?: number;\n /** Sankey node alignment method */\n nodeAlign?: SankeyNodeAlign;\n /** Horizontal space between the nodes. Extended Sizing property only. Default: `150` */\n nodeHorizontalSpacing?: number;\n /** Minimum node height. Extended Sizing property only. Default: `20` */\n nodeMinHeight?: number;\n /** Maximum node height. Extended Sizing property only. Default: `100` */\n nodeMaxHeight?: number;\n /** Sankey vertical separation between nodes in pixels. Default: `2` */\n nodePadding?: number;\n /** Display the graph when data has just one element */\n showSingleNode?: boolean;\n /** Node cursor on hover. Default: `undefined` */\n nodeCursor?: StringAccessor<SankeyNode<N, L>>;\n /** Node icon accessor function or value. Default: `undefined` */\n nodeIcon?: StringAccessor<SankeyNode<N, L>>;\n /** Node color accessor function or value. Default: `undefined` */\n nodeColor?: ColorAccessor<SankeyNode<N, L>>;\n /** Node `fixedValue` accessor function or constant. It defines the node value that will be used to calculate\n * the height of the nodes by d3-sankey (by default the height will be based on aggregated `linkValue`).\n * Default: `n => n.fixedValue`\n */\n nodeFixedValue?: NumericAccessor<N>;\n /** Icon color accessor function or value. Default: `undefined` */\n nodeIconColor?: ColorAccessor<SankeyNode<N, L>>;\n\n // Links\n /** Link color accessor function or value. Default: `l => l.color` */\n linkColor?: StringAccessor<SankeyLink<N, L>>;\n /** Link flow accessor function or value. Default: `l => l.value` */\n linkValue?: NumericAccessor<L>;\n /** Link cursor on hover. Default: `undefined` */\n linkCursor?: StringAccessor<SankeyLink<N, L>>;\n\n // Labels\n /** Node label accessor function or value. Default: `n => n.label` */\n label?: StringAccessor<SankeyNode<N, L>>;\n /** Node sub-label accessor function or value. Default: `undefined` */\n subLabel?: StringAccessor<SankeyNode<N, L>>;\n /** Label position relative to the Node. Default: `Position.AUTO` */\n labelPosition?: GenericAccessor<Position.Auto | Position.Left | Position.Right | string, SankeyNode<N, L>>;\n /** Label vertical alignment */\n labelVerticalAlign?: VerticalAlign | string;\n /** Label background */\n labelBackground?: boolean;\n /** Label fit mode (wrap or trim). Default: `FitMode.Trim` **/\n labelFit?: FitMode;\n /** Maximum label with in pixels. Default: `70` */\n labelMaxWidth?: number;\n /** Whether to take the available space for the label. This property is used only if `labelMaxWidth` is not provided. Default: `false` */\n labelMaxWidthTakeAvailableSpace?: boolean;\n /** Tolerance for the available space for the label. This property is used only if `labelMaxWidthTakeAvailableSpace` is `true`. Default: `undefined` (use label and sub-label font sizes) */\n labelMaxWidthTakeAvailableSpaceTolerance?: number;\n /** Expand trimmed label on hover. Default: `true` */\n labelExpandTrimmedOnHover?: boolean;\n /** Label trimming mode. Default: `TrimMode.Middle` */\n labelTrimMode?: TrimMode;\n /** Label font size in pixels. If not provided, the value of CSS variable `--vis-sankey-node-label-font-size` will be used. Default: `undefined` */\n labelFontSize?: number;\n /** Label text separators for wrapping. Default: `[' ', '-']` */\n labelTextSeparator?: string[];\n /** Label text decoration. Default: `undefined` */\n labelTextDecoration?: StringAccessor<SankeyNode<N, L>>;\n /** Force break words to fit long labels. Default: `true` */\n labelForceWordBreak?: boolean;\n /** Label color. Default: `undefined` */\n labelColor?: ColorAccessor<SankeyNode<N, L>>;\n /** Label cursor on hover. Default: `undefined` */\n labelCursor?: StringAccessor<SankeyNode<N, L>>;\n /** Custom function to set the label visibility. Default: `undefined` */\n labelVisibility?: ((d: SankeyNode<N, L>, bbox: { x: number; y: number; width: number; height: number }, hovered: boolean) => boolean) | undefined;\n /** Sub-label font size in pixels. If not provided, the value of CSS variable `--vis-sankey-node-sublabel-font-size` will be used. Default: `undefined` */\n subLabelFontSize?: number;\n /** Sub-label color. Default: `undefined` */\n subLabelColor?: ColorAccessor<SankeyNode<N, L>>;\n /** Sub-label position. Default: `SankeySubLabelPlacement.Below` */\n subLabelPlacement?: SankeySubLabelPlacement | string;\n /** Sub-label text decoration. Default: `undefined` */\n subLabelTextDecoration?: StringAccessor<SankeyNode<N, L>>;\n /**\n * Sub-label to label width ratio when `subLabelPlacement` is set to `SankeySubLabelPlacement.Inline`\n * Default: `0.4`, which means that 40% of `labelMaxWidth` will be given to sub-label, and 60% to the main label.\n */\n subLabelToLabelInlineWidthRatio?: number;\n\n // Events\n /** Zoom event callback. Default: `undefined` */\n onZoom?: (horizontalScale: number, verticalScale: number, panX: number, panY: number, zoomExtent: [number, number], event: D3ZoomEvent<SVGGElement, unknown> | undefined) => void;\n\n // Misc\n /** Set selected nodes by unique id. Default: `undefined` */\n selectedNodeIds?: string[];\n}\n\nexport const SankeyDefaultConfig: SankeyConfigInterface<SankeyInputNode, SankeyInputLink> = ({\n ...ComponentDefaultConfig,\n heightNormalizationCoeff: 1 / 16,\n zoomScale: undefined,\n zoomPan: undefined,\n enableZoom: false,\n zoomExtent: [1, 5] as [number, number],\n zoomMode: SankeyZoomMode.Y,\n exitTransitionType: SankeyExitTransitionType.Default,\n enterTransitionType: SankeyEnterTransitionType.Default,\n id: (d: SankeyInputNode, i: number) => (d as { _id: string })._id ?? `${i}`,\n highlightSubtreeOnHover: false,\n highlightDuration: 300,\n highlightDelay: 1000,\n iterations: 32,\n nodeSort: undefined,\n nodeWidth: 25,\n nodeAlign: SankeyNodeAlign.Justify,\n nodeHorizontalSpacing: 150,\n nodeMinHeight: 20,\n nodeMaxHeight: 100,\n nodePadding: 2,\n nodeColor: (d: SankeyInputNode) => (d as { color: string }).color,\n nodeFixedValue: (d: SankeyInputNode) => (d as { fixedValue: number }).fixedValue,\n showSingleNode: true,\n nodeCursor: undefined,\n nodeIcon: undefined,\n nodeIconColor: undefined,\n label: (d: SankeyInputNode) => (d as { label: string }).label,\n labelPosition: Position.Auto,\n labelVerticalAlign: VerticalAlign.Middle,\n labelBackground: false,\n labelTextSeparator: [' ', '-'],\n labelTextDecoration: undefined,\n labelFit: FitMode.Trim,\n labelTrimMode: TrimMode.Middle,\n labelForceWordBreak: true,\n labelFontSize: undefined,\n labelCursor: undefined,\n labelColor: undefined,\n labelMaxWidth: undefined,\n labelMaxWidthTakeAvailableSpace: false,\n labelMaxWidthTakeAvailableSpaceTolerance: undefined,\n labelExpandTrimmedOnHover: true,\n labelVisibility: undefined,\n subLabel: undefined,\n subLabelFontSize: undefined,\n subLabelColor: undefined,\n subLabelPlacement: SankeySubLabelPlacement.Below,\n subLabelToLabelInlineWidthRatio: 0.4,\n subLabelTextDecoration: undefined,\n linkValue: (d: SankeyInputNode) => (d as { value: number }).value,\n linkColor: (d: SankeyInputNode) => (d as { color: string }).color,\n linkCursor: undefined,\n onZoom: undefined,\n selectedNodeIds: undefined,\n\n // https://stackoverflow.com/a/21648197/2040291\n init: function () {\n (this as SankeyConfigInterface<SankeyInputNode, SankeyInputLink>).linkSort =\n (link2, link1) => getNumber(link1, this.linkValue) - getNumber(link2, this.linkValue)\n delete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eAAe,EAAE,KAAK,EACtB,kBAAkB,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,EAC9B,mBAAmB,EAAE,SAAS,EAC9B,QAAQ,EAAE,OAAO,CAAC,IAAI,EACtB,aAAa,EAAE,QAAQ,CAAC,MAAM,EAC9B,mBAAmB,EAAE,IAAI,EACzB,aAAa,EAAE,SAAS,EACxB,WAAW,EAAE,SAAS,EACtB,UAAU,EAAE,SAAS,EACrB,aAAa,EAAE,SAAS,EACxB,+BAA+B,EAAE,KAAK,EACtC,wCAAwC,EAAE,SAAS,EACnD,yBAAyB,EAAE,IAAI,EAC/B,eAAe,EAAE,SAAS,EAC1B,QAAQ,EAAE,SAAS,EACnB,gBAAgB,EAAE,SAAS,EAC3B,aAAa,EAAE,SAAS,EACxB,iBAAiB,EAAE,uBAAuB,CAAC,KAAK,EAChD,+BAA+B,EAAE,GAAG,EACpC,sBAAsB,EAAE,SAAS,EACjC,SAAS,EAAE,CAAC,CAAkB,KAAM,CAAuB,CAAC,KAAK,EACjE,SAAS,EAAE,CAAC,CAAkB,KAAM,CAAuB,CAAC,KAAK,EACjE,UAAU,EAAE,SAAS,EACrB,MAAM,EAAE,SAAS,EACjB,eAAe,EAAE,SAAS;;AAG1B,IAAA,IAAI,EAAE,YAAA;AACH,QAAA,IAAgE,CAAC,QAAQ;YACxE,CAAC,KAAK,EAAE,KAAK,KAAK,SAAS,CAAC,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,CAAA;QACvF,OAAO,IAAI,CAAC,IAAI,CAAA;AAChB,QAAA,OAAO,IAAI,CAAA;AACb,KAAC,EACD,CAAA,EAAC,IAAI;;;;"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Selection } from 'd3-selection';
|
|
1
2
|
import { ComponentCore } from "../../core/component";
|
|
2
3
|
import { GraphDataModel } from "../../data-models/graph";
|
|
3
4
|
import { ExtendedSizeComponent } from "../../types/component";
|
|
@@ -13,22 +14,32 @@ export declare class Sankey<N extends SankeyInputNode, L extends SankeyInputLink
|
|
|
13
14
|
protected _defaultConfig: SankeyConfigInterface<N, L>;
|
|
14
15
|
config: SankeyConfigInterface<N, L>;
|
|
15
16
|
datamodel: GraphDataModel<N, L, SankeyNode<N, L>, SankeyLink<N, L>>;
|
|
17
|
+
g: Selection<SVGGElement, unknown, null, undefined>;
|
|
18
|
+
private _gNode;
|
|
19
|
+
private _prevWidth;
|
|
16
20
|
private _extendedWidth;
|
|
17
21
|
private _extendedHeight;
|
|
18
22
|
private _extendedHeightIncreased;
|
|
23
|
+
private _extendedWidthIncreased;
|
|
19
24
|
private _linksGroup;
|
|
20
25
|
private _nodesGroup;
|
|
21
26
|
private _backgroundRect;
|
|
22
27
|
private _sankey;
|
|
23
28
|
private _highlightTimeoutId;
|
|
24
29
|
private _highlightActive;
|
|
30
|
+
private _zoomScale;
|
|
31
|
+
private _pan;
|
|
32
|
+
private _zoomBehavior;
|
|
33
|
+
private _prevZoomTransform;
|
|
34
|
+
private _animationFrameId;
|
|
35
|
+
private _bleedCached;
|
|
25
36
|
events: {
|
|
26
37
|
[x: string]: {
|
|
27
38
|
mouseenter: (d: SankeyNode<N, L>, event: MouseEvent) => void;
|
|
28
39
|
mouseleave: (d: SankeyNode<N, L>, event: MouseEvent) => void;
|
|
29
40
|
} | {
|
|
30
|
-
mouseenter: (d: SankeyLink<N, L
|
|
31
|
-
mouseleave: (
|
|
41
|
+
mouseenter: (d: SankeyLink<N, L>) => void;
|
|
42
|
+
mouseleave: () => void;
|
|
32
43
|
};
|
|
33
44
|
};
|
|
34
45
|
constructor(config?: SankeyConfigInterface<N, L>);
|
|
@@ -39,18 +50,31 @@ export declare class Sankey<N extends SankeyInputNode, L extends SankeyInputLink
|
|
|
39
50
|
}): void;
|
|
40
51
|
setConfig(config: SankeyConfigInterface<N, L>): void;
|
|
41
52
|
_render(customDuration?: number): void;
|
|
53
|
+
private _applyPanTransform;
|
|
54
|
+
private _scheduleRender;
|
|
55
|
+
setZoomScale(horizontalScale?: number, verticalScale?: number, duration?: number): void;
|
|
56
|
+
getZoomScale(): [number, number];
|
|
57
|
+
setPan(x: number, y: number, duration?: number): void;
|
|
58
|
+
getPan(): [number, number];
|
|
59
|
+
fitView(duration?: number): void;
|
|
60
|
+
private _onZoom;
|
|
42
61
|
private _populateLinkAndNodeValues;
|
|
43
62
|
private _preCalculateComponentSize;
|
|
44
63
|
private _prepareLayout;
|
|
64
|
+
private _applyLayoutScaling;
|
|
45
65
|
getWidth(): number;
|
|
46
66
|
getHeight(): number;
|
|
47
67
|
getLayoutWidth(): number;
|
|
48
68
|
getLayoutHeight(): number;
|
|
69
|
+
/** @deprecated Use getLayerXCenters instead */
|
|
49
70
|
getColumnCenters(): number[];
|
|
71
|
+
getLayerXCenters(): number[];
|
|
72
|
+
getLayerYCenters(): number[];
|
|
50
73
|
highlightSubtree(node: SankeyNode<N, L>): void;
|
|
51
74
|
recursiveSetSubtreeState(node: SankeyNode<N, L>, linksKey: 'sourceLinks' | 'targetLinks', nodeKey: 'source' | 'target', key: string, value: unknown): void;
|
|
52
75
|
disableHighlight(): void;
|
|
53
76
|
private _hasLinks;
|
|
77
|
+
private _getLayerSpacing;
|
|
54
78
|
private _onNodeMouseOver;
|
|
55
79
|
private _onNodeMouseOut;
|
|
56
80
|
private _onNodeRectMouseOver;
|