@d3plus/core 3.1.5 → 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 +17 -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 -19470
- package/umd/d3plus-core.full.js.map +1 -1
- package/umd/d3plus-core.full.min.js +5315 -2939
- package/umd/d3plus-core.js +17379 -10575
- package/umd/d3plus-core.js.map +1 -1
- package/umd/d3plus-core.min.js +3470 -1873
- 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 -1454
- 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
|
@@ -0,0 +1,594 @@
|
|
|
1
|
+
function _array_like_to_array(arr, len) {
|
|
2
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
3
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
4
|
+
return arr2;
|
|
5
|
+
}
|
|
6
|
+
function _array_with_holes(arr) {
|
|
7
|
+
if (Array.isArray(arr)) return arr;
|
|
8
|
+
}
|
|
9
|
+
function _define_property(obj, key, value) {
|
|
10
|
+
if (key in obj) {
|
|
11
|
+
Object.defineProperty(obj, key, {
|
|
12
|
+
value: value,
|
|
13
|
+
enumerable: true,
|
|
14
|
+
configurable: true,
|
|
15
|
+
writable: true
|
|
16
|
+
});
|
|
17
|
+
} else {
|
|
18
|
+
obj[key] = value;
|
|
19
|
+
}
|
|
20
|
+
return obj;
|
|
21
|
+
}
|
|
22
|
+
function _iterable_to_array_limit(arr, i) {
|
|
23
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
24
|
+
if (_i == null) return;
|
|
25
|
+
var _arr = [];
|
|
26
|
+
var _n = true;
|
|
27
|
+
var _d = false;
|
|
28
|
+
var _s, _e;
|
|
29
|
+
try {
|
|
30
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
31
|
+
_arr.push(_s.value);
|
|
32
|
+
if (i && _arr.length === i) break;
|
|
33
|
+
}
|
|
34
|
+
} catch (err) {
|
|
35
|
+
_d = true;
|
|
36
|
+
_e = err;
|
|
37
|
+
} finally{
|
|
38
|
+
try {
|
|
39
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
40
|
+
} finally{
|
|
41
|
+
if (_d) throw _e;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return _arr;
|
|
45
|
+
}
|
|
46
|
+
function _non_iterable_rest() {
|
|
47
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
48
|
+
}
|
|
49
|
+
function _object_spread(target) {
|
|
50
|
+
for(var i = 1; i < arguments.length; i++){
|
|
51
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
52
|
+
var ownKeys = Object.keys(source);
|
|
53
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
54
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
55
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
56
|
+
}));
|
|
57
|
+
}
|
|
58
|
+
ownKeys.forEach(function(key) {
|
|
59
|
+
_define_property(target, key, source[key]);
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
return target;
|
|
63
|
+
}
|
|
64
|
+
function ownKeys(object, enumerableOnly) {
|
|
65
|
+
var keys = Object.keys(object);
|
|
66
|
+
if (Object.getOwnPropertySymbols) {
|
|
67
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
68
|
+
if (enumerableOnly) {
|
|
69
|
+
symbols = symbols.filter(function(sym) {
|
|
70
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
keys.push.apply(keys, symbols);
|
|
74
|
+
}
|
|
75
|
+
return keys;
|
|
76
|
+
}
|
|
77
|
+
function _object_spread_props(target, source) {
|
|
78
|
+
source = source != null ? source : {};
|
|
79
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
80
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
81
|
+
} else {
|
|
82
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
83
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
return target;
|
|
87
|
+
}
|
|
88
|
+
function _sliced_to_array(arr, i) {
|
|
89
|
+
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
90
|
+
}
|
|
91
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
92
|
+
if (!o) return;
|
|
93
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
94
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
95
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
96
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
97
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
Plot's chart-specific pipeline stages + the `plotDef` value.
|
|
101
|
+
|
|
102
|
+
Each `formatPlotData` / `computePlotAxisValues` / `extendPlotOppScales`
|
|
103
|
+
/ `preparePlotAxisLayout` / `measurePlotLineLabels` /
|
|
104
|
+
`computePlotInitialDomains` / `computePlotScales` is a pure-ish
|
|
105
|
+
`TransformStage` that the Plot class threads through `runStages`. The
|
|
106
|
+
`plotDef` at the bottom is the ChartDefinition value Plot's subclasses
|
|
107
|
+
(BarChart / AreaPlot / LinePlot / etc.) inherit defaults + features
|
|
108
|
+
from.
|
|
109
|
+
*/ import { date } from "@d3plus/dom";
|
|
110
|
+
import { merge as d3plusMerge, unique } from "@d3plus/data";
|
|
111
|
+
import * as scales from "d3-scale";
|
|
112
|
+
import { deviation, extent, groups, max, mean, min, range, rollups } from "d3-array";
|
|
113
|
+
import discreteBufferFn from "../plotBuffers/discreteBuffer.js";
|
|
114
|
+
import constant from "../../utils/constant.js";
|
|
115
|
+
import { shapeConfigFor } from "../features/emitHelpers.js";
|
|
116
|
+
import { backFeature, subtitleFeature, titleFeature, totalFeature } from "../features/features.js";
|
|
117
|
+
/** d3-scale's scale constructors, indexed by the dynamic `scale<Type>` name. */ var scaleConstructors = scales;
|
|
118
|
+
export { computePlotInitialDomains } from "./pipelineDomains.js";
|
|
119
|
+
export { measurePlotLineLabels } from "./pipelineLineLabels.js";
|
|
120
|
+
var defaultChartFeatures = [
|
|
121
|
+
backFeature,
|
|
122
|
+
titleFeature,
|
|
123
|
+
subtitleFeature,
|
|
124
|
+
totalFeature
|
|
125
|
+
];
|
|
126
|
+
/**
|
|
127
|
+
`formatPlotData` — first stage of Plot's chart-specific pipeline. Detects
|
|
128
|
+
time axes (sets viz._xTime / _x2Time / _yTime / _y2Time), maps the
|
|
129
|
+
filtered data through `prepData` to produce the per-row PlotDatum shape
|
|
130
|
+
(x/y/x2/y2 + id + group + shape + lci/hci + discrete), and constructs
|
|
131
|
+
the `_sizeScaleD3` if `_size` is set.
|
|
132
|
+
|
|
133
|
+
Pure compute. Returns `{formattedData, axisData, x2Exists, y2Exists}`
|
|
134
|
+
for downstream stages + the paint phase. Side-effects on viz: stores
|
|
135
|
+
`_formattedData`, `_xTime`/`_x2Time`/`_yTime`/`_y2Time`, `_sizeScaleD3`.
|
|
136
|
+
*/ export var formatPlotData = function formatPlotData(param) {
|
|
137
|
+
var viz = param.viz;
|
|
138
|
+
if (!viz._filteredData || !viz._filteredData.length) {
|
|
139
|
+
return {
|
|
140
|
+
plotFormattedData: [],
|
|
141
|
+
plotAxisData: [],
|
|
142
|
+
x2Exists: false,
|
|
143
|
+
y2Exists: false
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
var firstElemTime = viz.schema.time ? viz.schema.time(viz._filteredData[0], 0) : false;
|
|
147
|
+
var x2Time = viz._x2Time = firstElemTime && viz._x2(viz._filteredData[0], 0) === firstElemTime;
|
|
148
|
+
var xTime = viz._xTime = firstElemTime && viz._x(viz._filteredData[0], 0) === firstElemTime;
|
|
149
|
+
var y2Time = viz._y2Time = firstElemTime && viz._y2(viz._filteredData[0], 0) === firstElemTime;
|
|
150
|
+
var yTime = viz._yTime = firstElemTime && viz._y(viz._filteredData[0], 0) === firstElemTime;
|
|
151
|
+
var timeAxis = xTime || x2Time || yTime || y2Time;
|
|
152
|
+
var stackGroup = function stackGroup(d, i) {
|
|
153
|
+
return "".concat(!timeAxis && viz.schema.time ? viz.schema.time(d, i) : "time", "_").concat(viz.schema.stacked ? "".concat(viz.schema.groupBy.length > 1 ? viz._ids(d, i).slice(0, -1).join("_") : "group") : "".concat(viz._ids(d, i).join("_")));
|
|
154
|
+
};
|
|
155
|
+
var prepData = function prepData(d, i) {
|
|
156
|
+
var newD = {
|
|
157
|
+
__d3plus__: true,
|
|
158
|
+
data: d,
|
|
159
|
+
group: stackGroup(d, i),
|
|
160
|
+
i: i,
|
|
161
|
+
hci: viz._confidence && viz._confidence[1] && viz._confidence[1](d, i),
|
|
162
|
+
id: viz._ids(d, i).slice(0, viz._drawDepth + 1).join("_"),
|
|
163
|
+
lci: viz._confidence && viz._confidence[0] && viz._confidence[0](d, i),
|
|
164
|
+
shape: viz.schema.shape(d, i),
|
|
165
|
+
x: xTime ? date(viz._x(d, i)) : viz._x(d, i),
|
|
166
|
+
x2: x2Time ? date(viz._x2(d, i)) : viz._x2(d, i),
|
|
167
|
+
y: yTime ? date(viz._y(d, i)) : viz._y(d, i),
|
|
168
|
+
y2: y2Time ? date(viz._y2(d, i)) : viz._y2(d, i)
|
|
169
|
+
};
|
|
170
|
+
newD.discrete = newD.shape === "Bar" ? "".concat(newD[viz.schema.discrete], "_").concat(newD.group) : "".concat(newD[viz.schema.discrete]);
|
|
171
|
+
newD.id = newD.shape === "Bar" ? "".concat(newD.id, "_").concat(newD[viz.schema.discrete]) : newD.id;
|
|
172
|
+
return newD;
|
|
173
|
+
};
|
|
174
|
+
var formattedData = viz._formattedData = viz._filteredData.map(prepData);
|
|
175
|
+
var axisData = viz._axisPersist ? viz._data.map(prepData) : formattedData;
|
|
176
|
+
if (viz._size) {
|
|
177
|
+
var rExtent = extent(axisData, function(d) {
|
|
178
|
+
return viz._size(d.data);
|
|
179
|
+
});
|
|
180
|
+
viz._sizeScaleD3 = scaleConstructors["scale".concat(viz.schema.sizeScale.charAt(0).toUpperCase()).concat(viz.schema.sizeScale.slice(1))]().domain(rExtent).range([
|
|
181
|
+
rExtent[0] === rExtent[1] ? viz.schema.sizeMax : min([
|
|
182
|
+
viz.schema.sizeMax / 2,
|
|
183
|
+
viz.schema.sizeMin
|
|
184
|
+
]),
|
|
185
|
+
viz.schema.sizeMax
|
|
186
|
+
]);
|
|
187
|
+
} else {
|
|
188
|
+
viz._sizeScaleD3 = function() {
|
|
189
|
+
return viz.schema.sizeMin;
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
var x2Exists = axisData.some(function(d) {
|
|
193
|
+
return d.x2 !== undefined;
|
|
194
|
+
});
|
|
195
|
+
var y2Exists = axisData.some(function(d) {
|
|
196
|
+
return d.y2 !== undefined;
|
|
197
|
+
});
|
|
198
|
+
return {
|
|
199
|
+
plotFormattedData: formattedData,
|
|
200
|
+
plotAxisData: axisData,
|
|
201
|
+
x2Exists: x2Exists,
|
|
202
|
+
y2Exists: y2Exists,
|
|
203
|
+
plotStackGroup: stackGroup
|
|
204
|
+
};
|
|
205
|
+
};
|
|
206
|
+
/**
|
|
207
|
+
`computePlotAxisValues` — second stage of Plot's pipeline. Given the
|
|
208
|
+
`plotFormattedData` + `plotAxisData` from `formatPlotData`, computes
|
|
209
|
+
the per-axis values arrays (`xData`/`x2Data`/`yData`/`y2Data`) used by
|
|
210
|
+
the domain/scale construction downstream.
|
|
211
|
+
|
|
212
|
+
Takes the axis name + the two data sources + the viz state and returns
|
|
213
|
+
the sorted/unique values for that axis.
|
|
214
|
+
*/ export var computePlotAxisValues = function computePlotAxisValues(param) {
|
|
215
|
+
var viz = param.viz, plotFormattedData = param.plotFormattedData, plotAxisData = param.plotAxisData;
|
|
216
|
+
var getAxisValues = function getAxisValues(axis) {
|
|
217
|
+
var timeData = viz["_".concat(axis, "Time")];
|
|
218
|
+
var localData = timeData ? data : axisData;
|
|
219
|
+
var filteredData = localData.filter(function(d) {
|
|
220
|
+
return ![
|
|
221
|
+
NaN,
|
|
222
|
+
undefined,
|
|
223
|
+
false
|
|
224
|
+
].includes(d[axis]);
|
|
225
|
+
});
|
|
226
|
+
if (!filteredData.length) return [];
|
|
227
|
+
var numericValue = typeof filteredData[0][axis] === "number";
|
|
228
|
+
var myData = viz.schema.discrete === axis ? rollups(filteredData, function(leaves) {
|
|
229
|
+
return leaves.length === 1 ? leaves[0].data : d3plusMerge(leaves.map(function(d) {
|
|
230
|
+
return d.data;
|
|
231
|
+
}), viz.schema.aggs);
|
|
232
|
+
}, function(d) {
|
|
233
|
+
return d[axis];
|
|
234
|
+
}).sort(function(a, b) {
|
|
235
|
+
if (viz.schema["".concat(axis, "Sort")]) return viz.schema["".concat(axis, "Sort")](a[1], b[1]);
|
|
236
|
+
var aKey = timeData || numericValue ? parseFloat(a[0]) : a[0];
|
|
237
|
+
var bKey = timeData || numericValue ? parseFloat(b[0]) : b[0];
|
|
238
|
+
return aKey - bKey;
|
|
239
|
+
}).map(function(param) {
|
|
240
|
+
var _param = _sliced_to_array(param, 1), key = _param[0];
|
|
241
|
+
return timeData ? date(key) : numericValue ? parseFloat(key) : key;
|
|
242
|
+
}) : unique(filteredData.sort(function(a, b) {
|
|
243
|
+
return viz.schema["".concat(axis, "Sort")] ? viz.schema["".concat(axis, "Sort")](a.data, b.data) : a[axis] - b[axis];
|
|
244
|
+
}).map(function(d) {
|
|
245
|
+
return d[axis];
|
|
246
|
+
}), function(d) {
|
|
247
|
+
return "".concat(d);
|
|
248
|
+
});
|
|
249
|
+
if (viz.schema.discrete !== axis.charAt(0) && viz._confidence) {
|
|
250
|
+
if (viz._confidence[0]) myData = myData.concat(localData.map(function(d) {
|
|
251
|
+
return d.lci;
|
|
252
|
+
}));
|
|
253
|
+
if (viz._confidence[1]) myData = myData.concat(localData.map(function(d) {
|
|
254
|
+
return d.hci;
|
|
255
|
+
}));
|
|
256
|
+
}
|
|
257
|
+
return myData;
|
|
258
|
+
};
|
|
259
|
+
var data = plotFormattedData || [];
|
|
260
|
+
var axisData = plotAxisData || [];
|
|
261
|
+
return {
|
|
262
|
+
xData: getAxisValues("x"),
|
|
263
|
+
x2Data: getAxisValues("x2"),
|
|
264
|
+
yData: getAxisValues("y"),
|
|
265
|
+
y2Data: getAxisValues("y2")
|
|
266
|
+
};
|
|
267
|
+
};
|
|
268
|
+
/**
|
|
269
|
+
`extendPlotOppScales` — sixth stage. After `computePlotScales` returns the
|
|
270
|
+
initial x/y/x2/y2 scales, the opposite-axis (non-discrete) scales need to
|
|
271
|
+
be extended by each shape type's buffer function (Bar/Box/Circle/Line/
|
|
272
|
+
etc. — `viz._buffer[key]`) to allocate room for the shapes' widths.
|
|
273
|
+
|
|
274
|
+
Reads `viz._buffer[shapeKey]({data, x, y, yScale, xScale, config, x2?,
|
|
275
|
+
y2?})` and chains the returned `[x, y]` (or `[x2, y2]`) back into the
|
|
276
|
+
scales. Also calls `discreteBuffer` for Bar/Box to round the discrete
|
|
277
|
+
scale to integer pixels.
|
|
278
|
+
|
|
279
|
+
Returns the extended scales. Side-effect-free on viz (only on the scale
|
|
280
|
+
instances, which are passed through the context).
|
|
281
|
+
*/ export var extendPlotOppScales = function extendPlotOppScales(param) {
|
|
282
|
+
var viz = param.viz, plotFormattedData = param.plotFormattedData, plotAxisData = param.plotAxisData, plotScales = param.plotScales, plotConfigScales = param.plotConfigScales;
|
|
283
|
+
var data = plotFormattedData || [];
|
|
284
|
+
var axisData = plotAxisData || [];
|
|
285
|
+
var x = plotScales.x, y = plotScales.y, x2 = plotScales.x2, y2 = plotScales.y2;
|
|
286
|
+
var xConfigScale = plotConfigScales.xConfigScale, yConfigScale = plotConfigScales.yConfigScale, x2ConfigScale = plotConfigScales.x2ConfigScale, y2ConfigScale = plotConfigScales.y2ConfigScale;
|
|
287
|
+
var xScale = plotScales.xScale, yScale = plotScales.yScale;
|
|
288
|
+
var oppScale = viz.schema.discrete === "x" ? yScale : xScale;
|
|
289
|
+
if (oppScale !== "Point") {
|
|
290
|
+
var allShapeData = groups(axisData, function(d) {
|
|
291
|
+
return d.shape;
|
|
292
|
+
});
|
|
293
|
+
allShapeData.forEach(function(param) {
|
|
294
|
+
var _param = _sliced_to_array(param, 2), key = _param[0], values = _param[1];
|
|
295
|
+
if ([
|
|
296
|
+
"Bar",
|
|
297
|
+
"Box"
|
|
298
|
+
].includes(key)) {
|
|
299
|
+
discreteBufferFn(viz.schema.discrete === "x" ? x : y, data, viz.schema.discrete);
|
|
300
|
+
}
|
|
301
|
+
if (viz._buffer[key]) {
|
|
302
|
+
var res = viz._buffer[key].bind(viz)({
|
|
303
|
+
data: values,
|
|
304
|
+
x: x,
|
|
305
|
+
y: y,
|
|
306
|
+
yScale: yConfigScale,
|
|
307
|
+
xScale: xConfigScale,
|
|
308
|
+
config: viz.schema.shapeConfig[key]
|
|
309
|
+
});
|
|
310
|
+
x = res[0];
|
|
311
|
+
y = res[1];
|
|
312
|
+
var res2 = viz._buffer[key].bind(viz)({
|
|
313
|
+
data: values,
|
|
314
|
+
x: x2,
|
|
315
|
+
y: y2,
|
|
316
|
+
yScale: y2ConfigScale,
|
|
317
|
+
xScale: x2ConfigScale,
|
|
318
|
+
x2: true,
|
|
319
|
+
y2: true,
|
|
320
|
+
config: viz.schema.shapeConfig[key]
|
|
321
|
+
});
|
|
322
|
+
x2 = res2[0];
|
|
323
|
+
y2 = res2[1];
|
|
324
|
+
}
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
return {
|
|
328
|
+
plotScales: _object_spread_props(_object_spread({}, plotScales), {
|
|
329
|
+
x: x,
|
|
330
|
+
y: y,
|
|
331
|
+
x2: x2,
|
|
332
|
+
y2: y2
|
|
333
|
+
})
|
|
334
|
+
};
|
|
335
|
+
};
|
|
336
|
+
/**
|
|
337
|
+
`preparePlotAxisLayout` — final pre-paint stage. Reads the constructed
|
|
338
|
+
scales and computes the per-axis display config the four axis
|
|
339
|
+
`.measure()` + `.render()` calls in Plot._draw need:
|
|
340
|
+
- `defaultConfig`/`defaultX2Config`/`defaultY2Config`
|
|
341
|
+
- `showX`/`showY` (cutoff predicates)
|
|
342
|
+
- `yC` (base y-axis config, including no-x-axis layout adjustments)
|
|
343
|
+
- `barLabels` (used to suppress redundant ticks)
|
|
344
|
+
- `xTicks`/`yTicks`/`x2Ticks`/`y2Ticks` (null when ticks should display,
|
|
345
|
+
empty array when ticks are redundant with bar labels)
|
|
346
|
+
|
|
347
|
+
Pure compute. No DOM, no side effects on viz.
|
|
348
|
+
*/ export var preparePlotAxisLayout = function preparePlotAxisLayout(param) {
|
|
349
|
+
var viz = param.viz, plotAxisData = param.plotAxisData, plotScales = param.plotScales, x2Exists = param.x2Exists, y2Exists = param.y2Exists, x2Data = param.x2Data, y2Data = param.y2Data, yData = param.yData;
|
|
350
|
+
var axisData = plotAxisData || [];
|
|
351
|
+
var x = plotScales.x, y = plotScales.y, x2 = plotScales.x2, y2 = plotScales.y2, xScale = plotScales.xScale, yScale = plotScales.yScale, x2Scale = plotScales.x2Scale, y2Scale = plotScales.y2Scale;
|
|
352
|
+
var xDomain = x.domain();
|
|
353
|
+
var x2Domain = x2.domain();
|
|
354
|
+
var yDomain = y.domain();
|
|
355
|
+
var y2Domain = y2.domain();
|
|
356
|
+
var defaultConfig = {
|
|
357
|
+
barConfig: {
|
|
358
|
+
"stroke-width": 0
|
|
359
|
+
},
|
|
360
|
+
gridSize: 0,
|
|
361
|
+
labels: [],
|
|
362
|
+
title: false,
|
|
363
|
+
tickSize: 0
|
|
364
|
+
};
|
|
365
|
+
var defaultX2Config = x2Exists ? {
|
|
366
|
+
data: x2Data
|
|
367
|
+
} : defaultConfig;
|
|
368
|
+
var defaultY2Config = y2Exists ? {
|
|
369
|
+
data: y2Data
|
|
370
|
+
} : defaultConfig;
|
|
371
|
+
var showX = viz.schema.discrete === "x" ? viz.schema.width > viz._discreteCutoff && viz.schema.width > viz.schema.xCutoff : viz.schema.width > viz.schema.xCutoff;
|
|
372
|
+
var showY = viz.schema.discrete === "y" ? viz.schema.height > viz._discreteCutoff && viz.schema.height > viz.schema.yCutoff : viz.schema.height > viz.schema.yCutoff;
|
|
373
|
+
var yC = {
|
|
374
|
+
data: yData,
|
|
375
|
+
locale: viz.schema.locale,
|
|
376
|
+
rounding: viz.schema.yDomain ? "none" : "outside",
|
|
377
|
+
scalePadding: y.padding ? y.padding() : 0
|
|
378
|
+
};
|
|
379
|
+
if (!showX && showY) {
|
|
380
|
+
yC.barConfig = {
|
|
381
|
+
stroke: "transparent"
|
|
382
|
+
};
|
|
383
|
+
yC.tickSize = 0;
|
|
384
|
+
yC.shapeConfig = {
|
|
385
|
+
labelBounds: function labelBounds(d, i) {
|
|
386
|
+
var _d_labelBounds = d.labelBounds, w = _d_labelBounds.width, yy = _d_labelBounds.y;
|
|
387
|
+
var h = viz.schema.height / 2;
|
|
388
|
+
var xx = i ? -h : 0;
|
|
389
|
+
return {
|
|
390
|
+
x: xx,
|
|
391
|
+
y: yy,
|
|
392
|
+
width: w,
|
|
393
|
+
height: h
|
|
394
|
+
};
|
|
395
|
+
},
|
|
396
|
+
labelConfig: {
|
|
397
|
+
padding: 0,
|
|
398
|
+
rotate: 0
|
|
399
|
+
},
|
|
400
|
+
labelRotation: false
|
|
401
|
+
};
|
|
402
|
+
}
|
|
403
|
+
// Bar labels — used to suppress redundant axis ticks.
|
|
404
|
+
var barConfig = shapeConfigFor(viz, "Bar");
|
|
405
|
+
var barLabelFunction = barConfig.label !== undefined ? typeof barConfig.label === "function" ? barConfig.label : function() {
|
|
406
|
+
return barConfig.label;
|
|
407
|
+
} : viz._drawLabel;
|
|
408
|
+
var barLabels = axisData.map(function(d) {
|
|
409
|
+
return barLabelFunction(d.data, d.i);
|
|
410
|
+
}).filter(function(d) {
|
|
411
|
+
return typeof d === "number" || d;
|
|
412
|
+
}).map(String);
|
|
413
|
+
var tickFor = function tickFor(axis, axisScale) {
|
|
414
|
+
var ticks = unique(axisData.map(function(d) {
|
|
415
|
+
return d[axis];
|
|
416
|
+
}));
|
|
417
|
+
return axisScale === "Point" && ticks.every(function(t) {
|
|
418
|
+
return barLabels.includes("".concat(t));
|
|
419
|
+
}) ? [] : null;
|
|
420
|
+
};
|
|
421
|
+
return {
|
|
422
|
+
plotDefaultConfig: defaultConfig,
|
|
423
|
+
plotDefaultX2Config: defaultX2Config,
|
|
424
|
+
plotDefaultY2Config: defaultY2Config,
|
|
425
|
+
plotShowX: showX,
|
|
426
|
+
plotShowY: showY,
|
|
427
|
+
plotYC: yC,
|
|
428
|
+
plotBarLabels: barLabels,
|
|
429
|
+
plotXTicks: tickFor("x", xScale),
|
|
430
|
+
plotX2Ticks: tickFor("x2", x2Scale),
|
|
431
|
+
plotYTicks: tickFor("y", yScale),
|
|
432
|
+
plotY2Ticks: tickFor("y2", y2Scale),
|
|
433
|
+
plotXDomain: xDomain,
|
|
434
|
+
plotX2Domain: x2Domain,
|
|
435
|
+
plotYDomain: yDomain,
|
|
436
|
+
plotY2Domain: y2Domain
|
|
437
|
+
};
|
|
438
|
+
};
|
|
439
|
+
/**
|
|
440
|
+
`computePlotScales` — fourth stage of Plot's pipeline. Takes the per-axis
|
|
441
|
+
values + the chart's raw `domains` object (computed by the inline
|
|
442
|
+
stacking/non-stacking branch) and produces the four configured d3 scale
|
|
443
|
+
instances (`x`/`x2`/`y`/`y2`), the resolved scale-type strings
|
|
444
|
+
(`xConfigScale` etc., returned in `plotConfigScales`), and the final
|
|
445
|
+
`domains` after log/baseline adjustments.
|
|
446
|
+
|
|
447
|
+
The "initial domains" computation (stacked vs non-stacked branch that
|
|
448
|
+
fills `domains.x`, `domains.y`, etc. from data) is inline in
|
|
449
|
+
`Plot._draw` — extracting that requires untangling array sorts that
|
|
450
|
+
mutate `axisData` in place, which is the natural next step.
|
|
451
|
+
*/ export var computePlotScales = function computePlotScales(param) {
|
|
452
|
+
var viz = param.viz, plotFormattedData = param.plotFormattedData, plotAxisData = param.plotAxisData, plotInitialDomains = param.plotInitialDomains;
|
|
453
|
+
var domainScaleSetup = function domainScaleSetup(axis) {
|
|
454
|
+
var scale = viz["_".concat(axis, "Time")] ? "Time" : viz.schema.discrete === axis || viz.schema["".concat(axis, "Sort")] ? "Point" : "Linear";
|
|
455
|
+
var domain = viz.schema["".concat(axis, "Domain")] ? viz.schema["".concat(axis, "Domain")].slice() : domains[axis], domain2 = viz.schema["".concat(axis, "2Domain")] ? viz.schema["".concat(axis, "2Domain")].slice() : domains["".concat(axis, "2")];
|
|
456
|
+
if (scale !== "Point") {
|
|
457
|
+
if (domain && domain[0] === void 0) domain[0] = domains[axis][0];
|
|
458
|
+
if (domain && domain[1] === void 0) domain[1] = domains[axis][1];
|
|
459
|
+
if (domain2 && domain2[0] === void 0) domain2[0] = domains["".concat(axis, "2")][0];
|
|
460
|
+
if (domain2 && domain2[1] === void 0) domain2[1] = domains["".concat(axis, "2")][1];
|
|
461
|
+
}
|
|
462
|
+
return [
|
|
463
|
+
domain,
|
|
464
|
+
scale,
|
|
465
|
+
domain2,
|
|
466
|
+
scale
|
|
467
|
+
];
|
|
468
|
+
};
|
|
469
|
+
var data = plotFormattedData || [];
|
|
470
|
+
var axisData = plotAxisData || [];
|
|
471
|
+
var domains = plotInitialDomains;
|
|
472
|
+
var width = viz.schema.width - viz._margin.left - viz._margin.right;
|
|
473
|
+
var height = viz.schema.height - viz._margin.top - viz._margin.bottom;
|
|
474
|
+
var opp = viz.schema.discrete ? viz.schema.discrete === "x" ? "y" : "x" : undefined;
|
|
475
|
+
var opp2 = viz.schema.discrete ? viz.schema.discrete === "x" ? "y2" : "x2" : undefined;
|
|
476
|
+
var opps = [
|
|
477
|
+
opp,
|
|
478
|
+
opp2
|
|
479
|
+
].filter(function(d) {
|
|
480
|
+
return d;
|
|
481
|
+
});
|
|
482
|
+
var _domainScaleSetup = _sliced_to_array(domainScaleSetup("x"), 4), xAutoDomain = _domainScaleSetup[0], xScale = _domainScaleSetup[1], x2AutoDomain = _domainScaleSetup[2], x2Scale = _domainScaleSetup[3];
|
|
483
|
+
var _domainScaleSetup1 = _sliced_to_array(domainScaleSetup("y"), 4), yAutoDomain = _domainScaleSetup1[0], yScale = _domainScaleSetup1[1], y2AutoDomain = _domainScaleSetup1[2], y2Scale = _domainScaleSetup1[3];
|
|
484
|
+
var autoScale = function autoScale(axis, fallback) {
|
|
485
|
+
var userScale = viz["_".concat(axis, "Config")].scale;
|
|
486
|
+
if (userScale === "auto") {
|
|
487
|
+
if (viz.schema.discrete === axis) return fallback;
|
|
488
|
+
var values = axisData.map(function(d) {
|
|
489
|
+
return d[axis];
|
|
490
|
+
});
|
|
491
|
+
return deviation(values) / mean(values) > 3 ? "log" : "linear";
|
|
492
|
+
}
|
|
493
|
+
return userScale || fallback;
|
|
494
|
+
};
|
|
495
|
+
var yConfigScale = autoScale("y", yScale).toLowerCase();
|
|
496
|
+
var y2ConfigScale = autoScale("y2", y2Scale).toLowerCase();
|
|
497
|
+
var xConfigScale = autoScale("x", xScale).toLowerCase();
|
|
498
|
+
var x2ConfigScale = autoScale("x2", x2Scale).toLowerCase();
|
|
499
|
+
// `.slice()` the fallback so domains.x2 isn't ALIASED to domains.x
|
|
500
|
+
// (and same for y2 ↔ y). Without the slice, later in this function
|
|
501
|
+
// the baseline-extension loop does `domains[o][0] = b` — when `o`
|
|
502
|
+
// is 'y2' aliased to y, that mutation hits domains.y too, silently
|
|
503
|
+
// clobbering the y-axis bottom. Sibling of the d.reverse() fix.
|
|
504
|
+
domains = {
|
|
505
|
+
x: xAutoDomain,
|
|
506
|
+
x2: x2AutoDomain || xAutoDomain.slice(),
|
|
507
|
+
y: yAutoDomain,
|
|
508
|
+
y2: y2AutoDomain || yAutoDomain.slice()
|
|
509
|
+
};
|
|
510
|
+
Object.keys(domains).forEach(function(axis) {
|
|
511
|
+
if (viz["_".concat(axis, "ConfigScale")] === "log" && domains[axis].includes(0)) {
|
|
512
|
+
if (min(domains[axis]) < 0) domains[axis][1] = max(data.map(function(d) {
|
|
513
|
+
return d[axis];
|
|
514
|
+
}).filter(function(d) {
|
|
515
|
+
return ![
|
|
516
|
+
NaN,
|
|
517
|
+
undefined,
|
|
518
|
+
false
|
|
519
|
+
].includes(d);
|
|
520
|
+
}));
|
|
521
|
+
else domains[axis][0] = min(axisData.map(function(d) {
|
|
522
|
+
return d[axis];
|
|
523
|
+
}).filter(function(d) {
|
|
524
|
+
return ![
|
|
525
|
+
NaN,
|
|
526
|
+
undefined,
|
|
527
|
+
false
|
|
528
|
+
].includes(d);
|
|
529
|
+
}));
|
|
530
|
+
}
|
|
531
|
+
});
|
|
532
|
+
opps.forEach(function(o) {
|
|
533
|
+
if (viz["_".concat(o, "Config")].domain) {
|
|
534
|
+
// `.slice()` first so we never mutate the user's config array in
|
|
535
|
+
// place — on the next render the (already-reversed) array would
|
|
536
|
+
// reverse back, alternating chart correctness across renders.
|
|
537
|
+
var d = viz["_".concat(o, "Config")].domain.slice();
|
|
538
|
+
if (viz.schema.discrete === "x") d.reverse();
|
|
539
|
+
domains[o] = d;
|
|
540
|
+
} else if (o && viz.schema.baseline !== void 0) {
|
|
541
|
+
var b = viz.schema.baseline;
|
|
542
|
+
if (domains[o] && domains[o][0] > b) domains[o][0] = b;
|
|
543
|
+
else if (domains[o] && domains[o][1] < b) domains[o][1] = b;
|
|
544
|
+
}
|
|
545
|
+
});
|
|
546
|
+
var x = scaleConstructors["scale".concat(xScale)]().domain(domains.x).range(range(0, width + 1, width / (domains.x.length - 1)));
|
|
547
|
+
var x2 = scaleConstructors["scale".concat(x2Scale)]().domain(domains.x2).range(range(0, width + 1, width / (domains.x2.length - 1)));
|
|
548
|
+
// `.slice().reverse()` so the domain object isn't mutated under us if
|
|
549
|
+
// it came from user config (covered by the slice above) OR from
|
|
550
|
+
// domains.y being aliased into the user config via the slice above.
|
|
551
|
+
var y = scaleConstructors["scale".concat(yScale)]().domain(domains.y.slice().reverse()).range(range(0, height + 1, height / (domains.y.length - 1)));
|
|
552
|
+
var y2 = scaleConstructors["scale".concat(y2Scale)]().domain(domains.y2.slice().reverse()).range(range(0, height + 1, height / (domains.y2.length - 1)));
|
|
553
|
+
return {
|
|
554
|
+
plotDomains: domains,
|
|
555
|
+
plotScales: {
|
|
556
|
+
x: x,
|
|
557
|
+
y: y,
|
|
558
|
+
x2: x2,
|
|
559
|
+
y2: y2,
|
|
560
|
+
xScale: xScale,
|
|
561
|
+
yScale: yScale,
|
|
562
|
+
x2Scale: x2Scale,
|
|
563
|
+
y2Scale: y2Scale
|
|
564
|
+
},
|
|
565
|
+
plotConfigScales: {
|
|
566
|
+
xConfigScale: xConfigScale,
|
|
567
|
+
yConfigScale: yConfigScale,
|
|
568
|
+
x2ConfigScale: x2ConfigScale,
|
|
569
|
+
y2ConfigScale: y2ConfigScale
|
|
570
|
+
},
|
|
571
|
+
plotOpps: {
|
|
572
|
+
opp: opp,
|
|
573
|
+
opp2: opp2,
|
|
574
|
+
opps: opps
|
|
575
|
+
}
|
|
576
|
+
};
|
|
577
|
+
};
|
|
578
|
+
export var plotDef = {
|
|
579
|
+
name: "Plot",
|
|
580
|
+
defaults: {
|
|
581
|
+
annotations: [],
|
|
582
|
+
axisPersist: false,
|
|
583
|
+
barPadding: 0,
|
|
584
|
+
discreteCutoff: 100,
|
|
585
|
+
groupPadding: 5,
|
|
586
|
+
lineMarkers: false,
|
|
587
|
+
shape: constant("Circle")
|
|
588
|
+
},
|
|
589
|
+
features: defaultChartFeatures,
|
|
590
|
+
// Plot._paint populates `viz._chartScene` from `plotPaint`; no emit step.
|
|
591
|
+
paintDriven: true
|
|
592
|
+
};
|
|
593
|
+
|
|
594
|
+
//# sourceMappingURL=pipeline.js.map
|