@d3plus/core 3.1.6 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9922 -78537
- package/es/index.js +8 -0
- package/es/index.js.map +1 -1
- package/es/internal.js +54 -0
- package/es/internal.js.map +1 -0
- package/es/src/charts/AreaPlot/index.js +36 -0
- package/es/src/charts/AreaPlot/index.js.map +1 -0
- package/es/src/charts/BarChart/index.js +48 -0
- package/es/src/charts/BarChart/index.js.map +1 -0
- package/es/src/charts/BoxWhisker/index.js +52 -0
- package/es/src/charts/BoxWhisker/index.js.map +1 -0
- package/es/src/charts/BumpChart/index.js +81 -0
- package/es/src/charts/BumpChart/index.js.map +1 -0
- package/es/src/charts/Donut/index.js +42 -0
- package/es/src/charts/Donut/index.js.map +1 -0
- package/es/src/charts/Geomap/applyLayout.js +208 -0
- package/es/src/charts/Geomap/applyLayout.js.map +1 -0
- package/es/src/charts/Geomap/emit.js +169 -0
- package/es/src/charts/Geomap/emit.js.map +1 -0
- package/es/src/charts/Geomap/index.js +521 -0
- package/es/src/charts/Geomap/index.js.map +1 -0
- package/es/src/charts/LinePlot/index.js +32 -0
- package/es/src/charts/LinePlot/index.js.map +1 -0
- package/es/src/charts/Matrix/applyLayout.js +92 -0
- package/es/src/charts/Matrix/applyLayout.js.map +1 -0
- package/es/src/charts/Matrix/emit.js +44 -0
- package/es/src/charts/Matrix/emit.js.map +1 -0
- package/es/src/charts/Matrix/index.js +154 -0
- package/es/src/charts/Matrix/index.js.map +1 -0
- package/es/src/charts/Network/applyLayout.js +322 -0
- package/es/src/charts/Network/applyLayout.js.map +1 -0
- package/es/src/charts/Network/emit.js +273 -0
- package/es/src/charts/Network/emit.js.map +1 -0
- package/es/src/charts/Network/index.js +422 -0
- package/es/src/charts/Network/index.js.map +1 -0
- package/es/src/charts/Pack/applyLayout.js +46 -0
- package/es/src/charts/Pack/applyLayout.js.map +1 -0
- package/es/src/charts/Pack/emit.js +116 -0
- package/es/src/charts/Pack/emit.js.map +1 -0
- package/es/src/charts/Pack/index.js +194 -0
- package/es/src/charts/Pack/index.js.map +1 -0
- package/es/src/charts/Pack/recursionCircles.js +18 -0
- package/es/src/charts/Pack/recursionCircles.js.map +1 -0
- package/es/src/charts/Pie/applyLayout.js +44 -0
- package/es/src/charts/Pie/applyLayout.js.map +1 -0
- package/es/src/charts/Pie/emit.js +111 -0
- package/es/src/charts/Pie/emit.js.map +1 -0
- package/es/src/charts/Pie/index.js +134 -0
- package/es/src/charts/Pie/index.js.map +1 -0
- package/es/src/charts/Plot/draw.js +424 -0
- package/es/src/charts/Plot/draw.js.map +1 -0
- package/es/src/charts/Plot/index.js +827 -0
- package/es/src/charts/Plot/index.js.map +1 -0
- package/es/src/charts/Plot/labelPlacement.js +36 -0
- package/es/src/charts/Plot/labelPlacement.js.map +1 -0
- package/es/src/charts/Plot/pipeline.js +594 -0
- package/es/src/charts/Plot/pipeline.js.map +1 -0
- package/es/src/charts/Plot/pipelineDomains.js +254 -0
- package/es/src/charts/Plot/pipelineDomains.js.map +1 -0
- package/es/src/charts/Plot/pipelineLineLabels.js +210 -0
- package/es/src/charts/Plot/pipelineLineLabels.js.map +1 -0
- package/es/src/charts/Plot/shapeDefaults.js +189 -0
- package/es/src/charts/Plot/shapeDefaults.js.map +1 -0
- package/es/src/charts/Plot/stackHelpers.js +52 -0
- package/es/src/charts/Plot/stackHelpers.js.map +1 -0
- package/es/src/charts/Priestley/applyLayout.js +121 -0
- package/es/src/charts/Priestley/applyLayout.js.map +1 -0
- package/es/src/charts/Priestley/emit.js +129 -0
- package/es/src/charts/Priestley/emit.js.map +1 -0
- package/es/src/charts/Priestley/index.js +97 -0
- package/es/src/charts/Priestley/index.js.map +1 -0
- package/es/src/charts/Radar/applyLayout.js +326 -0
- package/es/src/charts/Radar/applyLayout.js.map +1 -0
- package/es/src/charts/Radar/emit.js +28 -0
- package/es/src/charts/Radar/emit.js.map +1 -0
- package/es/src/charts/Radar/index.js +98 -0
- package/es/src/charts/Radar/index.js.map +1 -0
- package/es/src/charts/RadialMatrix/applyLayout.js +132 -0
- package/es/src/charts/RadialMatrix/applyLayout.js.map +1 -0
- package/es/src/charts/RadialMatrix/emit.js +33 -0
- package/es/src/charts/RadialMatrix/emit.js.map +1 -0
- package/es/src/charts/RadialMatrix/index.js +144 -0
- package/es/src/charts/RadialMatrix/index.js.map +1 -0
- package/es/src/charts/Rings/applyLayout.js +508 -0
- package/es/src/charts/Rings/applyLayout.js.map +1 -0
- package/es/src/charts/Rings/emit.js +222 -0
- package/es/src/charts/Rings/emit.js.map +1 -0
- package/es/src/charts/Rings/index.js +245 -0
- package/es/src/charts/Rings/index.js.map +1 -0
- package/es/src/charts/Sankey/applyLayout.js +107 -0
- package/es/src/charts/Sankey/applyLayout.js.map +1 -0
- package/es/src/charts/Sankey/emit.js +134 -0
- package/es/src/charts/Sankey/emit.js.map +1 -0
- package/es/src/charts/Sankey/index.js +219 -0
- package/es/src/charts/Sankey/index.js.map +1 -0
- package/es/src/charts/StackedArea/index.js +27 -0
- package/es/src/charts/StackedArea/index.js.map +1 -0
- package/es/src/charts/Tree/applyLayout.js +233 -0
- package/es/src/charts/Tree/applyLayout.js.map +1 -0
- package/es/src/charts/Tree/emit.js +257 -0
- package/es/src/charts/Tree/emit.js.map +1 -0
- package/es/src/charts/Tree/index.js +105 -0
- package/es/src/charts/Tree/index.js.map +1 -0
- package/es/src/charts/Treemap/applyLayout.js +85 -0
- package/es/src/charts/Treemap/applyLayout.js.map +1 -0
- package/es/src/charts/Treemap/emit.js +141 -0
- package/es/src/charts/Treemap/emit.js.map +1 -0
- package/es/src/charts/Treemap/index.js +177 -0
- package/es/src/charts/Treemap/index.js.map +1 -0
- package/es/src/charts/Treemap/thresholdFunction.js +112 -0
- package/es/src/charts/Treemap/thresholdFunction.js.map +1 -0
- package/es/src/charts/definition/ChartDefinition.js +12 -0
- package/es/src/charts/definition/ChartDefinition.js.map +1 -0
- package/es/src/charts/definition/applyDefinition.js +107 -0
- package/es/src/charts/definition/applyDefinition.js.map +1 -0
- package/es/src/charts/definition/makeChart.js +153 -0
- package/es/src/charts/definition/makeChart.js.map +1 -0
- package/es/src/charts/drawSteps/zoomControls.js +231 -96
- package/es/src/charts/drawSteps/zoomControls.js.map +1 -1
- package/es/src/charts/events/click.legend.js +2 -2
- package/es/src/charts/events/click.legend.js.map +1 -1
- package/es/src/charts/events/click.shape.js +5 -5
- package/es/src/charts/events/click.shape.js.map +1 -1
- package/es/src/charts/events/mouseenter.js +20 -1
- package/es/src/charts/events/mouseenter.js.map +1 -1
- package/es/src/charts/events/mouseleave.js +19 -4
- package/es/src/charts/events/mouseleave.js.map +1 -1
- package/es/src/charts/events/mousemove.legend.js +10 -10
- package/es/src/charts/events/mousemove.legend.js.map +1 -1
- package/es/src/charts/events/mousemove.shape.js +14 -8
- package/es/src/charts/events/mousemove.shape.js.map +1 -1
- package/es/src/charts/events/touchstart.body.js.map +1 -1
- package/es/src/charts/features/axes.js +432 -0
- package/es/src/charts/features/axes.js.map +1 -0
- package/es/src/charts/features/chartGeometry.js +66 -0
- package/es/src/charts/features/chartGeometry.js.map +1 -0
- package/es/src/charts/features/colorScaleBucket.js +92 -0
- package/es/src/charts/features/colorScaleBucket.js.map +1 -0
- package/es/src/charts/features/emitHelpers.js +217 -0
- package/es/src/charts/features/emitHelpers.js.map +1 -0
- package/es/src/charts/features/ensureZoomDom.js +71 -0
- package/es/src/charts/features/ensureZoomDom.js.map +1 -0
- package/es/src/charts/features/features.js +650 -0
- package/es/src/charts/features/features.js.map +1 -0
- package/es/src/charts/features/featuresLegend.js +180 -0
- package/es/src/charts/features/featuresLegend.js.map +1 -0
- package/es/src/charts/features/legendLabel.js +12 -0
- package/es/src/charts/features/legendLabel.js.map +1 -0
- package/es/src/charts/features/lineLabels.js +154 -0
- package/es/src/charts/features/lineLabels.js.map +1 -0
- package/es/src/charts/features/plotPaint.js +512 -0
- package/es/src/charts/features/plotPaint.js.map +1 -0
- package/es/src/charts/features/shapeEmit.js +273 -0
- package/es/src/charts/features/shapeEmit.js.map +1 -0
- package/es/src/charts/helpers/matrixData.js +3 -3
- package/es/src/charts/helpers/matrixData.js.map +1 -1
- package/es/src/charts/index.js +21 -21
- package/es/src/charts/index.js.map +1 -1
- package/es/src/charts/pipeline/resolveSpec.js +44 -0
- package/es/src/charts/pipeline/resolveSpec.js.map +1 -0
- package/es/src/charts/pipeline/runChartDraw.js +109 -0
- package/es/src/charts/pipeline/runChartDraw.js.map +1 -0
- package/es/src/charts/pipeline/runVizPipeline.js +84 -0
- package/es/src/charts/pipeline/runVizPipeline.js.map +1 -0
- package/es/src/charts/pipeline/stages.js +103 -0
- package/es/src/charts/pipeline/stages.js.map +1 -0
- package/es/src/charts/pipeline/vizContext.js +29 -0
- package/es/src/charts/pipeline/vizContext.js.map +1 -0
- package/es/src/charts/pipeline/vizDraw.js +37 -0
- package/es/src/charts/pipeline/vizDraw.js.map +1 -0
- package/es/src/charts/pipeline/vizDrawPure.js +174 -0
- package/es/src/charts/pipeline/vizDrawPure.js.map +1 -0
- package/es/src/charts/pipeline/vizPreDraw.js +145 -0
- package/es/src/charts/pipeline/vizPreDraw.js.map +1 -0
- package/es/src/charts/pipeline/vizPreDrawPure.js +279 -0
- package/es/src/charts/pipeline/vizPreDrawPure.js.map +1 -0
- package/es/src/charts/plotBuffers/Bar.js +4 -4
- package/es/src/charts/plotBuffers/Bar.js.map +1 -1
- package/es/src/charts/plotBuffers/Box.js +4 -4
- package/es/src/charts/plotBuffers/Box.js.map +1 -1
- package/es/src/charts/plotBuffers/Circle.js +2 -2
- package/es/src/charts/plotBuffers/Circle.js.map +1 -1
- package/es/src/charts/plotBuffers/Line.js +5 -5
- package/es/src/charts/plotBuffers/Line.js.map +1 -1
- package/es/src/charts/plotBuffers/Rect.js +2 -2
- package/es/src/charts/plotBuffers/Rect.js.map +1 -1
- package/es/src/charts/plotBuffers/discreteBuffer.js +1 -2
- package/es/src/charts/plotBuffers/discreteBuffer.js.map +1 -1
- package/es/src/charts/plotBuffers/numericBuffer.js +1 -2
- package/es/src/charts/plotBuffers/numericBuffer.js.map +1 -1
- package/es/src/charts/viz/Viz.js +985 -0
- package/es/src/charts/viz/Viz.js.map +1 -0
- package/es/src/charts/viz/VizBase.js +447 -0
- package/es/src/charts/viz/VizBase.js.map +1 -0
- package/es/src/charts/viz/VizBaseConfig.js +504 -0
- package/es/src/charts/viz/VizBaseConfig.js.map +1 -0
- package/es/src/charts/viz/interactionOpacity.js +247 -0
- package/es/src/charts/viz/interactionOpacity.js.map +1 -0
- package/es/src/charts/viz/ordinalColor.js +71 -0
- package/es/src/charts/viz/ordinalColor.js.map +1 -0
- package/es/src/charts/viz/trailCatchup.js +127 -0
- package/es/src/charts/viz/trailCatchup.js.map +1 -0
- package/es/src/charts/viz/vizDefaults.js +602 -0
- package/es/src/charts/viz/vizDefaults.js.map +1 -0
- package/es/src/charts/viz/vizRender.js +251 -0
- package/es/src/charts/viz/vizRender.js.map +1 -0
- package/es/src/charts/viz/vizTypes.js +28 -0
- package/es/src/charts/viz/vizTypes.js.map +1 -0
- package/es/src/components/Axis/Axis.js +691 -0
- package/es/src/components/Axis/Axis.js.map +1 -0
- package/es/src/components/Axis/AxisBottom.js.map +1 -0
- package/es/src/components/Axis/AxisLeft.js.map +1 -0
- package/es/src/components/Axis/AxisRight.js.map +1 -0
- package/es/src/components/Axis/AxisTop.js.map +1 -0
- package/es/src/components/Axis/axisLayout.js +208 -0
- package/es/src/components/Axis/axisLayout.js.map +1 -0
- package/es/src/components/Axis/axisLayoutLabels.js +177 -0
- package/es/src/components/Axis/axisLayoutLabels.js.map +1 -0
- package/es/src/components/Axis/axisLayoutScale.js +374 -0
- package/es/src/components/Axis/axisLayoutScale.js.map +1 -0
- package/es/src/components/Axis/axisRender.js +535 -0
- package/es/src/components/Axis/axisRender.js.map +1 -0
- package/es/src/components/ColorScale/ColorScale.js +506 -0
- package/es/src/components/ColorScale/ColorScale.js.map +1 -0
- package/es/src/components/ColorScale/colorScaleRender.js +277 -0
- package/es/src/components/ColorScale/colorScaleRender.js.map +1 -0
- package/es/src/components/ColorScale/colorScaleScale.js +274 -0
- package/es/src/components/ColorScale/colorScaleScale.js.map +1 -0
- package/es/src/components/Legend/Legend.js +445 -0
- package/es/src/components/Legend/Legend.js.map +1 -0
- package/es/src/components/Legend/legendConfig.js +87 -0
- package/es/src/components/Legend/legendConfig.js.map +1 -0
- package/es/src/components/Legend/legendRender.js +245 -0
- package/es/src/components/Legend/legendRender.js.map +1 -0
- package/es/src/components/Message.js.map +1 -1
- package/es/src/components/TextBox.js +639 -453
- package/es/src/components/TextBox.js.map +1 -1
- package/es/src/components/Timeline/Timeline.js +674 -0
- package/es/src/components/Timeline/Timeline.js.map +1 -0
- package/es/src/components/Timeline/timelineConfig.js +115 -0
- package/es/src/components/Timeline/timelineConfig.js.map +1 -0
- package/es/src/components/Timeline/timelineRender.js +267 -0
- package/es/src/components/Timeline/timelineRender.js.map +1 -0
- package/es/src/components/Tooltip.js +288 -249
- package/es/src/components/Tooltip.js.map +1 -1
- package/es/src/components/index.js +8 -8
- package/es/src/components/index.js.map +1 -1
- package/es/src/fluent.js +265 -0
- package/es/src/fluent.js.map +1 -0
- package/es/src/shapes/Area.js +96 -114
- package/es/src/shapes/Area.js.map +1 -1
- package/es/src/shapes/Bar.js +71 -86
- package/es/src/shapes/Bar.js.map +1 -1
- package/es/src/shapes/Box.js +295 -190
- package/es/src/shapes/Box.js.map +1 -1
- package/es/src/shapes/Circle.js +72 -31
- package/es/src/shapes/Circle.js.map +1 -1
- package/es/src/shapes/Image.js +164 -85
- package/es/src/shapes/Image.js.map +1 -1
- package/es/src/shapes/Line.js +51 -94
- package/es/src/shapes/Line.js.map +1 -1
- package/es/src/shapes/Path.js +33 -41
- package/es/src/shapes/Path.js.map +1 -1
- package/es/src/shapes/Rect.js +86 -37
- package/es/src/shapes/Rect.js.map +1 -1
- package/es/src/shapes/Shape.js +655 -678
- package/es/src/shapes/Shape.js.map +1 -1
- package/es/src/shapes/Whisker.js +156 -61
- package/es/src/shapes/Whisker.js.map +1 -1
- package/es/src/shapes/buildLabelData.js +70 -0
- package/es/src/shapes/buildLabelData.js.map +1 -0
- package/es/src/shapes/emitLabels.js +84 -0
- package/es/src/shapes/emitLabels.js.map +1 -0
- package/es/src/shapes/hitAreaNode.js +37 -0
- package/es/src/shapes/hitAreaNode.js.map +1 -0
- package/es/src/shapes/sceneSort.js +57 -0
- package/es/src/shapes/sceneSort.js.map +1 -0
- package/es/src/shapes/shapeConfig.js +31 -0
- package/es/src/shapes/shapeConfig.js.map +1 -0
- package/es/src/utils/BaseClass.js +35 -19
- package/es/src/utils/BaseClass.js.map +1 -1
- package/es/src/utils/D3Scale.js +16 -0
- package/es/src/utils/D3Scale.js.map +1 -0
- package/es/src/utils/D3plusConfig.js.map +1 -1
- package/es/src/utils/configPrep.js +8 -3
- package/es/src/utils/configPrep.js.map +1 -1
- package/es/src/utils/getProp.js +1 -1
- package/es/src/utils/getProp.js.map +1 -1
- package/es/src/utils/index.js +1 -0
- package/es/src/utils/index.js.map +1 -1
- package/es/src/utils/paintComponentScene.js +59 -0
- package/es/src/utils/paintComponentScene.js.map +1 -0
- package/es/umd-entry.js +16 -0
- package/es/umd-entry.js.map +1 -0
- package/package.json +14 -9
- package/types/index.d.ts +3 -1
- package/types/internal.d.ts +54 -0
- package/types/src/charts/AreaPlot/index.d.ts +10 -0
- package/types/src/charts/BarChart/index.d.ts +10 -0
- package/types/src/charts/BoxWhisker/index.d.ts +11 -0
- package/types/src/charts/BumpChart/index.d.ts +11 -0
- package/types/src/charts/ChartDefinition.d.ts +75 -0
- package/types/src/charts/Donut/index.d.ts +13 -0
- package/types/src/charts/Geomap/applyLayout.d.ts +7 -0
- package/types/src/charts/Geomap/emit.d.ts +7 -0
- package/types/src/charts/Geomap/index.d.ts +14 -0
- package/types/src/charts/Geomap.d.ts +6 -0
- package/types/src/charts/LinePlot/index.d.ts +10 -0
- package/types/src/charts/Matrix/applyLayout.d.ts +9 -0
- package/types/src/charts/Matrix/emit.d.ts +6 -0
- package/types/src/charts/Matrix/index.d.ts +14 -0
- package/types/src/charts/Matrix.d.ts +0 -26
- package/types/src/charts/Network/applyLayout.d.ts +10 -0
- package/types/src/charts/Network/emit.d.ts +6 -0
- package/types/src/charts/Network/index.d.ts +7 -0
- package/types/src/charts/Network.d.ts +0 -24
- package/types/src/charts/Pack/applyLayout.d.ts +16 -0
- package/types/src/charts/Pack/emit.d.ts +6 -0
- package/types/src/charts/Pack/index.d.ts +15 -0
- package/types/src/charts/Pack/recursionCircles.d.ts +7 -0
- package/types/src/charts/Pack.d.ts +0 -13
- package/types/src/charts/Pie/applyLayout.d.ts +8 -0
- package/types/src/charts/Pie/emit.d.ts +5 -0
- package/types/src/charts/Pie/index.d.ts +14 -0
- package/types/src/charts/Pie.d.ts +0 -27
- package/types/src/charts/Plot/draw.d.ts +2 -0
- package/types/src/charts/Plot/index.d.ts +167 -0
- package/types/src/charts/Plot/labelPlacement.d.ts +15 -0
- package/types/src/charts/Plot/pipeline.d.ts +70 -0
- package/types/src/charts/Plot/pipelineDomains.d.ts +2 -0
- package/types/src/charts/Plot/pipelineLineLabels.d.ts +2 -0
- package/types/src/charts/Plot/shapeDefaults.d.ts +64 -0
- package/types/src/charts/Plot/stackHelpers.d.ts +24 -0
- package/types/src/charts/Plot.d.ts +23 -72
- package/types/src/charts/Priestley/applyLayout.d.ts +21 -0
- package/types/src/charts/Priestley/emit.d.ts +6 -0
- package/types/src/charts/Priestley/index.d.ts +14 -0
- package/types/src/charts/Radar/applyLayout.d.ts +10 -0
- package/types/src/charts/Radar/emit.d.ts +7 -0
- package/types/src/charts/Radar/index.d.ts +14 -0
- package/types/src/charts/RadialMatrix/applyLayout.d.ts +11 -0
- package/types/src/charts/RadialMatrix/emit.d.ts +6 -0
- package/types/src/charts/RadialMatrix/index.d.ts +14 -0
- package/types/src/charts/RadialMatrix.d.ts +0 -15
- package/types/src/charts/Rings/applyLayout.d.ts +2 -0
- package/types/src/charts/Rings/emit.d.ts +7 -0
- package/types/src/charts/Rings/index.d.ts +15 -0
- package/types/src/charts/Rings.d.ts +0 -13
- package/types/src/charts/Sankey/applyLayout.d.ts +7 -0
- package/types/src/charts/Sankey/emit.d.ts +6 -0
- package/types/src/charts/Sankey/index.d.ts +7 -0
- package/types/src/charts/Sankey.d.ts +0 -4
- package/types/src/charts/StackedArea/index.d.ts +10 -0
- package/types/src/charts/Tree/applyLayout.d.ts +2 -0
- package/types/src/charts/Tree/emit.d.ts +7 -0
- package/types/src/charts/Tree/index.d.ts +14 -0
- package/types/src/charts/Tree.d.ts +0 -16
- package/types/src/charts/Treemap/applyLayout.d.ts +16 -0
- package/types/src/charts/Treemap/emit.d.ts +6 -0
- package/types/src/charts/Treemap/index.d.ts +18 -0
- package/types/src/charts/Treemap/thresholdFunction.d.ts +25 -0
- package/types/src/charts/Treemap.d.ts +4 -13
- package/types/src/charts/Viz.d.ts +49 -361
- package/types/src/charts/VizBase.d.ts +158 -0
- package/types/src/charts/VizBaseConfig.d.ts +148 -0
- package/types/src/charts/applyDefinition.d.ts +13 -0
- package/types/src/charts/axes.d.ts +134 -0
- package/types/src/charts/chartGeometry.d.ts +58 -0
- package/types/src/charts/definition/ChartDefinition.d.ts +84 -0
- package/types/src/charts/definition/applyDefinition.d.ts +13 -0
- package/types/src/charts/definition/makeChart.d.ts +22 -0
- package/types/src/charts/drawSteps/zoomControls.d.ts +25 -5
- package/types/src/charts/emitHelpers.d.ts +122 -0
- package/types/src/charts/ensureZoomDom.d.ts +39 -0
- package/types/src/charts/events/click.legend.d.ts +1 -1
- package/types/src/charts/events/click.shape.d.ts +1 -1
- package/types/src/charts/events/mouseenter.d.ts +1 -1
- package/types/src/charts/events/mouseleave.d.ts +1 -1
- package/types/src/charts/events/mousemove.legend.d.ts +1 -1
- package/types/src/charts/events/mousemove.shape.d.ts +1 -1
- package/types/src/charts/events/touchstart.body.d.ts +1 -1
- package/types/src/charts/factories.d.ts +73 -0
- package/types/src/charts/features/axes.d.ts +134 -0
- package/types/src/charts/features/chartGeometry.d.ts +58 -0
- package/types/src/charts/features/colorScaleBucket.d.ts +43 -0
- package/types/src/charts/features/colorScaleBucketShare.d.ts +16 -0
- package/types/src/charts/features/emitHelpers.d.ts +123 -0
- package/types/src/charts/features/ensureZoomDom.d.ts +39 -0
- package/types/src/charts/features/features.d.ts +152 -0
- package/types/src/charts/features/featuresLegend.d.ts +12 -0
- package/types/src/charts/features/legendLabel.d.ts +11 -0
- package/types/src/charts/features/lineLabels.d.ts +40 -0
- package/types/src/charts/features/plotPaint.d.ts +233 -0
- package/types/src/charts/features/shapeEmit.d.ts +61 -0
- package/types/src/charts/features.d.ts +152 -0
- package/types/src/charts/featuresLegend.d.ts +12 -0
- package/types/src/charts/helpers/matrixData.d.ts +1 -1
- package/types/src/charts/index.d.ts +21 -21
- package/types/src/charts/legendLabel.d.ts +11 -0
- package/types/src/charts/lineLabels.d.ts +40 -0
- package/types/src/charts/makeChart.d.ts +22 -0
- package/types/src/charts/pipeline/resolveSpec.d.ts +51 -0
- package/types/src/charts/pipeline/runChartDraw.d.ts +38 -0
- package/types/src/charts/pipeline/runVizPipeline.d.ts +31 -0
- package/types/src/charts/pipeline/stages.d.ts +160 -0
- package/types/src/charts/pipeline/vizContext.d.ts +45 -0
- package/types/src/charts/pipeline/vizDraw.d.ts +25 -0
- package/types/src/charts/pipeline/vizDrawPure.d.ts +46 -0
- package/types/src/charts/pipeline/vizPreDraw.d.ts +22 -0
- package/types/src/charts/pipeline/vizPreDrawPure.d.ts +68 -0
- package/types/src/charts/plotBuffers/Bar.d.ts +6 -5
- package/types/src/charts/plotBuffers/Box.d.ts +6 -5
- package/types/src/charts/plotBuffers/Circle.d.ts +6 -5
- package/types/src/charts/plotBuffers/Line.d.ts +6 -5
- package/types/src/charts/plotBuffers/Rect.d.ts +6 -5
- package/types/src/charts/plotBuffers/discreteBuffer.d.ts +2 -1
- package/types/src/charts/plotBuffers/numericBuffer.d.ts +2 -1
- package/types/src/charts/plotPaint.d.ts +233 -0
- package/types/src/charts/resolveSpec.d.ts +50 -0
- package/types/src/charts/runChartDraw.d.ts +38 -0
- package/types/src/charts/runVizPipeline.d.ts +31 -0
- package/types/src/charts/shapeEmit.d.ts +61 -0
- package/types/src/charts/stages.d.ts +117 -0
- package/types/src/charts/viz/Viz.d.ts +111 -0
- package/types/src/charts/viz/VizBase.d.ts +160 -0
- package/types/src/charts/viz/VizBaseConfig.d.ts +156 -0
- package/types/src/charts/viz/interactionOpacity.d.ts +23 -0
- package/types/src/charts/viz/ordinalColor.d.ts +14 -0
- package/types/src/charts/viz/trailCatchup.d.ts +14 -0
- package/types/src/charts/viz/vizDefaults.d.ts +8 -0
- package/types/src/charts/viz/vizRender.d.ts +8 -0
- package/types/src/charts/viz/vizTypes.d.ts +250 -0
- package/types/src/charts/vizContext.d.ts +46 -0
- package/types/src/charts/vizDefaults.d.ts +8 -0
- package/types/src/charts/vizDraw.d.ts +25 -0
- package/types/src/charts/vizDrawPure.d.ts +17 -0
- package/types/src/charts/vizPreDraw.d.ts +22 -0
- package/types/src/charts/vizPreDrawPure.d.ts +40 -0
- package/types/src/charts/vizRender.d.ts +8 -0
- package/types/src/charts/vizTypes.d.ts +202 -0
- package/types/src/components/Axis/Axis.d.ts +182 -0
- package/types/src/components/Axis/AxisBottom.d.ts +11 -0
- package/types/src/components/Axis/AxisLeft.d.ts +11 -0
- package/types/src/components/Axis/AxisRight.d.ts +11 -0
- package/types/src/components/Axis/AxisTop.d.ts +11 -0
- package/types/src/components/Axis/axisLayout.d.ts +29 -0
- package/types/src/components/Axis/axisLayoutLabels.d.ts +70 -0
- package/types/src/components/Axis/axisLayoutScale.d.ts +14 -0
- package/types/src/components/Axis/axisRender.d.ts +68 -0
- package/types/src/components/Axis.d.ts +68 -194
- package/types/src/components/ColorScale/ColorScale.d.ts +100 -0
- package/types/src/components/ColorScale/colorScaleRender.d.ts +15 -0
- package/types/src/components/ColorScale/colorScaleScale.d.ts +19 -0
- package/types/src/components/ColorScale.d.ts +1 -129
- package/types/src/components/Legend/Legend.d.ts +95 -0
- package/types/src/components/Legend/legendConfig.d.ts +7 -0
- package/types/src/components/Legend/legendRender.d.ts +16 -0
- package/types/src/components/Legend.d.ts +9 -73
- package/types/src/components/TextBox.d.ts +25 -218
- package/types/src/components/Timeline/Timeline.d.ts +118 -0
- package/types/src/components/Timeline/timelineConfig.d.ts +6 -0
- package/types/src/components/Timeline/timelineRender.d.ts +24 -0
- package/types/src/components/Timeline.d.ts +7 -81
- package/types/src/components/Tooltip.d.ts +20 -200
- package/types/src/components/axisLayout.d.ts +27 -0
- package/types/src/components/axisLayoutLabels.d.ts +42 -0
- package/types/src/components/axisLayoutScale.d.ts +12 -0
- package/types/src/components/axisRender.d.ts +65 -0
- package/types/src/components/colorScaleRender.d.ts +15 -0
- package/types/src/components/colorScaleScale.d.ts +19 -0
- package/types/src/components/index.d.ts +8 -8
- package/types/src/components/legendConfig.d.ts +7 -0
- package/types/src/components/legendRender.d.ts +16 -0
- package/types/src/components/timelineConfig.d.ts +6 -0
- package/types/src/components/timelineRender.d.ts +14 -0
- package/types/src/fluent.d.ts +94 -0
- package/types/src/shapes/Area.d.ts +15 -27
- package/types/src/shapes/Bar.d.ts +13 -33
- package/types/src/shapes/Box.d.ts +17 -56
- package/types/src/shapes/Circle.d.ts +11 -17
- package/types/src/shapes/Image.d.ts +18 -84
- package/types/src/shapes/Line.d.ts +12 -22
- package/types/src/shapes/Path.d.ts +12 -19
- package/types/src/shapes/Rect.d.ts +11 -27
- package/types/src/shapes/Shape.d.ts +46 -257
- package/types/src/shapes/Whisker.d.ts +15 -42
- package/types/src/shapes/buildLabelData.d.ts +50 -0
- package/types/src/shapes/emitLabels.d.ts +16 -0
- package/types/src/shapes/hitAreaNode.d.ts +19 -0
- package/types/src/shapes/sceneSort.d.ts +20 -0
- package/types/src/shapes/shapeConfig.d.ts +226 -0
- package/types/src/utils/BaseClass.d.ts +13 -7
- package/types/src/utils/D3Scale.d.ts +48 -0
- package/types/src/utils/D3plusConfig.d.ts +230 -3
- package/types/src/utils/configPrep.d.ts +7 -4
- package/types/src/utils/getProp.d.ts +3 -1
- package/types/src/utils/index.d.ts +3 -1
- package/types/src/utils/paintComponentScene.d.ts +28 -0
- package/types/umd-entry.d.ts +15 -0
- package/umd/d3plus-core.full.js +31148 -19484
- package/umd/d3plus-core.full.js.map +1 -1
- package/umd/d3plus-core.full.min.js +5309 -2944
- package/umd/d3plus-core.js +17379 -10578
- package/umd/d3plus-core.js.map +1 -1
- package/umd/d3plus-core.min.js +3470 -1876
- package/es/src/charts/AreaPlot.js +0 -85
- package/es/src/charts/AreaPlot.js.map +0 -1
- package/es/src/charts/BarChart.js +0 -92
- package/es/src/charts/BarChart.js.map +0 -1
- package/es/src/charts/BoxWhisker.js +0 -92
- package/es/src/charts/BoxWhisker.js.map +0 -1
- package/es/src/charts/BumpChart.js +0 -147
- package/es/src/charts/BumpChart.js.map +0 -1
- package/es/src/charts/Donut.js +0 -84
- package/es/src/charts/Donut.js.map +0 -1
- package/es/src/charts/Geomap.js +0 -766
- package/es/src/charts/Geomap.js.map +0 -1
- package/es/src/charts/LinePlot.js +0 -83
- package/es/src/charts/LinePlot.js.map +0 -1
- package/es/src/charts/Matrix.js +0 -341
- package/es/src/charts/Matrix.js.map +0 -1
- package/es/src/charts/Network.js +0 -796
- package/es/src/charts/Network.js.map +0 -1
- package/es/src/charts/Pack.js +0 -308
- package/es/src/charts/Pack.js.map +0 -1
- package/es/src/charts/Pie.js +0 -232
- package/es/src/charts/Pie.js.map +0 -1
- package/es/src/charts/Plot.js +0 -2114
- package/es/src/charts/Plot.js.map +0 -1
- package/es/src/charts/Priestley.js +0 -296
- package/es/src/charts/Priestley.js.map +0 -1
- package/es/src/charts/Radar.js +0 -420
- package/es/src/charts/Radar.js.map +0 -1
- package/es/src/charts/RadialMatrix.js +0 -383
- package/es/src/charts/RadialMatrix.js.map +0 -1
- package/es/src/charts/Rings.js +0 -788
- package/es/src/charts/Rings.js.map +0 -1
- package/es/src/charts/Sankey.js +0 -461
- package/es/src/charts/Sankey.js.map +0 -1
- package/es/src/charts/StackedArea.js +0 -80
- package/es/src/charts/StackedArea.js.map +0 -1
- package/es/src/charts/Tree.js +0 -347
- package/es/src/charts/Tree.js.map +0 -1
- package/es/src/charts/Treemap.js +0 -454
- package/es/src/charts/Treemap.js.map +0 -1
- package/es/src/charts/Viz.js +0 -1832
- package/es/src/charts/Viz.js.map +0 -1
- package/es/src/charts/drawSteps/drawAttribution.js +0 -16
- package/es/src/charts/drawSteps/drawAttribution.js.map +0 -1
- package/es/src/charts/drawSteps/drawBack.js +0 -24
- package/es/src/charts/drawSteps/drawBack.js.map +0 -1
- package/es/src/charts/drawSteps/drawColorScale.js +0 -75
- package/es/src/charts/drawSteps/drawColorScale.js.map +0 -1
- package/es/src/charts/drawSteps/drawLegend.js +0 -122
- package/es/src/charts/drawSteps/drawLegend.js.map +0 -1
- package/es/src/charts/drawSteps/drawSubtitle.js +0 -31
- package/es/src/charts/drawSteps/drawSubtitle.js.map +0 -1
- package/es/src/charts/drawSteps/drawTimeline.js +0 -85
- package/es/src/charts/drawSteps/drawTimeline.js.map +0 -1
- package/es/src/charts/drawSteps/drawTitle.js +0 -31
- package/es/src/charts/drawSteps/drawTitle.js.map +0 -1
- package/es/src/charts/drawSteps/drawTotal.js +0 -32
- package/es/src/charts/drawSteps/drawTotal.js.map +0 -1
- package/es/src/components/Axis.js +0 -1457
- package/es/src/components/Axis.js.map +0 -1
- package/es/src/components/AxisBottom.js.map +0 -1
- package/es/src/components/AxisLeft.js.map +0 -1
- package/es/src/components/AxisRight.js.map +0 -1
- package/es/src/components/AxisTop.js.map +0 -1
- package/es/src/components/ColorScale.js +0 -843
- package/es/src/components/ColorScale.js.map +0 -1
- package/es/src/components/Legend.js +0 -622
- package/es/src/components/Legend.js.map +0 -1
- package/es/src/components/Timeline.js +0 -695
- package/es/src/components/Timeline.js.map +0 -1
- /package/es/src/components/{AxisBottom.js → Axis/AxisBottom.js} +0 -0
- /package/es/src/components/{AxisLeft.js → Axis/AxisLeft.js} +0 -0
- /package/es/src/components/{AxisRight.js → Axis/AxisRight.js} +0 -0
- /package/es/src/components/{AxisTop.js → Axis/AxisTop.js} +0 -0
|
@@ -1,695 +0,0 @@
|
|
|
1
|
-
function _assert_this_initialized(self) {
|
|
2
|
-
if (self === void 0) {
|
|
3
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
4
|
-
}
|
|
5
|
-
return self;
|
|
6
|
-
}
|
|
7
|
-
function _call_super(_this, derived, args) {
|
|
8
|
-
derived = _get_prototype_of(derived);
|
|
9
|
-
return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
|
|
10
|
-
}
|
|
11
|
-
function _class_call_check(instance, Constructor) {
|
|
12
|
-
if (!(instance instanceof Constructor)) {
|
|
13
|
-
throw new TypeError("Cannot call a class as a function");
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
function _defineProperties(target, props) {
|
|
17
|
-
for(var i = 0; i < props.length; i++){
|
|
18
|
-
var descriptor = props[i];
|
|
19
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
20
|
-
descriptor.configurable = true;
|
|
21
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
22
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
function _create_class(Constructor, protoProps, staticProps) {
|
|
26
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
27
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
28
|
-
return Constructor;
|
|
29
|
-
}
|
|
30
|
-
function _define_property(obj, key, value) {
|
|
31
|
-
if (key in obj) {
|
|
32
|
-
Object.defineProperty(obj, key, {
|
|
33
|
-
value: value,
|
|
34
|
-
enumerable: true,
|
|
35
|
-
configurable: true,
|
|
36
|
-
writable: true
|
|
37
|
-
});
|
|
38
|
-
} else {
|
|
39
|
-
obj[key] = value;
|
|
40
|
-
}
|
|
41
|
-
return obj;
|
|
42
|
-
}
|
|
43
|
-
function _get(target, property, receiver) {
|
|
44
|
-
if (typeof Reflect !== "undefined" && Reflect.get) {
|
|
45
|
-
_get = Reflect.get;
|
|
46
|
-
} else {
|
|
47
|
-
_get = function get(target, property, receiver) {
|
|
48
|
-
var base = _super_prop_base(target, property);
|
|
49
|
-
if (!base) return;
|
|
50
|
-
var desc = Object.getOwnPropertyDescriptor(base, property);
|
|
51
|
-
if (desc.get) {
|
|
52
|
-
return desc.get.call(receiver || target);
|
|
53
|
-
}
|
|
54
|
-
return desc.value;
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
return _get(target, property, receiver || target);
|
|
58
|
-
}
|
|
59
|
-
function _get_prototype_of(o) {
|
|
60
|
-
_get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
|
|
61
|
-
return o.__proto__ || Object.getPrototypeOf(o);
|
|
62
|
-
};
|
|
63
|
-
return _get_prototype_of(o);
|
|
64
|
-
}
|
|
65
|
-
function _inherits(subClass, superClass) {
|
|
66
|
-
if (typeof superClass !== "function" && superClass !== null) {
|
|
67
|
-
throw new TypeError("Super expression must either be null or a function");
|
|
68
|
-
}
|
|
69
|
-
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
70
|
-
constructor: {
|
|
71
|
-
value: subClass,
|
|
72
|
-
writable: true,
|
|
73
|
-
configurable: true
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
if (superClass) _set_prototype_of(subClass, superClass);
|
|
77
|
-
}
|
|
78
|
-
function _instanceof(left, right) {
|
|
79
|
-
"@swc/helpers - instanceof";
|
|
80
|
-
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
81
|
-
return !!right[Symbol.hasInstance](left);
|
|
82
|
-
} else {
|
|
83
|
-
return left instanceof right;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
function _possible_constructor_return(self, call) {
|
|
87
|
-
if (call && (_type_of(call) === "object" || typeof call === "function")) {
|
|
88
|
-
return call;
|
|
89
|
-
}
|
|
90
|
-
return _assert_this_initialized(self);
|
|
91
|
-
}
|
|
92
|
-
function _set_prototype_of(o, p) {
|
|
93
|
-
_set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
94
|
-
o.__proto__ = p;
|
|
95
|
-
return o;
|
|
96
|
-
};
|
|
97
|
-
return _set_prototype_of(o, p);
|
|
98
|
-
}
|
|
99
|
-
function _super_prop_base(object, property) {
|
|
100
|
-
while(!Object.prototype.hasOwnProperty.call(object, property)){
|
|
101
|
-
object = _get_prototype_of(object);
|
|
102
|
-
if (object === null) break;
|
|
103
|
-
}
|
|
104
|
-
return object;
|
|
105
|
-
}
|
|
106
|
-
function _type_of(obj) {
|
|
107
|
-
"@swc/helpers - typeof";
|
|
108
|
-
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
109
|
-
}
|
|
110
|
-
function _is_native_reflect_construct() {
|
|
111
|
-
try {
|
|
112
|
-
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
113
|
-
} catch (_) {}
|
|
114
|
-
return (_is_native_reflect_construct = function() {
|
|
115
|
-
return !!result;
|
|
116
|
-
})();
|
|
117
|
-
}
|
|
118
|
-
import { extent, max, min } from "d3-array";
|
|
119
|
-
import { brushX } from "d3-brush";
|
|
120
|
-
import { scaleTime } from "d3-scale";
|
|
121
|
-
import { pointers } from "d3-selection";
|
|
122
|
-
import { colorContrast, colorDefaults } from "@d3plus/color";
|
|
123
|
-
import { assign, attrize, backgroundColor, date, elem, textWidth } from "@d3plus/dom";
|
|
124
|
-
import { formatDate } from "@d3plus/format";
|
|
125
|
-
import { locale } from "@d3plus/locales";
|
|
126
|
-
import { closest } from "@d3plus/math";
|
|
127
|
-
import { textWrap } from "@d3plus/text";
|
|
128
|
-
import { Axis, TextBox } from "../components/index.js";
|
|
129
|
-
import { configPrep, constant } from "../utils/index.js";
|
|
130
|
-
var colorMid = "#bbb";
|
|
131
|
-
var Timeline = /*#__PURE__*/ function(Axis) {
|
|
132
|
-
"use strict";
|
|
133
|
-
_inherits(Timeline, Axis);
|
|
134
|
-
function Timeline() {
|
|
135
|
-
_class_call_check(this, Timeline);
|
|
136
|
-
var _this;
|
|
137
|
-
_this = _call_super(this, Timeline), _define_property(_this, "_brushing", void 0), _define_property(_this, "_brushFilter", void 0), _define_property(_this, "_brushMin", void 0), _define_property(_this, "_buttonAlign", void 0), _define_property(_this, "_buttonBehavior", void 0), _define_property(_this, "_buttonBehaviorCurrent", void 0), _define_property(_this, "_buttonPadding", void 0), _define_property(_this, "_buttonHeight", void 0), _define_property(_this, "_handleConfig", void 0), _define_property(_this, "_handleSize", void 0), _define_property(_this, "_hiddenHandles", void 0), _define_property(_this, "_playButton", void 0), _define_property(_this, "_playButtonClass", void 0), _define_property(_this, "_playButtonConfig", void 0), _define_property(_this, "_playButtonInterval", void 0), _define_property(_this, "_playTimer", void 0), _define_property(_this, "_selection", void 0), _define_property(_this, "_selectionConfig", void 0), _define_property(_this, "_snapping", void 0), // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
138
|
-
_define_property(_this, "_brush", void 0), // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
139
|
-
_define_property(_this, "_brushGroup", void 0), _define_property(_this, "_paddingLeft", void 0), _define_property(_this, "_ticksWidth", void 0);
|
|
140
|
-
_this._barConfig = assign({}, _this._barConfig, {
|
|
141
|
-
stroke: function stroke() {
|
|
142
|
-
return _this._buttonBehaviorCurrent === "buttons" ? "transparent" : colorMid;
|
|
143
|
-
},
|
|
144
|
-
"stroke-width": function() {
|
|
145
|
-
return _this._buttonBehaviorCurrent === "buttons" ? 0 : 1;
|
|
146
|
-
}
|
|
147
|
-
});
|
|
148
|
-
_this._brushing = true;
|
|
149
|
-
_this._brushFilter = function(event) {
|
|
150
|
-
var e = event;
|
|
151
|
-
return !e.button && e.detail < 2;
|
|
152
|
-
};
|
|
153
|
-
_this._brushMin = constant(1);
|
|
154
|
-
_this._buttonAlign = "middle";
|
|
155
|
-
_this._buttonBehavior = "auto";
|
|
156
|
-
_this._buttonPadding = 10;
|
|
157
|
-
_this._buttonHeight = 24;
|
|
158
|
-
_this._domain = [
|
|
159
|
-
2001,
|
|
160
|
-
2010
|
|
161
|
-
];
|
|
162
|
-
_this._gridSize = 0;
|
|
163
|
-
_this._handleConfig = {
|
|
164
|
-
fill: colorDefaults.light,
|
|
165
|
-
stroke: "#228be6",
|
|
166
|
-
"stroke-width": 2,
|
|
167
|
-
rx: 2,
|
|
168
|
-
ry: 2
|
|
169
|
-
};
|
|
170
|
-
_this._handleSize = 6;
|
|
171
|
-
_this._height = 100;
|
|
172
|
-
_this._labelOffset = false;
|
|
173
|
-
_this._on = {};
|
|
174
|
-
_this.orient("bottom");
|
|
175
|
-
_this._playButton = true;
|
|
176
|
-
_this._playButtonClass = new TextBox().on("click", function() {
|
|
177
|
-
// if playing, pause
|
|
178
|
-
if (_this._playTimer) {
|
|
179
|
-
if (_this._playTimer) clearInterval(_this._playTimer);
|
|
180
|
-
_this._playTimer = false;
|
|
181
|
-
_this._playButtonClass.render();
|
|
182
|
-
} else {
|
|
183
|
-
var firstTime = true;
|
|
184
|
-
var nextYear = function nextYear() {
|
|
185
|
-
var selection = _this._selection || [
|
|
186
|
-
_this._domain[_this._domain.length - 1]
|
|
187
|
-
];
|
|
188
|
-
if (!_instanceof(selection, Array)) selection = [
|
|
189
|
-
selection
|
|
190
|
-
];
|
|
191
|
-
selection = selection.map(date).map(Number);
|
|
192
|
-
if (selection.length === 1) selection.push(selection[0]);
|
|
193
|
-
var ticks = _this._ticks.map(Number);
|
|
194
|
-
var firstIndex = ticks.indexOf(selection[0]);
|
|
195
|
-
var lastIndex = ticks.indexOf(selection[selection.length - 1]);
|
|
196
|
-
if (lastIndex === ticks.length - 1) {
|
|
197
|
-
if (!firstTime) {
|
|
198
|
-
if (_this._playTimer) clearInterval(_this._playTimer);
|
|
199
|
-
_this._playTimer = false;
|
|
200
|
-
_this._playButtonClass.render();
|
|
201
|
-
} else {
|
|
202
|
-
_this.selection([
|
|
203
|
-
_this._ticks[0],
|
|
204
|
-
_this._ticks[lastIndex - firstIndex]
|
|
205
|
-
]).render();
|
|
206
|
-
}
|
|
207
|
-
} else {
|
|
208
|
-
if (lastIndex + 1 === ticks.length - 1) {
|
|
209
|
-
if (_this._playTimer) clearInterval(_this._playTimer);
|
|
210
|
-
_this._playTimer = false;
|
|
211
|
-
}
|
|
212
|
-
_this.selection([
|
|
213
|
-
_this._ticks[firstIndex + 1],
|
|
214
|
-
_this._ticks[lastIndex + 1]
|
|
215
|
-
]).render();
|
|
216
|
-
}
|
|
217
|
-
firstTime = false;
|
|
218
|
-
};
|
|
219
|
-
_this._playTimer = setInterval(nextYear, _this._playButtonInterval);
|
|
220
|
-
nextYear();
|
|
221
|
-
}
|
|
222
|
-
}).on("mousemove", function() {
|
|
223
|
-
return _this._playButtonClass.select().style("cursor", "pointer");
|
|
224
|
-
});
|
|
225
|
-
_this._playButtonConfig = {
|
|
226
|
-
fontColor: colorDefaults.dark,
|
|
227
|
-
fontSize: 15,
|
|
228
|
-
text: function text() {
|
|
229
|
-
return _this._playTimer ? "\u23F8" : "\u23F5";
|
|
230
|
-
},
|
|
231
|
-
textAnchor: "middle",
|
|
232
|
-
verticalAlign: "middle"
|
|
233
|
-
};
|
|
234
|
-
_this._playButtonInterval = 1000;
|
|
235
|
-
_this._selectionConfig = {
|
|
236
|
-
fill: "#228be6",
|
|
237
|
-
"fill-opacity": function() {
|
|
238
|
-
return _this._buttonBehaviorCurrent === "buttons" ? 0.3 : 1;
|
|
239
|
-
},
|
|
240
|
-
"stroke-width": 0
|
|
241
|
-
};
|
|
242
|
-
_this._shape = "Rect";
|
|
243
|
-
_this._shapeConfig = assign({}, _this._shapeConfig, {
|
|
244
|
-
labelBounds: function labelBounds(d) {
|
|
245
|
-
return _this._buttonBehaviorCurrent === "buttons" ? {
|
|
246
|
-
x: d.labelBounds.x,
|
|
247
|
-
y: -_this._buttonHeight / 2 + 1,
|
|
248
|
-
width: d.labelBounds.width,
|
|
249
|
-
height: _this._buttonHeight
|
|
250
|
-
} : d.labelBounds;
|
|
251
|
-
},
|
|
252
|
-
labelConfig: {
|
|
253
|
-
fontColor: function fontColor() {
|
|
254
|
-
var bg = _this._select ? backgroundColor(_this._select.node()) : "rgb(255, 255, 255)";
|
|
255
|
-
return colorContrast(bg);
|
|
256
|
-
},
|
|
257
|
-
fontSize: function fontSize() {
|
|
258
|
-
return 12;
|
|
259
|
-
},
|
|
260
|
-
verticalAlign: function verticalAlign() {
|
|
261
|
-
return _this._buttonBehaviorCurrent === "buttons" ? "middle" : "top";
|
|
262
|
-
}
|
|
263
|
-
},
|
|
264
|
-
fill: function fill() {
|
|
265
|
-
return _this._buttonBehaviorCurrent === "buttons" ? "#fff" : colorMid;
|
|
266
|
-
},
|
|
267
|
-
stroke: function stroke() {
|
|
268
|
-
return _this._buttonBehaviorCurrent === "buttons" ? colorMid : "transparent";
|
|
269
|
-
},
|
|
270
|
-
height: function height(d) {
|
|
271
|
-
return _this._buttonBehaviorCurrent === "buttons" ? _this._buttonHeight : d.tick ? _this._handleSize : 0;
|
|
272
|
-
},
|
|
273
|
-
width: function width(d) {
|
|
274
|
-
return _this._buttonBehaviorCurrent === "buttons" ? _this._ticksWidth / _this._availableTicks.length : d.tick ? _this._domain.map(Number).includes(d.id) ? 2 : 1 : 0;
|
|
275
|
-
},
|
|
276
|
-
y: function y(d) {
|
|
277
|
-
return _this._buttonBehaviorCurrent === "buttons" ? _this._align === "middle" ? _this._height / 2 : _this._align === "start" ? _this._margin.top + _this._buttonHeight / 2 : _this._height - _this._buttonHeight / 2 - _this._margin.bottom : d.y;
|
|
278
|
-
},
|
|
279
|
-
rx: function rx(d) {
|
|
280
|
-
return _this._buttonBehaviorCurrent === "buttons" ? 0 : _this._domain.map(Number).includes(d.id) ? 1 : 0;
|
|
281
|
-
},
|
|
282
|
-
ry: function ry(d) {
|
|
283
|
-
return _this._buttonBehaviorCurrent === "buttons" ? 0 : _this._domain.map(Number).includes(d.id) ? 1 : 0;
|
|
284
|
-
}
|
|
285
|
-
});
|
|
286
|
-
_this._snapping = true;
|
|
287
|
-
_this._buttonBehaviorCurrent = "auto";
|
|
288
|
-
_this._hiddenHandles = false;
|
|
289
|
-
_this._paddingLeft = 0;
|
|
290
|
-
_this._ticksWidth = 0;
|
|
291
|
-
return _this;
|
|
292
|
-
}
|
|
293
|
-
_create_class(Timeline, [
|
|
294
|
-
{
|
|
295
|
-
/**
|
|
296
|
-
Triggered on brush "brush".
|
|
297
|
-
@private
|
|
298
|
-
*/ key: "_brushBrush",
|
|
299
|
-
value: function _brushBrush(event) {
|
|
300
|
-
if (event.sourceEvent && event.sourceEvent.offsetX && event.selection !== null && (!this._brushing || this._snapping)) {
|
|
301
|
-
if (this._playTimer) clearInterval(this._playTimer);
|
|
302
|
-
this._playTimer = false;
|
|
303
|
-
this._playButtonClass.render();
|
|
304
|
-
var domain = this._updateDomain(event);
|
|
305
|
-
this._brushGroup.call(this._brush.move, this._updateBrushLimit(domain));
|
|
306
|
-
}
|
|
307
|
-
this._brushStyle();
|
|
308
|
-
if (this._on.brush) this._on.brush(this._selection);
|
|
309
|
-
}
|
|
310
|
-
},
|
|
311
|
-
{
|
|
312
|
-
/**
|
|
313
|
-
Triggered on brush "end".
|
|
314
|
-
@private
|
|
315
|
-
*/ key: "_brushEnd",
|
|
316
|
-
value: function _brushEnd(event) {
|
|
317
|
-
if (!event.sourceEvent) return; // Only transition after input.
|
|
318
|
-
var domain = this._updateDomain(event);
|
|
319
|
-
this._brushStyle();
|
|
320
|
-
if (this._brushing || !this._snapping) this._brushGroup.transition(this._transition).call(this._brush.move, this._updateBrushLimit(domain));
|
|
321
|
-
if (this._on.end) this._on.end(this._selection);
|
|
322
|
-
}
|
|
323
|
-
},
|
|
324
|
-
{
|
|
325
|
-
/**
|
|
326
|
-
Triggered on brush "start".
|
|
327
|
-
@private
|
|
328
|
-
*/ key: "_brushStart",
|
|
329
|
-
value: function _brushStart(event) {
|
|
330
|
-
if (event.sourceEvent !== null && (!this._brushing || this._snapping)) {
|
|
331
|
-
if (this._playTimer) clearInterval(this._playTimer);
|
|
332
|
-
this._playTimer = false;
|
|
333
|
-
this._playButtonClass.render();
|
|
334
|
-
var domain = this._updateDomain(event);
|
|
335
|
-
this._brushGroup.call(this._brush.move, this._updateBrushLimit(domain));
|
|
336
|
-
}
|
|
337
|
-
this._brushStyle();
|
|
338
|
-
if (this._on.start) this._on.start(event);
|
|
339
|
-
}
|
|
340
|
-
},
|
|
341
|
-
{
|
|
342
|
-
/**
|
|
343
|
-
Overrides the default brush styles.
|
|
344
|
-
@private
|
|
345
|
-
*/ key: "_brushStyle",
|
|
346
|
-
value: function _brushStyle() {
|
|
347
|
-
var _this = this;
|
|
348
|
-
var height = this._position.height;
|
|
349
|
-
var timelineHeight = this._shape === "Circle" ? typeof this._shapeConfig.r === "function" ? this._shapeConfig.r({
|
|
350
|
-
tick: true
|
|
351
|
-
}) * 2 : this._shapeConfig.r : this._shape === "Rect" ? typeof this._shapeConfig[height] === "function" ? this._shapeConfig[height]({
|
|
352
|
-
tick: true
|
|
353
|
-
}) : this._shapeConfig[height] : this._tickSize;
|
|
354
|
-
var brushSelection = this._brushGroup.selectAll(".selection").call(attrize, this._selectionConfig).attr("transform", "translate(0,-1)").attr("height", timelineHeight + 2);
|
|
355
|
-
var brushHandle = this._brushGroup.selectAll(".handle").call(attrize, this._handleConfig).attr("display", this._hiddenHandles ? "none" : "block").attr("transform", function(d) {
|
|
356
|
-
return _this._buttonBehaviorCurrent === "buttons" ? "translate(".concat(d.type === "w" ? -_this._handleSize / 2 : 0, ",-1)") : "";
|
|
357
|
-
}).attr("height", this._buttonBehaviorCurrent === "buttons" ? this._buttonHeight + 2 : timelineHeight + this._handleSize);
|
|
358
|
-
this._brushGroup.selectAll(".overlay").attr("x", this._paddingLeft).attr("cursor", "pointer").attr("transform", "translate(0,".concat(this._buttonBehaviorCurrent === "buttons" ? this._buttonHeight / 2 : -this._handleSize, ")")).attr("width", this._buttonBehaviorCurrent === "buttons" ? this._ticksWidth : this._width).attr("height", this._buttonBehaviorCurrent === "buttons" ? this._buttonHeight : this._handleSize * 2);
|
|
359
|
-
if (this._buttonBehaviorCurrent === "buttons") {
|
|
360
|
-
var yTransform = this._align === "middle" ? this._height / 2 - this._buttonHeight / 2 : this._align === "start" ? this._margin.top : this._height - this._buttonHeight - this._margin.bottom;
|
|
361
|
-
brushHandle.attr("y", yTransform);
|
|
362
|
-
brushSelection.attr("y", yTransform);
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
},
|
|
366
|
-
{
|
|
367
|
-
/**
|
|
368
|
-
Updates domain of the timeline used in brush functions.
|
|
369
|
-
@private
|
|
370
|
-
*/ key: "_updateDomain",
|
|
371
|
-
value: function _updateDomain(event) {
|
|
372
|
-
var x = pointers(event, this._select.node());
|
|
373
|
-
var domain = event.selection && this._brushing || !x.length ? event.selection : [
|
|
374
|
-
x[0][0],
|
|
375
|
-
x[0][0]
|
|
376
|
-
];
|
|
377
|
-
if (this._buttonBehaviorCurrent === "ticks") domain = domain.map(this._d3Scale.invert);
|
|
378
|
-
domain = domain.map(Number);
|
|
379
|
-
if (event.type === "brush" && this._brushing && this._buttonBehaviorCurrent === "buttons") {
|
|
380
|
-
var diffs = event.selection.map(function(d) {
|
|
381
|
-
return Math.abs(d - event.sourceEvent.offsetX);
|
|
382
|
-
});
|
|
383
|
-
var sel = event.selection;
|
|
384
|
-
var offsetX = event.sourceEvent.offsetX;
|
|
385
|
-
domain = diffs[1] <= diffs[0] ? [
|
|
386
|
-
sel[0],
|
|
387
|
-
offsetX
|
|
388
|
-
].sort(function(a, b) {
|
|
389
|
-
return a - b;
|
|
390
|
-
}) : [
|
|
391
|
-
offsetX,
|
|
392
|
-
sel[1]
|
|
393
|
-
].sort(function(a, b) {
|
|
394
|
-
return a - b;
|
|
395
|
-
});
|
|
396
|
-
}
|
|
397
|
-
var ticks = this._buttonBehaviorCurrent === "ticks" ? this._availableTicks.map(Number) : this._d3Scale.range();
|
|
398
|
-
if (this._buttonBehaviorCurrent === "ticks") {
|
|
399
|
-
// find closest min and max ticks from data
|
|
400
|
-
// and their indices in the ticks Array
|
|
401
|
-
var minDomain = date(closest(domain[0], ticks));
|
|
402
|
-
var minIndex = ticks.indexOf(+minDomain);
|
|
403
|
-
var maxDomain = date(closest(domain[1], ticks));
|
|
404
|
-
var maxIndex = ticks.indexOf(+maxDomain);
|
|
405
|
-
// using the indices, determine if the 2 ends of the brush
|
|
406
|
-
// are too close to each other. "ticksApart" always needs to
|
|
407
|
-
// be less than the current current brushMin minus 1. For
|
|
408
|
-
// example, a brushMin of "2" means that the min and max domain
|
|
409
|
-
// values need to be "1" space apart from eachother.
|
|
410
|
-
var ticksApart = Math.abs(maxIndex - minIndex);
|
|
411
|
-
var minTicksAllowed = this._brushMin() - 1;
|
|
412
|
-
// if the min and max are not far enough apart to satisfy
|
|
413
|
-
// brushMin, then forcibly extend the domain.
|
|
414
|
-
if (ticksApart < minTicksAllowed) {
|
|
415
|
-
// push the maxDomain out as far as possible to account for brushMin
|
|
416
|
-
maxIndex = min([
|
|
417
|
-
ticks.length - 1,
|
|
418
|
-
maxIndex + (minTicksAllowed - ticksApart)
|
|
419
|
-
]);
|
|
420
|
-
maxDomain = ticks[maxIndex];
|
|
421
|
-
ticksApart = Math.abs(maxIndex - minIndex);
|
|
422
|
-
// if the domain is still not far enough apart, extent the minDomain
|
|
423
|
-
// as far as possible to allow for brushMin
|
|
424
|
-
if (ticksApart < minTicksAllowed) {
|
|
425
|
-
minIndex = max([
|
|
426
|
-
0,
|
|
427
|
-
minIndex - (minTicksAllowed - ticksApart)
|
|
428
|
-
]);
|
|
429
|
-
minDomain = ticks[minIndex];
|
|
430
|
-
}
|
|
431
|
-
}
|
|
432
|
-
domain[0] = minDomain;
|
|
433
|
-
domain[1] = maxDomain;
|
|
434
|
-
} else {
|
|
435
|
-
domain[0] = closest(domain[0], ticks);
|
|
436
|
-
domain[1] = closest(domain[1], ticks);
|
|
437
|
-
}
|
|
438
|
-
// if the brush event has finished, update the current "selection" value
|
|
439
|
-
var single = +domain[0] === +domain[1];
|
|
440
|
-
if (event.type === "brush" || event.type === "end") {
|
|
441
|
-
this._selection = this._buttonBehaviorCurrent === "ticks" ? single ? domain[0] : domain : single ? date(this._availableTicks[ticks.indexOf(domain[0])]) : [
|
|
442
|
-
date(this._availableTicks[ticks.indexOf(domain[0])]),
|
|
443
|
-
date(this._availableTicks[ticks.indexOf(domain[1])])
|
|
444
|
-
];
|
|
445
|
-
}
|
|
446
|
-
return domain;
|
|
447
|
-
}
|
|
448
|
-
},
|
|
449
|
-
{
|
|
450
|
-
/**
|
|
451
|
-
Updates limits of the brush.
|
|
452
|
-
@private
|
|
453
|
-
*/ key: "_updateBrushLimit",
|
|
454
|
-
value: function _updateBrushLimit(domain) {
|
|
455
|
-
var selection = this._buttonBehaviorCurrent === "ticks" ? domain.map(date).map(this._d3Scale) : domain;
|
|
456
|
-
if (selection[0] === selection[1]) {
|
|
457
|
-
selection[0] -= 0.1;
|
|
458
|
-
selection[1] += 0.1;
|
|
459
|
-
}
|
|
460
|
-
if (this._buttonBehaviorCurrent === "buttons") {
|
|
461
|
-
var handleSize = this._hiddenHandles ? 0 : this._handleSize;
|
|
462
|
-
var buttonWidth = 0.5 * (this._ticksWidth / this._availableTicks.length - handleSize);
|
|
463
|
-
selection[0] -= buttonWidth;
|
|
464
|
-
selection[1] += buttonWidth;
|
|
465
|
-
}
|
|
466
|
-
return selection;
|
|
467
|
-
}
|
|
468
|
-
},
|
|
469
|
-
{
|
|
470
|
-
/**
|
|
471
|
-
Draws the timeline.
|
|
472
|
-
@param callback Optional callback invoked after rendering completes.
|
|
473
|
-
*/ key: "render",
|
|
474
|
-
value: function render(callback) {
|
|
475
|
-
var _this = this;
|
|
476
|
-
var _this__position = this._position, height = _this__position.height, y = _this__position.y;
|
|
477
|
-
if (this._ticks) this._ticks = this._ticks.map(date);
|
|
478
|
-
if (this._data) this._data = this._data.map(date);
|
|
479
|
-
var ticks = this._ticks ? this._ticks : this._domain.map(date);
|
|
480
|
-
if (!this._ticks) {
|
|
481
|
-
var d3Scale = scaleTime().domain(ticks).range([
|
|
482
|
-
0,
|
|
483
|
-
this._width
|
|
484
|
-
]);
|
|
485
|
-
ticks = d3Scale.ticks();
|
|
486
|
-
}
|
|
487
|
-
var timeLocale = this._timeLocale || locale[this._locale] || locale["en-US"];
|
|
488
|
-
if (this._userFormat === undefined) this._userFormat = this._tickFormat || false;
|
|
489
|
-
var tickFormat = this._tickFormat = this._userFormat ? this._userFormat : function(d) {
|
|
490
|
-
return formatDate(d, ticks).replace(/^Q/g, timeLocale.quarter);
|
|
491
|
-
};
|
|
492
|
-
// Measures size of ticks
|
|
493
|
-
this._ticksWidth = this._width;
|
|
494
|
-
if ([
|
|
495
|
-
"auto",
|
|
496
|
-
"buttons"
|
|
497
|
-
].includes(this._buttonBehavior)) {
|
|
498
|
-
var maxLabel = 0;
|
|
499
|
-
ticks.forEach(function(d, i) {
|
|
500
|
-
var _this__shapeConfig_labelConfig = _this._shapeConfig.labelConfig, fontFamily = _this__shapeConfig_labelConfig.fontFamily, fontSize = _this__shapeConfig_labelConfig.fontSize;
|
|
501
|
-
var f = typeof fontFamily === "function" ? fontFamily(d, i) : fontFamily, s = typeof fontSize === "function" ? fontSize(d, i) : fontSize;
|
|
502
|
-
var wrap = textWrap().fontFamily(f).fontSize(s).lineHeight(_this._shapeConfig.lineHeight ? _this._shapeConfig.lineHeight(d, i) : undefined);
|
|
503
|
-
var res = wrap(tickFormat(d));
|
|
504
|
-
var width = res.lines.length ? Math.ceil(max(res.lines.map(function(line) {
|
|
505
|
-
return textWidth(line, {
|
|
506
|
-
"font-family": f,
|
|
507
|
-
"font-size": s
|
|
508
|
-
});
|
|
509
|
-
}))) + s / 4 : 0;
|
|
510
|
-
if (width % 2) width++;
|
|
511
|
-
if (maxLabel < width) maxLabel = width + 2 * _this._buttonPadding;
|
|
512
|
-
});
|
|
513
|
-
this._ticksWidth = maxLabel * ticks.length;
|
|
514
|
-
}
|
|
515
|
-
var playButtonWidth = this._playButton ? this._playButtonConfig.width || this._buttonHeight : 0;
|
|
516
|
-
var space = this._width - playButtonWidth;
|
|
517
|
-
this._buttonBehaviorCurrent = this._buttonBehavior === "auto" ? this._ticksWidth < space ? "buttons" : "ticks" : this._buttonBehavior;
|
|
518
|
-
var hiddenHandles = this._hiddenHandles = this._buttonBehaviorCurrent === "buttons" && !this._brushing;
|
|
519
|
-
if (this._buttonBehaviorCurrent === "buttons") {
|
|
520
|
-
this._scale = "ordinal";
|
|
521
|
-
var domain = scaleTime().domain(this._domain.map(date)).ticks().map(Number);
|
|
522
|
-
this._domain = this._ticks ? this._ticks : Array.from(Array(domain[domain.length - 1] - domain[0] + 1), function(_, x) {
|
|
523
|
-
return domain[0] + x;
|
|
524
|
-
}).map(date);
|
|
525
|
-
this._ticks = this._domain;
|
|
526
|
-
var buttonMargin = 0.5 * this._ticksWidth / this._ticks.length;
|
|
527
|
-
var emptySpace = this._width - this._ticksWidth - playButtonWidth;
|
|
528
|
-
this._paddingLeft = this._buttonAlign === "middle" ? emptySpace / 2 + playButtonWidth : this._buttonAlign === "end" ? emptySpace + playButtonWidth : playButtonWidth;
|
|
529
|
-
this._range = [
|
|
530
|
-
this._paddingLeft + buttonMargin,
|
|
531
|
-
this._paddingLeft + this._ticksWidth - buttonMargin
|
|
532
|
-
];
|
|
533
|
-
} else {
|
|
534
|
-
this._scale = "time";
|
|
535
|
-
this._domain = extent(ticks);
|
|
536
|
-
this._range = [
|
|
537
|
-
playButtonWidth ? playButtonWidth * 1.5 : undefined,
|
|
538
|
-
undefined
|
|
539
|
-
];
|
|
540
|
-
this._paddingLeft = playButtonWidth;
|
|
541
|
-
}
|
|
542
|
-
_get(_get_prototype_of(Timeline.prototype), "render", this).call(this, callback);
|
|
543
|
-
var offset = this._outerBounds[y], range = this._d3Scale.range();
|
|
544
|
-
var brush = this._brush = brushX().extent([
|
|
545
|
-
[
|
|
546
|
-
range[0],
|
|
547
|
-
offset
|
|
548
|
-
],
|
|
549
|
-
[
|
|
550
|
-
range[range.length - 1],
|
|
551
|
-
offset + this._outerBounds[height]
|
|
552
|
-
]
|
|
553
|
-
]).filter(this._brushFilter).handleSize(hiddenHandles ? 0 : this._handleSize).on("start", this._brushStart.bind(this)).on("brush", this._brushBrush.bind(this)).on("end", this._brushEnd.bind(this));
|
|
554
|
-
// data Array to be used when detecting the default value
|
|
555
|
-
var defaultData = this._buttonBehaviorCurrent === "ticks" ? this._availableTicks : range;
|
|
556
|
-
// the default selection, if needed
|
|
557
|
-
var defaultSelection = [
|
|
558
|
-
this._brushMin() > defaultData.length ? defaultData[0] : defaultData[defaultData.length - this._brushMin()],
|
|
559
|
-
defaultData[defaultData.length - 1]
|
|
560
|
-
];
|
|
561
|
-
// the current selection, considering user input, defaults, and data
|
|
562
|
-
var selection = this._selection === void 0 ? defaultSelection : _instanceof(this._selection, Array) ? this._buttonBehaviorCurrent === "buttons" ? this._selection.map(date).map(function(d) {
|
|
563
|
-
return range[_this._ticks.map(Number).indexOf(+d)];
|
|
564
|
-
}) : this._selection.map(date) : this._buttonBehaviorCurrent === "buttons" ? [
|
|
565
|
-
range[this._ticks.map(Number).indexOf(+this._selection)]
|
|
566
|
-
] : [
|
|
567
|
-
this._selection
|
|
568
|
-
];
|
|
569
|
-
if (selection.length === 1) selection.push(selection[0]);
|
|
570
|
-
this._updateBrushLimit(selection);
|
|
571
|
-
this._brushGroup = elem("g.brushGroup", {
|
|
572
|
-
parent: this._group
|
|
573
|
-
});
|
|
574
|
-
this._brushGroup.call(brush).transition(this._transition).call(brush.move, this._buttonBehaviorCurrent === "ticks" ? this._updateBrushLimit(selection) : selection);
|
|
575
|
-
this._outerBounds.y -= this._handleSize / 2;
|
|
576
|
-
this._outerBounds.height += this._handleSize / 2;
|
|
577
|
-
var playButtonGroup = elem("g.d3plus-Timeline-play", {
|
|
578
|
-
parent: this._group
|
|
579
|
-
});
|
|
580
|
-
this._playButtonClass.data(this._playButton ? [
|
|
581
|
-
{
|
|
582
|
-
x: this._paddingLeft - playButtonWidth,
|
|
583
|
-
y: this._buttonBehaviorCurrent === "buttons" ? this._align === "middle" ? this._height / 2 - this._buttonHeight / 2 : this._align === "start" ? this._margin.top : this._height - this._buttonHeight - this._margin.bottom : this._outerBounds.y,
|
|
584
|
-
width: playButtonWidth,
|
|
585
|
-
height: this._buttonHeight
|
|
586
|
-
}
|
|
587
|
-
] : []).select(playButtonGroup.node())// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
588
|
-
.config(configPrep.bind(this)(this._playButtonConfig)).render();
|
|
589
|
-
return this;
|
|
590
|
-
}
|
|
591
|
-
},
|
|
592
|
-
{
|
|
593
|
-
key: "buttonPadding",
|
|
594
|
-
value: function buttonPadding(_) {
|
|
595
|
-
return arguments.length ? (this._buttonPadding = _, this) : this._buttonPadding;
|
|
596
|
-
}
|
|
597
|
-
},
|
|
598
|
-
{
|
|
599
|
-
key: "brushing",
|
|
600
|
-
value: function brushing(_) {
|
|
601
|
-
return arguments.length ? (this._brushing = _, this) : this._brushing;
|
|
602
|
-
}
|
|
603
|
-
},
|
|
604
|
-
{
|
|
605
|
-
key: "brushFilter",
|
|
606
|
-
value: function brushFilter(_) {
|
|
607
|
-
return arguments.length ? (this._brushFilter = _, this) : this._brushFilter;
|
|
608
|
-
}
|
|
609
|
-
},
|
|
610
|
-
{
|
|
611
|
-
key: "brushMin",
|
|
612
|
-
value: function brushMin(_) {
|
|
613
|
-
return arguments.length ? (this._brushMin = typeof _ === "function" ? _ : constant(_), this) : this._brushMin;
|
|
614
|
-
}
|
|
615
|
-
},
|
|
616
|
-
{
|
|
617
|
-
key: "buttonAlign",
|
|
618
|
-
value: function buttonAlign(_) {
|
|
619
|
-
return arguments.length ? (this._buttonAlign = _, this) : this._buttonAlign;
|
|
620
|
-
}
|
|
621
|
-
},
|
|
622
|
-
{
|
|
623
|
-
key: "buttonBehavior",
|
|
624
|
-
value: function buttonBehavior(_) {
|
|
625
|
-
return arguments.length ? (this._buttonBehavior = _, this) : this._buttonBehavior;
|
|
626
|
-
}
|
|
627
|
-
},
|
|
628
|
-
{
|
|
629
|
-
key: "buttonHeight",
|
|
630
|
-
value: function buttonHeight(_) {
|
|
631
|
-
return arguments.length ? (this._buttonHeight = _, this) : this._buttonHeight;
|
|
632
|
-
}
|
|
633
|
-
},
|
|
634
|
-
{
|
|
635
|
-
key: "handleConfig",
|
|
636
|
-
value: function handleConfig(_) {
|
|
637
|
-
return arguments.length ? (this._handleConfig = assign(this._handleConfig, _), this) : this._handleConfig;
|
|
638
|
-
}
|
|
639
|
-
},
|
|
640
|
-
{
|
|
641
|
-
key: "handleSize",
|
|
642
|
-
value: function handleSize(_) {
|
|
643
|
-
return arguments.length ? (this._handleSize = _, this) : this._handleSize;
|
|
644
|
-
}
|
|
645
|
-
},
|
|
646
|
-
{
|
|
647
|
-
key: "on",
|
|
648
|
-
value: function on(_, f) {
|
|
649
|
-
return arguments.length === 2 ? (this._on[_] = f, this) : arguments.length ? typeof _ === "string" ? this._on[_] : (this._on = assign({}, this._on, _), this) : this._on;
|
|
650
|
-
}
|
|
651
|
-
},
|
|
652
|
-
{
|
|
653
|
-
key: "playButton",
|
|
654
|
-
value: function playButton(_) {
|
|
655
|
-
return arguments.length ? (this._playButton = _, this) : this._playButton;
|
|
656
|
-
}
|
|
657
|
-
},
|
|
658
|
-
{
|
|
659
|
-
key: "playButtonConfig",
|
|
660
|
-
value: function playButtonConfig(_) {
|
|
661
|
-
return arguments.length ? (this._playButtonConfig = assign(this._playButtonConfig, _), this) : this._playButtonConfig;
|
|
662
|
-
}
|
|
663
|
-
},
|
|
664
|
-
{
|
|
665
|
-
key: "playButtonInterval",
|
|
666
|
-
value: function playButtonInterval(_) {
|
|
667
|
-
return arguments.length ? (this._playButtonInterval = _, this) : this._playButtonInterval;
|
|
668
|
-
}
|
|
669
|
-
},
|
|
670
|
-
{
|
|
671
|
-
key: "selectionConfig",
|
|
672
|
-
value: function selectionConfig(_) {
|
|
673
|
-
return arguments.length ? (this._selectionConfig = assign(this._selectionConfig, _), this) : this._selectionConfig;
|
|
674
|
-
}
|
|
675
|
-
},
|
|
676
|
-
{
|
|
677
|
-
key: "selection",
|
|
678
|
-
value: function selection(_) {
|
|
679
|
-
return arguments.length ? (this._selection = _, this) : this._selection;
|
|
680
|
-
}
|
|
681
|
-
},
|
|
682
|
-
{
|
|
683
|
-
key: "snapping",
|
|
684
|
-
value: function snapping(_) {
|
|
685
|
-
return arguments.length ? (this._snapping = _, this) : this._snapping;
|
|
686
|
-
}
|
|
687
|
-
}
|
|
688
|
-
]);
|
|
689
|
-
return Timeline;
|
|
690
|
-
}(Axis);
|
|
691
|
-
/**
|
|
692
|
-
Creates an interactive timeline brush component for selecting time periods within a visualization.
|
|
693
|
-
*/ export { Timeline as default };
|
|
694
|
-
|
|
695
|
-
//# sourceMappingURL=Timeline.js.map
|