@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,18 @@
|
|
|
1
|
+
import { Transition } from "./index.js";
|
|
2
|
+
function transition_merge(transition) {
|
|
3
|
+
if (transition._id !== this._id) throw new Error();
|
|
4
|
+
for (var groups0 = this._groups, groups1 = transition._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {
|
|
5
|
+
for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {
|
|
6
|
+
if (node = group0[i] || group1[i]) {
|
|
7
|
+
merge[i] = node;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
for (; j < m0; ++j) {
|
|
12
|
+
merges[j] = groups0[j];
|
|
13
|
+
}
|
|
14
|
+
return new Transition(merges, this._parents, this._name, this._id);
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
transition_merge as default
|
|
18
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { get, init, set } from "./schedule.js";
|
|
2
|
+
function start(name) {
|
|
3
|
+
return (name + "").trim().split(/^|\s+/).every(function(t) {
|
|
4
|
+
var i = t.indexOf(".");
|
|
5
|
+
if (i >= 0) t = t.slice(0, i);
|
|
6
|
+
return !t || t === "start";
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
function onFunction(id, name, listener) {
|
|
10
|
+
var on0, on1, sit = start(name) ? init : set;
|
|
11
|
+
return function() {
|
|
12
|
+
var schedule = sit(this, id), on = schedule.on;
|
|
13
|
+
if (on !== on0) (on1 = (on0 = on).copy()).on(name, listener);
|
|
14
|
+
schedule.on = on1;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function transition_on(name, listener) {
|
|
18
|
+
var id = this._id;
|
|
19
|
+
return arguments.length < 2 ? get(this.node(), id).on.on(name) : this.each(onFunction(id, name, listener));
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
transition_on as default
|
|
23
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
function removeFunction(id) {
|
|
2
|
+
return function() {
|
|
3
|
+
var parent = this.parentNode;
|
|
4
|
+
for (var i in this.__transition) if (+i !== id) return;
|
|
5
|
+
if (parent) parent.removeChild(this);
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
function transition_remove() {
|
|
9
|
+
return this.on("end.remove", removeFunction(this._id));
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
transition_remove as default
|
|
13
|
+
};
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import dispatch from "../../../../../d3-dispatch@3.0.1/node_modules/d3-dispatch/src/dispatch.js";
|
|
2
|
+
import { timer } from "../../../../../d3-timer@3.0.1/node_modules/d3-timer/src/timer.js";
|
|
3
|
+
import timeout from "../../../../../d3-timer@3.0.1/node_modules/d3-timer/src/timeout.js";
|
|
4
|
+
var emptyOn = dispatch("start", "end", "cancel", "interrupt");
|
|
5
|
+
var emptyTween = [];
|
|
6
|
+
var CREATED = 0;
|
|
7
|
+
var SCHEDULED = 1;
|
|
8
|
+
var STARTING = 2;
|
|
9
|
+
var STARTED = 3;
|
|
10
|
+
var RUNNING = 4;
|
|
11
|
+
var ENDING = 5;
|
|
12
|
+
var ENDED = 6;
|
|
13
|
+
function schedule(node, name, id, index, group, timing) {
|
|
14
|
+
var schedules = node.__transition;
|
|
15
|
+
if (!schedules) node.__transition = {};
|
|
16
|
+
else if (id in schedules) return;
|
|
17
|
+
create(node, id, {
|
|
18
|
+
name,
|
|
19
|
+
index,
|
|
20
|
+
// For context during callback.
|
|
21
|
+
group,
|
|
22
|
+
// For context during callback.
|
|
23
|
+
on: emptyOn,
|
|
24
|
+
tween: emptyTween,
|
|
25
|
+
time: timing.time,
|
|
26
|
+
delay: timing.delay,
|
|
27
|
+
duration: timing.duration,
|
|
28
|
+
ease: timing.ease,
|
|
29
|
+
timer: null,
|
|
30
|
+
state: CREATED
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
function init(node, id) {
|
|
34
|
+
var schedule2 = get(node, id);
|
|
35
|
+
if (schedule2.state > CREATED) throw new Error("too late; already scheduled");
|
|
36
|
+
return schedule2;
|
|
37
|
+
}
|
|
38
|
+
function set(node, id) {
|
|
39
|
+
var schedule2 = get(node, id);
|
|
40
|
+
if (schedule2.state > STARTED) throw new Error("too late; already running");
|
|
41
|
+
return schedule2;
|
|
42
|
+
}
|
|
43
|
+
function get(node, id) {
|
|
44
|
+
var schedule2 = node.__transition;
|
|
45
|
+
if (!schedule2 || !(schedule2 = schedule2[id])) throw new Error("transition not found");
|
|
46
|
+
return schedule2;
|
|
47
|
+
}
|
|
48
|
+
function create(node, id, self) {
|
|
49
|
+
var schedules = node.__transition, tween;
|
|
50
|
+
schedules[id] = self;
|
|
51
|
+
self.timer = timer(schedule2, 0, self.time);
|
|
52
|
+
function schedule2(elapsed) {
|
|
53
|
+
self.state = SCHEDULED;
|
|
54
|
+
self.timer.restart(start, self.delay, self.time);
|
|
55
|
+
if (self.delay <= elapsed) start(elapsed - self.delay);
|
|
56
|
+
}
|
|
57
|
+
function start(elapsed) {
|
|
58
|
+
var i, j, n, o;
|
|
59
|
+
if (self.state !== SCHEDULED) return stop();
|
|
60
|
+
for (i in schedules) {
|
|
61
|
+
o = schedules[i];
|
|
62
|
+
if (o.name !== self.name) continue;
|
|
63
|
+
if (o.state === STARTED) return timeout(start);
|
|
64
|
+
if (o.state === RUNNING) {
|
|
65
|
+
o.state = ENDED;
|
|
66
|
+
o.timer.stop();
|
|
67
|
+
o.on.call("interrupt", node, node.__data__, o.index, o.group);
|
|
68
|
+
delete schedules[i];
|
|
69
|
+
} else if (+i < id) {
|
|
70
|
+
o.state = ENDED;
|
|
71
|
+
o.timer.stop();
|
|
72
|
+
o.on.call("cancel", node, node.__data__, o.index, o.group);
|
|
73
|
+
delete schedules[i];
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
timeout(function() {
|
|
77
|
+
if (self.state === STARTED) {
|
|
78
|
+
self.state = RUNNING;
|
|
79
|
+
self.timer.restart(tick, self.delay, self.time);
|
|
80
|
+
tick(elapsed);
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
self.state = STARTING;
|
|
84
|
+
self.on.call("start", node, node.__data__, self.index, self.group);
|
|
85
|
+
if (self.state !== STARTING) return;
|
|
86
|
+
self.state = STARTED;
|
|
87
|
+
tween = new Array(n = self.tween.length);
|
|
88
|
+
for (i = 0, j = -1; i < n; ++i) {
|
|
89
|
+
if (o = self.tween[i].value.call(node, node.__data__, self.index, self.group)) {
|
|
90
|
+
tween[++j] = o;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
tween.length = j + 1;
|
|
94
|
+
}
|
|
95
|
+
function tick(elapsed) {
|
|
96
|
+
var t = elapsed < self.duration ? self.ease.call(null, elapsed / self.duration) : (self.timer.restart(stop), self.state = ENDING, 1), i = -1, n = tween.length;
|
|
97
|
+
while (++i < n) {
|
|
98
|
+
tween[i].call(node, t);
|
|
99
|
+
}
|
|
100
|
+
if (self.state === ENDING) {
|
|
101
|
+
self.on.call("end", node, node.__data__, self.index, self.group);
|
|
102
|
+
stop();
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
function stop() {
|
|
106
|
+
self.state = ENDED;
|
|
107
|
+
self.timer.stop();
|
|
108
|
+
delete schedules[id];
|
|
109
|
+
for (var i in schedules) return;
|
|
110
|
+
delete node.__transition;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
export {
|
|
114
|
+
CREATED,
|
|
115
|
+
ENDED,
|
|
116
|
+
ENDING,
|
|
117
|
+
RUNNING,
|
|
118
|
+
SCHEDULED,
|
|
119
|
+
STARTED,
|
|
120
|
+
STARTING,
|
|
121
|
+
schedule as default,
|
|
122
|
+
get,
|
|
123
|
+
init,
|
|
124
|
+
set
|
|
125
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { selector } from "d3-selection";
|
|
2
|
+
import { Transition } from "./index.js";
|
|
3
|
+
import schedule, { get } from "./schedule.js";
|
|
4
|
+
function transition_select(select) {
|
|
5
|
+
var name = this._name, id = this._id;
|
|
6
|
+
if (typeof select !== "function") select = selector(select);
|
|
7
|
+
for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {
|
|
8
|
+
for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {
|
|
9
|
+
if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) {
|
|
10
|
+
if ("__data__" in node) subnode.__data__ = node.__data__;
|
|
11
|
+
subgroup[i] = subnode;
|
|
12
|
+
schedule(subgroup[i], name, id, i, subgroup, get(node, id));
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return new Transition(subgroups, this._parents, name, id);
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
transition_select as default
|
|
20
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { selectorAll } from "d3-selection";
|
|
2
|
+
import { Transition } from "./index.js";
|
|
3
|
+
import schedule, { get } from "./schedule.js";
|
|
4
|
+
function transition_selectAll(select) {
|
|
5
|
+
var name = this._name, id = this._id;
|
|
6
|
+
if (typeof select !== "function") select = selectorAll(select);
|
|
7
|
+
for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {
|
|
8
|
+
for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {
|
|
9
|
+
if (node = group[i]) {
|
|
10
|
+
for (var children = select.call(node, node.__data__, i, group), child, inherit = get(node, id), k = 0, l = children.length; k < l; ++k) {
|
|
11
|
+
if (child = children[k]) {
|
|
12
|
+
schedule(child, name, id, k, children, inherit);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
subgroups.push(children);
|
|
16
|
+
parents.push(node);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return new Transition(subgroups, parents, name, id);
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
transition_selectAll as default
|
|
24
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { style } from "d3-selection";
|
|
2
|
+
import { set } from "./schedule.js";
|
|
3
|
+
import { tweenValue } from "./tween.js";
|
|
4
|
+
import interpolate from "./interpolate.js";
|
|
5
|
+
import { interpolateTransformCss } from "../../../../../d3-interpolate@3.0.1/node_modules/d3-interpolate/src/transform/index.js";
|
|
6
|
+
function styleNull(name, interpolate2) {
|
|
7
|
+
var string00, string10, interpolate0;
|
|
8
|
+
return function() {
|
|
9
|
+
var string0 = style(this, name), string1 = (this.style.removeProperty(name), style(this, name));
|
|
10
|
+
return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : interpolate0 = interpolate2(string00 = string0, string10 = string1);
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
function styleRemove(name) {
|
|
14
|
+
return function() {
|
|
15
|
+
this.style.removeProperty(name);
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
function styleConstant(name, interpolate2, value1) {
|
|
19
|
+
var string00, string1 = value1 + "", interpolate0;
|
|
20
|
+
return function() {
|
|
21
|
+
var string0 = style(this, name);
|
|
22
|
+
return string0 === string1 ? null : string0 === string00 ? interpolate0 : interpolate0 = interpolate2(string00 = string0, value1);
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function styleFunction(name, interpolate2, value) {
|
|
26
|
+
var string00, string10, interpolate0;
|
|
27
|
+
return function() {
|
|
28
|
+
var string0 = style(this, name), value1 = value(this), string1 = value1 + "";
|
|
29
|
+
if (value1 == null) string1 = value1 = (this.style.removeProperty(name), style(this, name));
|
|
30
|
+
return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : (string10 = string1, interpolate0 = interpolate2(string00 = string0, value1));
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function styleMaybeRemove(id, name) {
|
|
34
|
+
var on0, on1, listener0, key = "style." + name, event = "end." + key, remove;
|
|
35
|
+
return function() {
|
|
36
|
+
var schedule = set(this, id), on = schedule.on, listener = schedule.value[key] == null ? remove || (remove = styleRemove(name)) : void 0;
|
|
37
|
+
if (on !== on0 || listener0 !== listener) (on1 = (on0 = on).copy()).on(event, listener0 = listener);
|
|
38
|
+
schedule.on = on1;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
function transition_style(name, value, priority) {
|
|
42
|
+
var i = (name += "") === "transform" ? interpolateTransformCss : interpolate;
|
|
43
|
+
return value == null ? this.styleTween(name, styleNull(name, i)).on("end.style." + name, styleRemove(name)) : typeof value === "function" ? this.styleTween(name, styleFunction(name, i, tweenValue(this, "style." + name, value))).each(styleMaybeRemove(this._id, name)) : this.styleTween(name, styleConstant(name, i, value), priority).on("end.style." + name, null);
|
|
44
|
+
}
|
|
45
|
+
export {
|
|
46
|
+
transition_style as default
|
|
47
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
function styleInterpolate(name, i, priority) {
|
|
2
|
+
return function(t) {
|
|
3
|
+
this.style.setProperty(name, i.call(this, t), priority);
|
|
4
|
+
};
|
|
5
|
+
}
|
|
6
|
+
function styleTween(name, value, priority) {
|
|
7
|
+
var t, i0;
|
|
8
|
+
function tween() {
|
|
9
|
+
var i = value.apply(this, arguments);
|
|
10
|
+
if (i !== i0) t = (i0 = i) && styleInterpolate(name, i, priority);
|
|
11
|
+
return t;
|
|
12
|
+
}
|
|
13
|
+
tween._value = value;
|
|
14
|
+
return tween;
|
|
15
|
+
}
|
|
16
|
+
function transition_styleTween(name, value, priority) {
|
|
17
|
+
var key = "style." + (name += "");
|
|
18
|
+
if (arguments.length < 2) return (key = this.tween(key)) && key._value;
|
|
19
|
+
if (value == null) return this.tween(key, null);
|
|
20
|
+
if (typeof value !== "function") throw new Error();
|
|
21
|
+
return this.tween(key, styleTween(name, value, priority == null ? "" : priority));
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
transition_styleTween as default
|
|
25
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { tweenValue } from "./tween.js";
|
|
2
|
+
function textConstant(value) {
|
|
3
|
+
return function() {
|
|
4
|
+
this.textContent = value;
|
|
5
|
+
};
|
|
6
|
+
}
|
|
7
|
+
function textFunction(value) {
|
|
8
|
+
return function() {
|
|
9
|
+
var value1 = value(this);
|
|
10
|
+
this.textContent = value1 == null ? "" : value1;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
function transition_text(value) {
|
|
14
|
+
return this.tween("text", typeof value === "function" ? textFunction(tweenValue(this, "text", value)) : textConstant(value == null ? "" : value + ""));
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
transition_text as default
|
|
18
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
function textInterpolate(i) {
|
|
2
|
+
return function(t) {
|
|
3
|
+
this.textContent = i.call(this, t);
|
|
4
|
+
};
|
|
5
|
+
}
|
|
6
|
+
function textTween(value) {
|
|
7
|
+
var t0, i0;
|
|
8
|
+
function tween() {
|
|
9
|
+
var i = value.apply(this, arguments);
|
|
10
|
+
if (i !== i0) t0 = (i0 = i) && textInterpolate(i);
|
|
11
|
+
return t0;
|
|
12
|
+
}
|
|
13
|
+
tween._value = value;
|
|
14
|
+
return tween;
|
|
15
|
+
}
|
|
16
|
+
function transition_textTween(value) {
|
|
17
|
+
var key = "text";
|
|
18
|
+
if (arguments.length < 1) return (key = this.tween(key)) && key._value;
|
|
19
|
+
if (value == null) return this.tween(key, null);
|
|
20
|
+
if (typeof value !== "function") throw new Error();
|
|
21
|
+
return this.tween(key, textTween(value));
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
transition_textTween as default
|
|
25
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Transition, newId } from "./index.js";
|
|
2
|
+
import schedule, { get } from "./schedule.js";
|
|
3
|
+
function transition_transition() {
|
|
4
|
+
var name = this._name, id0 = this._id, id1 = newId();
|
|
5
|
+
for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) {
|
|
6
|
+
for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {
|
|
7
|
+
if (node = group[i]) {
|
|
8
|
+
var inherit = get(node, id0);
|
|
9
|
+
schedule(node, name, id1, i, group, {
|
|
10
|
+
time: inherit.time + inherit.delay + inherit.duration,
|
|
11
|
+
delay: 0,
|
|
12
|
+
duration: inherit.duration,
|
|
13
|
+
ease: inherit.ease
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return new Transition(groups, this._parents, name, id1);
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
transition_transition as default
|
|
22
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { get, set } from "./schedule.js";
|
|
2
|
+
function tweenRemove(id, name) {
|
|
3
|
+
var tween0, tween1;
|
|
4
|
+
return function() {
|
|
5
|
+
var schedule = set(this, id), tween = schedule.tween;
|
|
6
|
+
if (tween !== tween0) {
|
|
7
|
+
tween1 = tween0 = tween;
|
|
8
|
+
for (var i = 0, n = tween1.length; i < n; ++i) {
|
|
9
|
+
if (tween1[i].name === name) {
|
|
10
|
+
tween1 = tween1.slice();
|
|
11
|
+
tween1.splice(i, 1);
|
|
12
|
+
break;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
schedule.tween = tween1;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
function tweenFunction(id, name, value) {
|
|
20
|
+
var tween0, tween1;
|
|
21
|
+
if (typeof value !== "function") throw new Error();
|
|
22
|
+
return function() {
|
|
23
|
+
var schedule = set(this, id), tween = schedule.tween;
|
|
24
|
+
if (tween !== tween0) {
|
|
25
|
+
tween1 = (tween0 = tween).slice();
|
|
26
|
+
for (var t = { name, value }, i = 0, n = tween1.length; i < n; ++i) {
|
|
27
|
+
if (tween1[i].name === name) {
|
|
28
|
+
tween1[i] = t;
|
|
29
|
+
break;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
if (i === n) tween1.push(t);
|
|
33
|
+
}
|
|
34
|
+
schedule.tween = tween1;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function transition_tween(name, value) {
|
|
38
|
+
var id = this._id;
|
|
39
|
+
name += "";
|
|
40
|
+
if (arguments.length < 2) {
|
|
41
|
+
var tween = get(this.node(), id).tween;
|
|
42
|
+
for (var i = 0, n = tween.length, t; i < n; ++i) {
|
|
43
|
+
if ((t = tween[i]).name === name) {
|
|
44
|
+
return t.value;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
return this.each((value == null ? tweenRemove : tweenFunction)(id, name, value));
|
|
50
|
+
}
|
|
51
|
+
function tweenValue(transition, name, value) {
|
|
52
|
+
var id = transition._id;
|
|
53
|
+
transition.each(function() {
|
|
54
|
+
var schedule = set(this, id);
|
|
55
|
+
(schedule.value || (schedule.value = {}))[name] = value.apply(this, arguments);
|
|
56
|
+
});
|
|
57
|
+
return function(node) {
|
|
58
|
+
return get(node, id).value[name];
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
export {
|
|
62
|
+
transition_tween as default,
|
|
63
|
+
tweenValue
|
|
64
|
+
};
|