@guardian/interactive-component-library 0.2.0-rc1 → 0.2.0-rc2
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/dist/_virtual/_commonjsHelpers.js +8 -0
- package/dist/_virtual/dayjs.min.js +4 -0
- package/dist/_virtual/relativeTime.js +4 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/molecules/canvas-map/Map.d.ts +17 -0
- package/dist/components/molecules/canvas-map/Map.js +89 -0
- package/dist/components/molecules/canvas-map/context/MapContext.d.ts +19 -0
- package/dist/components/molecules/canvas-map/context/MapContext.js +20 -0
- package/dist/components/molecules/canvas-map/controls/ZoomControl.d.ts +6 -0
- package/dist/components/molecules/canvas-map/controls/ZoomControl.js +40 -0
- package/dist/components/molecules/canvas-map/controls/icons/index.d.ts +3 -0
- package/dist/components/molecules/canvas-map/controls/icons/minus.d.ts +1 -0
- package/dist/components/molecules/canvas-map/controls/icons/minus.js +25 -0
- package/dist/components/molecules/canvas-map/controls/icons/plus.d.ts +1 -0
- package/dist/components/molecules/canvas-map/controls/icons/plus.js +25 -0
- package/dist/components/molecules/canvas-map/controls/icons/reset.d.ts +3 -0
- package/dist/components/molecules/canvas-map/controls/icons/reset.js +25 -0
- package/dist/components/molecules/canvas-map/controls/index.d.ts +1 -0
- package/dist/components/molecules/canvas-map/controls/style.module.css.js +11 -0
- package/dist/components/molecules/canvas-map/index.d.ts +12 -0
- package/dist/components/molecules/canvas-map/lib/Feature.d.ts +38 -0
- package/dist/components/molecules/canvas-map/lib/Feature.js +104 -0
- package/dist/components/molecules/canvas-map/lib/FeatureCollection.d.ts +20 -0
- package/dist/components/molecules/canvas-map/lib/FeatureCollection.js +23 -0
- package/dist/components/molecules/canvas-map/lib/Map.d.ts +69 -0
- package/dist/components/molecules/canvas-map/lib/Map.js +254 -0
- package/dist/components/molecules/canvas-map/lib/View.d.ts +136 -0
- package/dist/components/molecules/canvas-map/lib/View.js +179 -0
- package/dist/components/molecules/canvas-map/lib/events/Dispatcher.d.ts +8 -0
- package/dist/components/molecules/canvas-map/lib/events/Dispatcher.js +35 -0
- package/dist/components/molecules/canvas-map/lib/events/MapEvent.d.ts +6 -0
- package/dist/components/molecules/canvas-map/lib/events/MapEvent.js +9 -0
- package/dist/components/molecules/canvas-map/lib/events/index.d.ts +2 -0
- package/dist/components/molecules/canvas-map/lib/formats/GeoJSON.d.ts +10 -0
- package/dist/components/molecules/canvas-map/lib/formats/GeoJSON.js +96 -0
- package/dist/components/molecules/canvas-map/lib/geometry/Geometry.d.ts +32 -0
- package/dist/components/molecules/canvas-map/lib/geometry/Geometry.js +41 -0
- package/dist/components/molecules/canvas-map/lib/geometry/LineString.d.ts +12 -0
- package/dist/components/molecules/canvas-map/lib/geometry/LineString.js +19 -0
- package/dist/components/molecules/canvas-map/lib/geometry/Point.d.ts +11 -0
- package/dist/components/molecules/canvas-map/lib/geometry/Point.js +16 -0
- package/dist/components/molecules/canvas-map/lib/geometry/Polygon.d.ts +16 -0
- package/dist/components/molecules/canvas-map/lib/geometry/Polygon.js +46 -0
- package/dist/components/molecules/canvas-map/lib/geometry/index.d.ts +4 -0
- package/dist/components/molecules/canvas-map/lib/interpolators/index.d.ts +2 -0
- package/dist/components/molecules/canvas-map/lib/interpolators/interpolateFeatures.d.ts +5 -0
- package/dist/components/molecules/canvas-map/lib/interpolators/interpolateFeatures.js +95 -0
- package/dist/components/molecules/canvas-map/lib/interpolators/interpolateStyles.d.ts +4 -0
- package/dist/components/molecules/canvas-map/lib/interpolators/interpolateStyles.js +65 -0
- package/dist/components/molecules/canvas-map/lib/layers/TextLayer.d.ts +52 -0
- package/dist/components/molecules/canvas-map/lib/layers/TextLayer.js +111 -0
- package/dist/components/molecules/canvas-map/lib/layers/VectorLayer.d.ts +53 -0
- package/dist/components/molecules/canvas-map/lib/layers/VectorLayer.js +132 -0
- package/dist/components/molecules/canvas-map/lib/layers/index.d.ts +3 -0
- package/dist/components/molecules/canvas-map/lib/projection/index.d.ts +22 -0
- package/dist/components/molecules/canvas-map/lib/projection/index.js +12 -0
- package/dist/components/molecules/canvas-map/lib/renderers/FeatureRenderer.d.ts +6 -0
- package/dist/components/molecules/canvas-map/lib/renderers/FeatureRenderer.js +46 -0
- package/dist/components/molecules/canvas-map/lib/renderers/MapRenderer.d.ts +6 -0
- package/dist/components/molecules/canvas-map/lib/renderers/MapRenderer.js +53 -0
- package/dist/components/molecules/canvas-map/lib/renderers/TextLayerRenderer.d.ts +17 -0
- package/dist/components/molecules/canvas-map/lib/renderers/TextLayerRenderer.js +119 -0
- package/dist/components/molecules/canvas-map/lib/renderers/VectorLayerRenderer.d.ts +10 -0
- package/dist/components/molecules/canvas-map/lib/renderers/VectorLayerRenderer.js +78 -0
- package/dist/components/molecules/canvas-map/lib/sources/VectorSource.d.ts +15 -0
- package/dist/components/molecules/canvas-map/lib/sources/VectorSource.js +56 -0
- package/dist/components/molecules/canvas-map/lib/styles/Fill.d.ts +7 -0
- package/dist/components/molecules/canvas-map/lib/styles/Fill.js +15 -0
- package/dist/components/molecules/canvas-map/lib/styles/Stroke.d.ts +8 -0
- package/dist/components/molecules/canvas-map/lib/styles/Stroke.js +16 -0
- package/dist/components/molecules/canvas-map/lib/styles/Style.d.ts +24 -0
- package/dist/components/molecules/canvas-map/lib/styles/Style.js +17 -0
- package/dist/components/molecules/canvas-map/lib/styles/Text.d.ts +10 -0
- package/dist/components/molecules/canvas-map/lib/styles/Text.js +14 -0
- package/dist/components/molecules/canvas-map/lib/styles/index.d.ts +4 -0
- package/dist/components/molecules/canvas-map/lib/util/array.d.ts +6 -0
- package/dist/components/molecules/canvas-map/lib/util/array.js +15 -0
- package/dist/components/molecules/canvas-map/lib/util/bboxFeature.d.ts +8 -0
- package/dist/components/molecules/canvas-map/lib/util/bboxFeature.js +26 -0
- package/dist/components/molecules/canvas-map/lib/util/debug.d.ts +11 -0
- package/dist/components/molecules/canvas-map/lib/util/debug.js +27 -0
- package/dist/components/molecules/canvas-map/lib/util/deflate.d.ts +36 -0
- package/dist/components/molecules/canvas-map/lib/util/distance.d.ts +1 -0
- package/dist/components/molecules/canvas-map/lib/util/distance.js +12 -0
- package/dist/components/molecules/canvas-map/lib/util/dom.d.ts +9 -0
- package/dist/components/molecules/canvas-map/lib/util/dom.js +28 -0
- package/dist/components/molecules/canvas-map/lib/util/extent.d.ts +21 -0
- package/dist/components/molecules/canvas-map/lib/util/extent.js +38 -0
- package/dist/components/molecules/canvas-map/lib/util/memoise.d.ts +10 -0
- package/dist/components/molecules/canvas-map/lib/util/memoise.js +20 -0
- package/dist/components/molecules/canvas-map/lib/util/resolution.d.ts +9 -0
- package/dist/components/molecules/canvas-map/lib/util/resolution.js +11 -0
- package/dist/components/molecules/canvas-map/lib/util/simplify.d.ts +114 -0
- package/dist/components/molecules/canvas-map/lib/util/size.d.ts +32 -0
- package/dist/components/molecules/canvas-map/lib/util/size.js +53 -0
- package/dist/components/molecules/canvas-map/lib/util/toRgba.d.ts +1 -0
- package/dist/components/molecules/canvas-map/lib/util/toRgba.js +25 -0
- package/dist/components/molecules/canvas-map/lib/util/uid.d.ts +5 -0
- package/dist/components/molecules/canvas-map/lib/util/uid.js +7 -0
- package/dist/components/molecules/canvas-map/lib/util/zoomLevel.d.ts +2 -0
- package/dist/components/molecules/canvas-map/lib/util/zoomLevel.js +14 -0
- package/dist/components/molecules/canvas-map/style.module.scss.js +20 -0
- package/dist/components/molecules/column-chart/column-chart-example.d.ts +35 -0
- package/dist/components/molecules/column-chart/column-chart-util.d.ts +1 -0
- package/dist/components/molecules/column-chart/index.d.ts +11 -0
- package/dist/components/molecules/column-chart/index.js +63 -0
- package/dist/components/molecules/column-chart/style.module.css.js +14 -0
- package/dist/components/molecules/control-change/index.d.ts +6 -0
- package/dist/components/molecules/control-change/index.js +29 -0
- package/dist/components/molecules/control-change/style.module.css.js +11 -0
- package/dist/components/molecules/dropdown/index.d.ts +11 -0
- package/dist/components/molecules/dropdown/index.js +191 -0
- package/dist/components/molecules/dropdown/style.module.css.js +50 -0
- package/dist/components/molecules/first-past-the-post-waffle/index.d.ts +5 -0
- package/dist/components/molecules/first-past-the-post-waffle/index.js +14 -0
- package/dist/components/molecules/first-past-the-post-waffle/style.module.css.js +14 -0
- package/dist/components/molecules/index.d.ts +17 -0
- package/dist/components/molecules/modal/index.d.ts +8 -0
- package/dist/components/molecules/modal/index.js +59 -0
- package/dist/components/molecules/modal/style.module.css.js +26 -0
- package/dist/components/molecules/page-section/index.d.ts +8 -0
- package/dist/components/molecules/page-section/index.js +52 -0
- package/dist/components/molecules/page-section/style.module.scss.js +20 -0
- package/dist/components/molecules/party-profile/index.d.ts +10 -0
- package/dist/components/molecules/party-profile/index.js +29 -0
- package/dist/components/molecules/party-profile/style.module.css.js +26 -0
- package/dist/components/molecules/refresh-indicator/index.d.ts +4 -0
- package/dist/components/molecules/refresh-indicator/index.js +18 -0
- package/dist/components/molecules/refresh-indicator/style.module.scss.js +17 -0
- package/dist/components/molecules/responsive-grid/index.d.ts +10 -0
- package/dist/components/molecules/responsive-grid/index.js +19 -0
- package/dist/components/molecules/responsive-grid/style.module.scss.js +8 -0
- package/dist/components/molecules/result-summary/index.d.ts +8 -0
- package/dist/components/molecules/result-summary/index.js +36 -0
- package/dist/components/molecules/result-summary/style.module.css.js +11 -0
- package/dist/components/molecules/search-input/icons/search.d.ts +1 -0
- package/dist/components/molecules/search-input/icons/search.js +24 -0
- package/dist/components/molecules/search-input/icons/search.module.css.js +11 -0
- package/dist/components/molecules/search-input/index.d.ts +11 -0
- package/dist/components/molecules/search-input/index.js +164 -0
- package/dist/components/molecules/search-input/style.module.css.js +32 -0
- package/dist/components/molecules/slope-chart/index.d.ts +16 -0
- package/dist/components/molecules/slope-chart/index.js +139 -0
- package/dist/components/molecules/slope-chart/style.module.css.js +35 -0
- package/dist/components/molecules/svg-map/context/MapContext.d.ts +1 -0
- package/dist/components/molecules/svg-map/context/MapContext.js +5 -0
- package/dist/components/molecules/svg-map/context/SVGMapProvider.d.ts +10 -0
- package/dist/components/molecules/svg-map/context/SVGMapProvider.js +88 -0
- package/dist/components/molecules/svg-map/helpers/bboxFeature.d.ts +8 -0
- package/dist/components/molecules/svg-map/helpers/bboxFeature.js +26 -0
- package/dist/components/molecules/svg-map/helpers/dynamicPropValue.d.ts +1 -0
- package/dist/components/molecules/svg-map/helpers/dynamicPropValue.js +9 -0
- package/dist/components/molecules/svg-map/helpers/geoMath.d.ts +4 -0
- package/dist/components/molecules/svg-map/helpers/saveSVG.d.ts +1 -0
- package/dist/components/molecules/svg-map/hooks/useCamera.d.ts +0 -0
- package/dist/components/molecules/svg-map/hooks/useThrowIfNonLayerChildren.d.ts +4 -0
- package/dist/components/molecules/svg-map/hooks/useThrowIfNonLayerChildren.js +19 -0
- package/dist/components/molecules/svg-map/index.d.ts +38 -0
- package/dist/components/molecules/svg-map/index.js +120 -0
- package/dist/components/molecules/svg-map/layers/CompositionBorders.d.ts +3 -0
- package/dist/components/molecules/svg-map/layers/CompositionBorders.js +14 -0
- package/dist/components/molecules/svg-map/layers/Line.d.ts +7 -0
- package/dist/components/molecules/svg-map/layers/Line.js +48 -0
- package/dist/components/molecules/svg-map/layers/Point.d.ts +10 -0
- package/dist/components/molecules/svg-map/layers/Point.js +59 -0
- package/dist/components/molecules/svg-map/layers/Polygon.d.ts +9 -0
- package/dist/components/molecules/svg-map/layers/Polygon.js +75 -0
- package/dist/components/molecules/svg-map/layers/Prerendered.d.ts +3 -0
- package/dist/components/molecules/svg-map/layers/Prerendered.js +11 -0
- package/dist/components/molecules/svg-map/layers/compositionBorders.module.scss.js +8 -0
- package/dist/components/molecules/svg-map/layers/index.d.ts +5 -0
- package/dist/components/molecules/svg-map/layers/index.js +12 -0
- package/dist/components/molecules/svg-map/renderers/SVGRenderer.d.ts +3 -0
- package/dist/components/molecules/svg-map/renderers/SVGRenderer.js +32 -0
- package/dist/components/molecules/svg-map/style.module.css.js +11 -0
- package/dist/components/molecules/table/index.d.ts +7 -0
- package/dist/components/molecules/table/index.js +90 -0
- package/dist/components/molecules/table/style.module.scss.js +29 -0
- package/dist/components/molecules/table/useTable.d.ts +8 -0
- package/dist/components/molecules/table/useTable.js +128 -0
- package/dist/components/molecules/tooltip/index.d.ts +82 -0
- package/dist/components/molecules/tooltip/index.js +117 -0
- package/dist/components/molecules/tooltip/style.module.css.js +8 -0
- package/dist/components/molecules/topline-result/index.d.ts +3 -0
- package/dist/components/molecules/topline-result/index.js +61 -0
- package/dist/components/molecules/topline-result/style.module.scss.js +38 -0
- package/dist/components/organisms/coalitions-tracker/index.d.ts +16 -0
- package/dist/components/organisms/coalitions-tracker/index.js +151 -0
- package/dist/components/organisms/coalitions-tracker/style.module.scss.js +32 -0
- package/dist/components/organisms/index.d.ts +2 -0
- package/dist/components/organisms/ticker/gradient/index.d.ts +1 -0
- package/dist/components/organisms/ticker/gradient/index.js +35 -0
- package/dist/components/organisms/ticker/gradient/style.module.scss.js +14 -0
- package/dist/components/organisms/ticker/index.d.ts +5 -0
- package/dist/components/organisms/ticker/index.js +102 -0
- package/dist/components/organisms/ticker/style.module.scss.js +32 -0
- package/dist/components/particles/ad-slot/index.d.ts +40 -0
- package/dist/components/particles/ad-slot/index.js +34 -0
- package/dist/components/particles/ad-slot/style.module.css.js +11 -0
- package/dist/components/particles/arrow-button/index.d.ts +6 -0
- package/dist/components/particles/arrow-button/index.js +32 -0
- package/dist/components/particles/arrow-button/style.module.css.js +11 -0
- package/dist/components/particles/aspect-ratio-box/index.d.ts +4 -0
- package/dist/components/particles/aspect-ratio-box/index.js +15 -0
- package/dist/components/particles/aspect-ratio-box/style.module.css.js +6 -0
- package/dist/components/particles/button/index.d.ts +6 -0
- package/dist/components/particles/button/index.js +10 -0
- package/dist/components/particles/button/style.module.css.js +11 -0
- package/dist/components/particles/change-bar/index.d.ts +8 -0
- package/dist/components/particles/change-bar/index.js +27 -0
- package/dist/components/particles/change-bar/style.module.scss.js +14 -0
- package/dist/components/particles/chevron/index.d.ts +6 -0
- package/dist/components/particles/chevron/index.js +78 -0
- package/dist/components/particles/chevron/style.module.css.js +20 -0
- package/dist/components/particles/circle-icon/index.d.ts +6 -0
- package/dist/components/particles/circle-icon/index.js +32 -0
- package/dist/components/particles/circle-icon/style.module.css.js +14 -0
- package/dist/components/particles/close-button/index.d.ts +5 -0
- package/dist/components/particles/close-button/index.js +35 -0
- package/dist/components/particles/close-button/style.module.css.js +17 -0
- package/dist/components/particles/container/index.d.ts +5 -0
- package/dist/components/particles/container/index.js +13 -0
- package/dist/components/particles/container/style.module.scss.js +11 -0
- package/dist/components/particles/gradient-icon/index.d.ts +1 -0
- package/dist/components/particles/gradient-icon/index.js +46 -0
- package/dist/components/particles/gradient-icon/style.module.css.js +14 -0
- package/dist/components/particles/index.d.ts +18 -0
- package/dist/components/particles/info-button/index.d.ts +3 -0
- package/dist/components/particles/info-button/index.js +19 -0
- package/dist/components/particles/info-button/style.module.css.js +11 -0
- package/dist/components/particles/legend-item/index.d.ts +6 -0
- package/dist/components/particles/legend-item/index.js +26 -0
- package/dist/components/particles/legend-item/style.module.css.js +17 -0
- package/dist/components/particles/relative-time-sentence/index.d.ts +4 -0
- package/dist/components/particles/relative-time-sentence/index.js +14 -0
- package/dist/components/particles/relative-time-sentence/style.module.css.js +8 -0
- package/dist/components/particles/square-cut-corner-icon/index.d.ts +6 -0
- package/dist/components/particles/square-cut-corner-icon/index.js +56 -0
- package/dist/components/particles/square-cut-corner-icon/style.module.scss.js +17 -0
- package/dist/components/particles/square-icon/index.d.ts +5 -0
- package/dist/components/particles/square-icon/index.js +28 -0
- package/dist/components/particles/square-icon/style.module.scss.js +11 -0
- package/dist/components/particles/stacked-bar/index.d.ts +23 -0
- package/dist/components/particles/stacked-bar/index.js +140 -0
- package/dist/components/particles/stacked-bar/style.module.css.js +17 -0
- package/dist/components/particles/stacked-grid/index.d.ts +6 -0
- package/dist/components/particles/stacked-grid/index.js +35 -0
- package/dist/components/particles/stacked-grid/style.module.css.js +20 -0
- package/dist/components/particles/waffle/index.d.ts +14 -0
- package/dist/components/particles/waffle/index.js +76 -0
- package/dist/components/particles/waffle/style.module.css.js +11 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +128 -0
- package/dist/node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/color.js +338 -0
- package/dist/node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/define.js +13 -0
- package/dist/node_modules/.pnpm/d3-composite-projections@1.4.0/node_modules/d3-composite-projections/src/albersUk.js +108 -0
- package/dist/node_modules/.pnpm/d3-composite-projections@1.4.0/node_modules/d3-composite-projections/src/bounds.js +24 -0
- package/dist/node_modules/.pnpm/d3-composite-projections@1.4.0/node_modules/d3-composite-projections/src/fit.js +18 -0
- package/dist/node_modules/.pnpm/d3-composite-projections@1.4.0/node_modules/d3-composite-projections/src/math.js +4 -0
- package/dist/node_modules/.pnpm/d3-dispatch@3.0.1/node_modules/d3-dispatch/src/dispatch.js +70 -0
- package/dist/node_modules/.pnpm/d3-ease@3.0.1/node_modules/d3-ease/src/cubic.js +6 -0
- package/dist/node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/color.js +24 -0
- package/dist/node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/constant.js +4 -0
- package/dist/node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/number.js +8 -0
- package/dist/node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/rgb.js +20 -0
- package/dist/node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/string.js +43 -0
- package/dist/node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/transform/decompose.js +28 -0
- package/dist/node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/transform/index.js +59 -0
- package/dist/node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/transform/parse.js +18 -0
- package/dist/node_modules/.pnpm/d3-path@2.0.0/node_modules/d3-path/src/path.js +73 -0
- package/dist/node_modules/.pnpm/d3-timer@3.0.1/node_modules/d3-timer/src/timeout.js +13 -0
- package/dist/node_modules/.pnpm/d3-timer@3.0.1/node_modules/d3-timer/src/timer.js +96 -0
- package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/interrupt.js +21 -0
- package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/index.js +5 -0
- package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/interrupt.js +9 -0
- package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/transition.js +39 -0
- package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/attr.js +55 -0
- package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/attrTween.js +42 -0
- package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/delay.js +18 -0
- package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/duration.js +18 -0
- package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/ease.js +14 -0
- package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/easeVarying.js +15 -0
- package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/end.js +23 -0
- package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/filter.js +16 -0
- package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/index.js +68 -0
- package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/interpolate.js +11 -0
- package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/merge.js +18 -0
- package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/on.js +23 -0
- package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/remove.js +13 -0
- package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/schedule.js +125 -0
- package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/select.js +20 -0
- package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/selectAll.js +24 -0
- package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/selection.js +8 -0
- package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/style.js +47 -0
- package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/styleTween.js +25 -0
- package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/text.js +18 -0
- package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/textTween.js +25 -0
- package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/transition.js +22 -0
- package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/tween.js +64 -0
- package/dist/node_modules/.pnpm/dayjs@1.11.12/node_modules/dayjs/dayjs.min.js +282 -0
- package/dist/node_modules/.pnpm/dayjs@1.11.12/node_modules/dayjs/plugin/relativeTime.js +48 -0
- package/dist/node_modules/.pnpm/flatbush@4.4.0/node_modules/flatbush/index.js +339 -0
- package/dist/node_modules/.pnpm/flatqueue@2.0.3/node_modules/flatqueue/index.js +67 -0
- package/dist/node_modules/.pnpm/preact-merge-refs@1.0.2_preact@10.21.0/node_modules/preact-merge-refs/lib/preact-merge-refs.modern.js +10 -0
- package/dist/node_modules/.pnpm/preact-transitioning@1.4.1_preact@10.21.0/node_modules/preact-transitioning/lib/preact-transitioning.modern.js +63 -0
- package/dist/node_modules/.pnpm/quickselect@2.0.0/node_modules/quickselect/index.js +47 -0
- package/dist/node_modules/.pnpm/rbush-knn@4.0.0/node_modules/rbush-knn/index.js +42 -0
- package/dist/node_modules/.pnpm/rbush@4.0.0/node_modules/rbush/index.js +378 -0
- package/dist/node_modules/.pnpm/tinyqueue@2.0.3/node_modules/tinyqueue/index.js +65 -0
- package/dist/shared/colors/index.d.ts +2 -0
- package/dist/shared/helpers/createStore.d.ts +1 -0
- package/dist/shared/helpers/geometry.d.ts +3 -0
- package/dist/shared/helpers/geometry.js +16 -0
- package/dist/shared/helpers/geometry.test.d.ts +1 -0
- package/dist/shared/helpers/labelsUtil.d.ts +54 -0
- package/dist/shared/helpers/labelsUtil.js +58 -0
- package/dist/shared/helpers/labelsUtils.test.d.ts +1 -0
- package/dist/shared/helpers/shouldUpdate.d.ts +7 -0
- package/dist/shared/hooks/index.d.ts +3 -0
- package/dist/shared/hooks/useContainerSize.d.ts +1 -0
- package/dist/shared/hooks/useContainerSize.js +24 -0
- package/dist/shared/hooks/useTouchOrHover.d.ts +6 -0
- package/dist/shared/hooks/useTouchOrHover.js +95 -0
- package/dist/shared/hooks/useWindowSize.d.ts +4 -0
- package/dist/shared/hooks/useWindowSize.js +27 -0
- package/dist/style.css +74 -74
- package/dist/styles/helpers/mergeStyles.d.ts +1 -0
- package/dist/styles/helpers/mergeStyles.js +22 -0
- package/dist/styles/helpers/mergeStyles.test.d.ts +1 -0
- package/dist/styles/theme.config.d.ts +124 -0
- package/package.json +6 -9
- package/dist/interactive-component-library.js +0 -7993
- package/dist/interactive-component-library.js.map +0 -1
- package/dist/interactive-component-library.umd.cjs +0 -7989
- package/dist/interactive-component-library.umd.cjs.map +0 -1
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
var degrees = 180 / Math.PI;
|
|
2
|
+
var identity = {
|
|
3
|
+
translateX: 0,
|
|
4
|
+
translateY: 0,
|
|
5
|
+
rotate: 0,
|
|
6
|
+
skewX: 0,
|
|
7
|
+
scaleX: 1,
|
|
8
|
+
scaleY: 1
|
|
9
|
+
};
|
|
10
|
+
function decompose(a, b, c, d, e, f) {
|
|
11
|
+
var scaleX, scaleY, skewX;
|
|
12
|
+
if (scaleX = Math.sqrt(a * a + b * b)) a /= scaleX, b /= scaleX;
|
|
13
|
+
if (skewX = a * c + b * d) c -= a * skewX, d -= b * skewX;
|
|
14
|
+
if (scaleY = Math.sqrt(c * c + d * d)) c /= scaleY, d /= scaleY, skewX /= scaleY;
|
|
15
|
+
if (a * d < b * c) a = -a, b = -b, skewX = -skewX, scaleX = -scaleX;
|
|
16
|
+
return {
|
|
17
|
+
translateX: e,
|
|
18
|
+
translateY: f,
|
|
19
|
+
rotate: Math.atan2(b, a) * degrees,
|
|
20
|
+
skewX: Math.atan(skewX) * degrees,
|
|
21
|
+
scaleX,
|
|
22
|
+
scaleY
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export {
|
|
26
|
+
decompose as default,
|
|
27
|
+
identity
|
|
28
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import interpolateNumber from "../number.js";
|
|
2
|
+
import { parseCss, parseSvg } from "./parse.js";
|
|
3
|
+
function interpolateTransform(parse, pxComma, pxParen, degParen) {
|
|
4
|
+
function pop(s) {
|
|
5
|
+
return s.length ? s.pop() + " " : "";
|
|
6
|
+
}
|
|
7
|
+
function translate(xa, ya, xb, yb, s, q) {
|
|
8
|
+
if (xa !== xb || ya !== yb) {
|
|
9
|
+
var i = s.push("translate(", null, pxComma, null, pxParen);
|
|
10
|
+
q.push({ i: i - 4, x: interpolateNumber(xa, xb) }, { i: i - 2, x: interpolateNumber(ya, yb) });
|
|
11
|
+
} else if (xb || yb) {
|
|
12
|
+
s.push("translate(" + xb + pxComma + yb + pxParen);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
function rotate(a, b, s, q) {
|
|
16
|
+
if (a !== b) {
|
|
17
|
+
if (a - b > 180) b += 360;
|
|
18
|
+
else if (b - a > 180) a += 360;
|
|
19
|
+
q.push({ i: s.push(pop(s) + "rotate(", null, degParen) - 2, x: interpolateNumber(a, b) });
|
|
20
|
+
} else if (b) {
|
|
21
|
+
s.push(pop(s) + "rotate(" + b + degParen);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function skewX(a, b, s, q) {
|
|
25
|
+
if (a !== b) {
|
|
26
|
+
q.push({ i: s.push(pop(s) + "skewX(", null, degParen) - 2, x: interpolateNumber(a, b) });
|
|
27
|
+
} else if (b) {
|
|
28
|
+
s.push(pop(s) + "skewX(" + b + degParen);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function scale(xa, ya, xb, yb, s, q) {
|
|
32
|
+
if (xa !== xb || ya !== yb) {
|
|
33
|
+
var i = s.push(pop(s) + "scale(", null, ",", null, ")");
|
|
34
|
+
q.push({ i: i - 4, x: interpolateNumber(xa, xb) }, { i: i - 2, x: interpolateNumber(ya, yb) });
|
|
35
|
+
} else if (xb !== 1 || yb !== 1) {
|
|
36
|
+
s.push(pop(s) + "scale(" + xb + "," + yb + ")");
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return function(a, b) {
|
|
40
|
+
var s = [], q = [];
|
|
41
|
+
a = parse(a), b = parse(b);
|
|
42
|
+
translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q);
|
|
43
|
+
rotate(a.rotate, b.rotate, s, q);
|
|
44
|
+
skewX(a.skewX, b.skewX, s, q);
|
|
45
|
+
scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q);
|
|
46
|
+
a = b = null;
|
|
47
|
+
return function(t) {
|
|
48
|
+
var i = -1, n = q.length, o;
|
|
49
|
+
while (++i < n) s[(o = q[i]).i] = o.x(t);
|
|
50
|
+
return s.join("");
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
var interpolateTransformCss = interpolateTransform(parseCss, "px, ", "px)", "deg)");
|
|
55
|
+
var interpolateTransformSvg = interpolateTransform(parseSvg, ", ", ")", ")");
|
|
56
|
+
export {
|
|
57
|
+
interpolateTransformCss,
|
|
58
|
+
interpolateTransformSvg
|
|
59
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import decompose, { identity } from "./decompose.js";
|
|
2
|
+
var svgNode;
|
|
3
|
+
function parseCss(value) {
|
|
4
|
+
const m = new (typeof DOMMatrix === "function" ? DOMMatrix : WebKitCSSMatrix)(value + "");
|
|
5
|
+
return m.isIdentity ? identity : decompose(m.a, m.b, m.c, m.d, m.e, m.f);
|
|
6
|
+
}
|
|
7
|
+
function parseSvg(value) {
|
|
8
|
+
if (value == null) return identity;
|
|
9
|
+
if (!svgNode) svgNode = document.createElementNS("http://www.w3.org/2000/svg", "g");
|
|
10
|
+
svgNode.setAttribute("transform", value);
|
|
11
|
+
if (!(value = svgNode.transform.baseVal.consolidate())) return identity;
|
|
12
|
+
value = value.matrix;
|
|
13
|
+
return decompose(value.a, value.b, value.c, value.d, value.e, value.f);
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
parseCss,
|
|
17
|
+
parseSvg
|
|
18
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
const pi = Math.PI, tau = 2 * pi, epsilon = 1e-6, tauEpsilon = tau - epsilon;
|
|
2
|
+
function Path() {
|
|
3
|
+
this._x0 = this._y0 = // start of current subpath
|
|
4
|
+
this._x1 = this._y1 = null;
|
|
5
|
+
this._ = "";
|
|
6
|
+
}
|
|
7
|
+
function path() {
|
|
8
|
+
return new Path();
|
|
9
|
+
}
|
|
10
|
+
Path.prototype = path.prototype = {
|
|
11
|
+
constructor: Path,
|
|
12
|
+
moveTo: function(x, y) {
|
|
13
|
+
this._ += "M" + (this._x0 = this._x1 = +x) + "," + (this._y0 = this._y1 = +y);
|
|
14
|
+
},
|
|
15
|
+
closePath: function() {
|
|
16
|
+
if (this._x1 !== null) {
|
|
17
|
+
this._x1 = this._x0, this._y1 = this._y0;
|
|
18
|
+
this._ += "Z";
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
lineTo: function(x, y) {
|
|
22
|
+
this._ += "L" + (this._x1 = +x) + "," + (this._y1 = +y);
|
|
23
|
+
},
|
|
24
|
+
quadraticCurveTo: function(x1, y1, x, y) {
|
|
25
|
+
this._ += "Q" + +x1 + "," + +y1 + "," + (this._x1 = +x) + "," + (this._y1 = +y);
|
|
26
|
+
},
|
|
27
|
+
bezierCurveTo: function(x1, y1, x2, y2, x, y) {
|
|
28
|
+
this._ += "C" + +x1 + "," + +y1 + "," + +x2 + "," + +y2 + "," + (this._x1 = +x) + "," + (this._y1 = +y);
|
|
29
|
+
},
|
|
30
|
+
arcTo: function(x1, y1, x2, y2, r) {
|
|
31
|
+
x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;
|
|
32
|
+
var x0 = this._x1, y0 = this._y1, x21 = x2 - x1, y21 = y2 - y1, x01 = x0 - x1, y01 = y0 - y1, l01_2 = x01 * x01 + y01 * y01;
|
|
33
|
+
if (r < 0) throw new Error("negative radius: " + r);
|
|
34
|
+
if (this._x1 === null) {
|
|
35
|
+
this._ += "M" + (this._x1 = x1) + "," + (this._y1 = y1);
|
|
36
|
+
} else if (!(l01_2 > epsilon)) ;
|
|
37
|
+
else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) {
|
|
38
|
+
this._ += "L" + (this._x1 = x1) + "," + (this._y1 = y1);
|
|
39
|
+
} else {
|
|
40
|
+
var x20 = x2 - x0, y20 = y2 - y0, l21_2 = x21 * x21 + y21 * y21, l20_2 = x20 * x20 + y20 * y20, l21 = Math.sqrt(l21_2), l01 = Math.sqrt(l01_2), l = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2), t01 = l / l01, t21 = l / l21;
|
|
41
|
+
if (Math.abs(t01 - 1) > epsilon) {
|
|
42
|
+
this._ += "L" + (x1 + t01 * x01) + "," + (y1 + t01 * y01);
|
|
43
|
+
}
|
|
44
|
+
this._ += "A" + r + "," + r + ",0,0," + +(y01 * x20 > x01 * y20) + "," + (this._x1 = x1 + t21 * x21) + "," + (this._y1 = y1 + t21 * y21);
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
arc: function(x, y, r, a0, a1, ccw) {
|
|
48
|
+
x = +x, y = +y, r = +r, ccw = !!ccw;
|
|
49
|
+
var dx = r * Math.cos(a0), dy = r * Math.sin(a0), x0 = x + dx, y0 = y + dy, cw = 1 ^ ccw, da = ccw ? a0 - a1 : a1 - a0;
|
|
50
|
+
if (r < 0) throw new Error("negative radius: " + r);
|
|
51
|
+
if (this._x1 === null) {
|
|
52
|
+
this._ += "M" + x0 + "," + y0;
|
|
53
|
+
} else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) {
|
|
54
|
+
this._ += "L" + x0 + "," + y0;
|
|
55
|
+
}
|
|
56
|
+
if (!r) return;
|
|
57
|
+
if (da < 0) da = da % tau + tau;
|
|
58
|
+
if (da > tauEpsilon) {
|
|
59
|
+
this._ += "A" + r + "," + r + ",0,1," + cw + "," + (x - dx) + "," + (y - dy) + "A" + r + "," + r + ",0,1," + cw + "," + (this._x1 = x0) + "," + (this._y1 = y0);
|
|
60
|
+
} else if (da > epsilon) {
|
|
61
|
+
this._ += "A" + r + "," + r + ",0," + +(da >= pi) + "," + cw + "," + (this._x1 = x + r * Math.cos(a1)) + "," + (this._y1 = y + r * Math.sin(a1));
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
rect: function(x, y, w, h) {
|
|
65
|
+
this._ += "M" + (this._x0 = this._x1 = +x) + "," + (this._y0 = this._y1 = +y) + "h" + +w + "v" + +h + "h" + -w + "Z";
|
|
66
|
+
},
|
|
67
|
+
toString: function() {
|
|
68
|
+
return this._;
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
export {
|
|
72
|
+
path as default
|
|
73
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Timer } from "./timer.js";
|
|
2
|
+
function timeout(callback, delay, time) {
|
|
3
|
+
var t = new Timer();
|
|
4
|
+
delay = delay == null ? 0 : +delay;
|
|
5
|
+
t.restart((elapsed) => {
|
|
6
|
+
t.stop();
|
|
7
|
+
callback(elapsed + delay);
|
|
8
|
+
}, delay, time);
|
|
9
|
+
return t;
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
timeout as default
|
|
13
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
var frame = 0, timeout = 0, interval = 0, pokeDelay = 1e3, taskHead, taskTail, clockLast = 0, clockNow = 0, clockSkew = 0, clock = typeof performance === "object" && performance.now ? performance : Date, setFrame = typeof window === "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) {
|
|
2
|
+
setTimeout(f, 17);
|
|
3
|
+
};
|
|
4
|
+
function now() {
|
|
5
|
+
return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew);
|
|
6
|
+
}
|
|
7
|
+
function clearNow() {
|
|
8
|
+
clockNow = 0;
|
|
9
|
+
}
|
|
10
|
+
function Timer() {
|
|
11
|
+
this._call = this._time = this._next = null;
|
|
12
|
+
}
|
|
13
|
+
Timer.prototype = timer.prototype = {
|
|
14
|
+
constructor: Timer,
|
|
15
|
+
restart: function(callback, delay, time) {
|
|
16
|
+
if (typeof callback !== "function") throw new TypeError("callback is not a function");
|
|
17
|
+
time = (time == null ? now() : +time) + (delay == null ? 0 : +delay);
|
|
18
|
+
if (!this._next && taskTail !== this) {
|
|
19
|
+
if (taskTail) taskTail._next = this;
|
|
20
|
+
else taskHead = this;
|
|
21
|
+
taskTail = this;
|
|
22
|
+
}
|
|
23
|
+
this._call = callback;
|
|
24
|
+
this._time = time;
|
|
25
|
+
sleep();
|
|
26
|
+
},
|
|
27
|
+
stop: function() {
|
|
28
|
+
if (this._call) {
|
|
29
|
+
this._call = null;
|
|
30
|
+
this._time = Infinity;
|
|
31
|
+
sleep();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
function timer(callback, delay, time) {
|
|
36
|
+
var t = new Timer();
|
|
37
|
+
t.restart(callback, delay, time);
|
|
38
|
+
return t;
|
|
39
|
+
}
|
|
40
|
+
function timerFlush() {
|
|
41
|
+
now();
|
|
42
|
+
++frame;
|
|
43
|
+
var t = taskHead, e;
|
|
44
|
+
while (t) {
|
|
45
|
+
if ((e = clockNow - t._time) >= 0) t._call.call(void 0, e);
|
|
46
|
+
t = t._next;
|
|
47
|
+
}
|
|
48
|
+
--frame;
|
|
49
|
+
}
|
|
50
|
+
function wake() {
|
|
51
|
+
clockNow = (clockLast = clock.now()) + clockSkew;
|
|
52
|
+
frame = timeout = 0;
|
|
53
|
+
try {
|
|
54
|
+
timerFlush();
|
|
55
|
+
} finally {
|
|
56
|
+
frame = 0;
|
|
57
|
+
nap();
|
|
58
|
+
clockNow = 0;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function poke() {
|
|
62
|
+
var now2 = clock.now(), delay = now2 - clockLast;
|
|
63
|
+
if (delay > pokeDelay) clockSkew -= delay, clockLast = now2;
|
|
64
|
+
}
|
|
65
|
+
function nap() {
|
|
66
|
+
var t0, t1 = taskHead, t2, time = Infinity;
|
|
67
|
+
while (t1) {
|
|
68
|
+
if (t1._call) {
|
|
69
|
+
if (time > t1._time) time = t1._time;
|
|
70
|
+
t0 = t1, t1 = t1._next;
|
|
71
|
+
} else {
|
|
72
|
+
t2 = t1._next, t1._next = null;
|
|
73
|
+
t1 = t0 ? t0._next = t2 : taskHead = t2;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
taskTail = t0;
|
|
77
|
+
sleep(time);
|
|
78
|
+
}
|
|
79
|
+
function sleep(time) {
|
|
80
|
+
if (frame) return;
|
|
81
|
+
if (timeout) timeout = clearTimeout(timeout);
|
|
82
|
+
var delay = time - clockNow;
|
|
83
|
+
if (delay > 24) {
|
|
84
|
+
if (time < Infinity) timeout = setTimeout(wake, time - clock.now() - clockSkew);
|
|
85
|
+
if (interval) interval = clearInterval(interval);
|
|
86
|
+
} else {
|
|
87
|
+
if (!interval) clockLast = clock.now(), interval = setInterval(poke, pokeDelay);
|
|
88
|
+
frame = 1, setFrame(wake);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
export {
|
|
92
|
+
Timer,
|
|
93
|
+
now,
|
|
94
|
+
timer,
|
|
95
|
+
timerFlush
|
|
96
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { STARTING, ENDING, ENDED } from "./transition/schedule.js";
|
|
2
|
+
function interrupt(node, name) {
|
|
3
|
+
var schedules = node.__transition, schedule, active, empty = true, i;
|
|
4
|
+
if (!schedules) return;
|
|
5
|
+
name = name == null ? null : name + "";
|
|
6
|
+
for (i in schedules) {
|
|
7
|
+
if ((schedule = schedules[i]).name !== name) {
|
|
8
|
+
empty = false;
|
|
9
|
+
continue;
|
|
10
|
+
}
|
|
11
|
+
active = schedule.state > STARTING && schedule.state < ENDING;
|
|
12
|
+
schedule.state = ENDED;
|
|
13
|
+
schedule.timer.stop();
|
|
14
|
+
schedule.on.call(active ? "interrupt" : "cancel", node, node.__data__, schedule.index, schedule.group);
|
|
15
|
+
delete schedules[i];
|
|
16
|
+
}
|
|
17
|
+
if (empty) delete node.__transition;
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
interrupt as default
|
|
21
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Transition, newId } from "../transition/index.js";
|
|
2
|
+
import schedule from "../transition/schedule.js";
|
|
3
|
+
import { now } from "../../../../../d3-timer@3.0.1/node_modules/d3-timer/src/timer.js";
|
|
4
|
+
import { cubicInOut } from "../../../../../d3-ease@3.0.1/node_modules/d3-ease/src/cubic.js";
|
|
5
|
+
var defaultTiming = {
|
|
6
|
+
time: null,
|
|
7
|
+
// Set on use.
|
|
8
|
+
delay: 0,
|
|
9
|
+
duration: 250,
|
|
10
|
+
ease: cubicInOut
|
|
11
|
+
};
|
|
12
|
+
function inherit(node, id) {
|
|
13
|
+
var timing;
|
|
14
|
+
while (!(timing = node.__transition) || !(timing = timing[id])) {
|
|
15
|
+
if (!(node = node.parentNode)) {
|
|
16
|
+
throw new Error(`transition ${id} not found`);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return timing;
|
|
20
|
+
}
|
|
21
|
+
function selection_transition(name) {
|
|
22
|
+
var id, timing;
|
|
23
|
+
if (name instanceof Transition) {
|
|
24
|
+
id = name._id, name = name._name;
|
|
25
|
+
} else {
|
|
26
|
+
id = newId(), (timing = defaultTiming).time = now(), name = name == null ? null : name + "";
|
|
27
|
+
}
|
|
28
|
+
for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) {
|
|
29
|
+
for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {
|
|
30
|
+
if (node = group[i]) {
|
|
31
|
+
schedule(node, name, id, i, group, timing || inherit(node, id));
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return new Transition(groups, this._parents, name, id);
|
|
36
|
+
}
|
|
37
|
+
export {
|
|
38
|
+
selection_transition as default
|
|
39
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { namespace } from "d3-selection";
|
|
2
|
+
import { tweenValue } from "./tween.js";
|
|
3
|
+
import interpolate from "./interpolate.js";
|
|
4
|
+
import { interpolateTransformSvg } from "../../../../../d3-interpolate@3.0.1/node_modules/d3-interpolate/src/transform/index.js";
|
|
5
|
+
function attrRemove(name) {
|
|
6
|
+
return function() {
|
|
7
|
+
this.removeAttribute(name);
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
function attrRemoveNS(fullname) {
|
|
11
|
+
return function() {
|
|
12
|
+
this.removeAttributeNS(fullname.space, fullname.local);
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
function attrConstant(name, interpolate2, value1) {
|
|
16
|
+
var string00, string1 = value1 + "", interpolate0;
|
|
17
|
+
return function() {
|
|
18
|
+
var string0 = this.getAttribute(name);
|
|
19
|
+
return string0 === string1 ? null : string0 === string00 ? interpolate0 : interpolate0 = interpolate2(string00 = string0, value1);
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
function attrConstantNS(fullname, interpolate2, value1) {
|
|
23
|
+
var string00, string1 = value1 + "", interpolate0;
|
|
24
|
+
return function() {
|
|
25
|
+
var string0 = this.getAttributeNS(fullname.space, fullname.local);
|
|
26
|
+
return string0 === string1 ? null : string0 === string00 ? interpolate0 : interpolate0 = interpolate2(string00 = string0, value1);
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
function attrFunction(name, interpolate2, value) {
|
|
30
|
+
var string00, string10, interpolate0;
|
|
31
|
+
return function() {
|
|
32
|
+
var string0, value1 = value(this), string1;
|
|
33
|
+
if (value1 == null) return void this.removeAttribute(name);
|
|
34
|
+
string0 = this.getAttribute(name);
|
|
35
|
+
string1 = value1 + "";
|
|
36
|
+
return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : (string10 = string1, interpolate0 = interpolate2(string00 = string0, value1));
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function attrFunctionNS(fullname, interpolate2, value) {
|
|
40
|
+
var string00, string10, interpolate0;
|
|
41
|
+
return function() {
|
|
42
|
+
var string0, value1 = value(this), string1;
|
|
43
|
+
if (value1 == null) return void this.removeAttributeNS(fullname.space, fullname.local);
|
|
44
|
+
string0 = this.getAttributeNS(fullname.space, fullname.local);
|
|
45
|
+
string1 = value1 + "";
|
|
46
|
+
return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : (string10 = string1, interpolate0 = interpolate2(string00 = string0, value1));
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function transition_attr(name, value) {
|
|
50
|
+
var fullname = namespace(name), i = fullname === "transform" ? interpolateTransformSvg : interpolate;
|
|
51
|
+
return this.attrTween(name, typeof value === "function" ? (fullname.local ? attrFunctionNS : attrFunction)(fullname, i, tweenValue(this, "attr." + name, value)) : value == null ? (fullname.local ? attrRemoveNS : attrRemove)(fullname) : (fullname.local ? attrConstantNS : attrConstant)(fullname, i, value));
|
|
52
|
+
}
|
|
53
|
+
export {
|
|
54
|
+
transition_attr as default
|
|
55
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { namespace } from "d3-selection";
|
|
2
|
+
function attrInterpolate(name, i) {
|
|
3
|
+
return function(t) {
|
|
4
|
+
this.setAttribute(name, i.call(this, t));
|
|
5
|
+
};
|
|
6
|
+
}
|
|
7
|
+
function attrInterpolateNS(fullname, i) {
|
|
8
|
+
return function(t) {
|
|
9
|
+
this.setAttributeNS(fullname.space, fullname.local, i.call(this, t));
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
function attrTweenNS(fullname, value) {
|
|
13
|
+
var t0, i0;
|
|
14
|
+
function tween() {
|
|
15
|
+
var i = value.apply(this, arguments);
|
|
16
|
+
if (i !== i0) t0 = (i0 = i) && attrInterpolateNS(fullname, i);
|
|
17
|
+
return t0;
|
|
18
|
+
}
|
|
19
|
+
tween._value = value;
|
|
20
|
+
return tween;
|
|
21
|
+
}
|
|
22
|
+
function attrTween(name, value) {
|
|
23
|
+
var t0, i0;
|
|
24
|
+
function tween() {
|
|
25
|
+
var i = value.apply(this, arguments);
|
|
26
|
+
if (i !== i0) t0 = (i0 = i) && attrInterpolate(name, i);
|
|
27
|
+
return t0;
|
|
28
|
+
}
|
|
29
|
+
tween._value = value;
|
|
30
|
+
return tween;
|
|
31
|
+
}
|
|
32
|
+
function transition_attrTween(name, value) {
|
|
33
|
+
var key = "attr." + name;
|
|
34
|
+
if (arguments.length < 2) return (key = this.tween(key)) && key._value;
|
|
35
|
+
if (value == null) return this.tween(key, null);
|
|
36
|
+
if (typeof value !== "function") throw new Error();
|
|
37
|
+
var fullname = namespace(name);
|
|
38
|
+
return this.tween(key, (fullname.local ? attrTweenNS : attrTween)(fullname, value));
|
|
39
|
+
}
|
|
40
|
+
export {
|
|
41
|
+
transition_attrTween as default
|
|
42
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { get, init } from "./schedule.js";
|
|
2
|
+
function delayFunction(id, value) {
|
|
3
|
+
return function() {
|
|
4
|
+
init(this, id).delay = +value.apply(this, arguments);
|
|
5
|
+
};
|
|
6
|
+
}
|
|
7
|
+
function delayConstant(id, value) {
|
|
8
|
+
return value = +value, function() {
|
|
9
|
+
init(this, id).delay = value;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
function transition_delay(value) {
|
|
13
|
+
var id = this._id;
|
|
14
|
+
return arguments.length ? this.each((typeof value === "function" ? delayFunction : delayConstant)(id, value)) : get(this.node(), id).delay;
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
transition_delay as default
|
|
18
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { get, set } from "./schedule.js";
|
|
2
|
+
function durationFunction(id, value) {
|
|
3
|
+
return function() {
|
|
4
|
+
set(this, id).duration = +value.apply(this, arguments);
|
|
5
|
+
};
|
|
6
|
+
}
|
|
7
|
+
function durationConstant(id, value) {
|
|
8
|
+
return value = +value, function() {
|
|
9
|
+
set(this, id).duration = value;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
function transition_duration(value) {
|
|
13
|
+
var id = this._id;
|
|
14
|
+
return arguments.length ? this.each((typeof value === "function" ? durationFunction : durationConstant)(id, value)) : get(this.node(), id).duration;
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
transition_duration as default
|
|
18
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { get, set } from "./schedule.js";
|
|
2
|
+
function easeConstant(id, value) {
|
|
3
|
+
if (typeof value !== "function") throw new Error();
|
|
4
|
+
return function() {
|
|
5
|
+
set(this, id).ease = value;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
function transition_ease(value) {
|
|
9
|
+
var id = this._id;
|
|
10
|
+
return arguments.length ? this.each(easeConstant(id, value)) : get(this.node(), id).ease;
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
transition_ease as default
|
|
14
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { set } from "./schedule.js";
|
|
2
|
+
function easeVarying(id, value) {
|
|
3
|
+
return function() {
|
|
4
|
+
var v = value.apply(this, arguments);
|
|
5
|
+
if (typeof v !== "function") throw new Error();
|
|
6
|
+
set(this, id).ease = v;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
function transition_easeVarying(value) {
|
|
10
|
+
if (typeof value !== "function") throw new Error();
|
|
11
|
+
return this.each(easeVarying(this._id, value));
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
transition_easeVarying as default
|
|
15
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { set } from "./schedule.js";
|
|
2
|
+
function transition_end() {
|
|
3
|
+
var on0, on1, that = this, id = that._id, size = that.size();
|
|
4
|
+
return new Promise(function(resolve, reject) {
|
|
5
|
+
var cancel = { value: reject }, end = { value: function() {
|
|
6
|
+
if (--size === 0) resolve();
|
|
7
|
+
} };
|
|
8
|
+
that.each(function() {
|
|
9
|
+
var schedule = set(this, id), on = schedule.on;
|
|
10
|
+
if (on !== on0) {
|
|
11
|
+
on1 = (on0 = on).copy();
|
|
12
|
+
on1._.cancel.push(cancel);
|
|
13
|
+
on1._.interrupt.push(cancel);
|
|
14
|
+
on1._.end.push(end);
|
|
15
|
+
}
|
|
16
|
+
schedule.on = on1;
|
|
17
|
+
});
|
|
18
|
+
if (size === 0) resolve();
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
transition_end as default
|
|
23
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { matcher } from "d3-selection";
|
|
2
|
+
import { Transition } from "./index.js";
|
|
3
|
+
function transition_filter(match) {
|
|
4
|
+
if (typeof match !== "function") match = matcher(match);
|
|
5
|
+
for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {
|
|
6
|
+
for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {
|
|
7
|
+
if ((node = group[i]) && match.call(node, node.__data__, i, group)) {
|
|
8
|
+
subgroup.push(node);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
return new Transition(subgroups, this._parents, this._name, this._id);
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
transition_filter as default
|
|
16
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { selection } from "d3-selection";
|
|
2
|
+
import transition_attr from "./attr.js";
|
|
3
|
+
import transition_attrTween from "./attrTween.js";
|
|
4
|
+
import transition_delay from "./delay.js";
|
|
5
|
+
import transition_duration from "./duration.js";
|
|
6
|
+
import transition_ease from "./ease.js";
|
|
7
|
+
import transition_easeVarying from "./easeVarying.js";
|
|
8
|
+
import transition_filter from "./filter.js";
|
|
9
|
+
import transition_merge from "./merge.js";
|
|
10
|
+
import transition_on from "./on.js";
|
|
11
|
+
import transition_remove from "./remove.js";
|
|
12
|
+
import transition_select from "./select.js";
|
|
13
|
+
import transition_selectAll from "./selectAll.js";
|
|
14
|
+
import transition_selection from "./selection.js";
|
|
15
|
+
import transition_style from "./style.js";
|
|
16
|
+
import transition_styleTween from "./styleTween.js";
|
|
17
|
+
import transition_text from "./text.js";
|
|
18
|
+
import transition_textTween from "./textTween.js";
|
|
19
|
+
import transition_transition from "./transition.js";
|
|
20
|
+
import transition_tween from "./tween.js";
|
|
21
|
+
import transition_end from "./end.js";
|
|
22
|
+
var id = 0;
|
|
23
|
+
function Transition(groups, parents, name, id2) {
|
|
24
|
+
this._groups = groups;
|
|
25
|
+
this._parents = parents;
|
|
26
|
+
this._name = name;
|
|
27
|
+
this._id = id2;
|
|
28
|
+
}
|
|
29
|
+
function newId() {
|
|
30
|
+
return ++id;
|
|
31
|
+
}
|
|
32
|
+
var selection_prototype = selection.prototype;
|
|
33
|
+
Transition.prototype = {
|
|
34
|
+
constructor: Transition,
|
|
35
|
+
select: transition_select,
|
|
36
|
+
selectAll: transition_selectAll,
|
|
37
|
+
selectChild: selection_prototype.selectChild,
|
|
38
|
+
selectChildren: selection_prototype.selectChildren,
|
|
39
|
+
filter: transition_filter,
|
|
40
|
+
merge: transition_merge,
|
|
41
|
+
selection: transition_selection,
|
|
42
|
+
transition: transition_transition,
|
|
43
|
+
call: selection_prototype.call,
|
|
44
|
+
nodes: selection_prototype.nodes,
|
|
45
|
+
node: selection_prototype.node,
|
|
46
|
+
size: selection_prototype.size,
|
|
47
|
+
empty: selection_prototype.empty,
|
|
48
|
+
each: selection_prototype.each,
|
|
49
|
+
on: transition_on,
|
|
50
|
+
attr: transition_attr,
|
|
51
|
+
attrTween: transition_attrTween,
|
|
52
|
+
style: transition_style,
|
|
53
|
+
styleTween: transition_styleTween,
|
|
54
|
+
text: transition_text,
|
|
55
|
+
textTween: transition_textTween,
|
|
56
|
+
remove: transition_remove,
|
|
57
|
+
tween: transition_tween,
|
|
58
|
+
delay: transition_delay,
|
|
59
|
+
duration: transition_duration,
|
|
60
|
+
ease: transition_ease,
|
|
61
|
+
easeVarying: transition_easeVarying,
|
|
62
|
+
end: transition_end,
|
|
63
|
+
[Symbol.iterator]: selection_prototype[Symbol.iterator]
|
|
64
|
+
};
|
|
65
|
+
export {
|
|
66
|
+
Transition,
|
|
67
|
+
newId
|
|
68
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import interpolateNumber from "../../../../../d3-interpolate@3.0.1/node_modules/d3-interpolate/src/number.js";
|
|
2
|
+
import color from "../../../../../d3-color@3.1.0/node_modules/d3-color/src/color.js";
|
|
3
|
+
import interpolateRgb from "../../../../../d3-interpolate@3.0.1/node_modules/d3-interpolate/src/rgb.js";
|
|
4
|
+
import interpolateString from "../../../../../d3-interpolate@3.0.1/node_modules/d3-interpolate/src/string.js";
|
|
5
|
+
function interpolate(a, b) {
|
|
6
|
+
var c;
|
|
7
|
+
return (typeof b === "number" ? interpolateNumber : b instanceof color ? interpolateRgb : (c = color(b)) ? (b = c, interpolateRgb) : interpolateString)(a, b);
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
interpolate as default
|
|
11
|
+
};
|