@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,3 +1,11 @@
|
|
|
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
|
+
}
|
|
1
9
|
function _assert_this_initialized(self) {
|
|
2
10
|
if (self === void 0) {
|
|
3
11
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
@@ -59,6 +67,48 @@ function _inherits(subClass, superClass) {
|
|
|
59
67
|
});
|
|
60
68
|
if (superClass) _set_prototype_of(subClass, superClass);
|
|
61
69
|
}
|
|
70
|
+
function _iterable_to_array_limit(arr, i) {
|
|
71
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
72
|
+
if (_i == null) return;
|
|
73
|
+
var _arr = [];
|
|
74
|
+
var _n = true;
|
|
75
|
+
var _d = false;
|
|
76
|
+
var _s, _e;
|
|
77
|
+
try {
|
|
78
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
79
|
+
_arr.push(_s.value);
|
|
80
|
+
if (i && _arr.length === i) break;
|
|
81
|
+
}
|
|
82
|
+
} catch (err) {
|
|
83
|
+
_d = true;
|
|
84
|
+
_e = err;
|
|
85
|
+
} finally{
|
|
86
|
+
try {
|
|
87
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
88
|
+
} finally{
|
|
89
|
+
if (_d) throw _e;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return _arr;
|
|
93
|
+
}
|
|
94
|
+
function _non_iterable_rest() {
|
|
95
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
96
|
+
}
|
|
97
|
+
function _object_spread(target) {
|
|
98
|
+
for(var i = 1; i < arguments.length; i++){
|
|
99
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
100
|
+
var ownKeys = Object.keys(source);
|
|
101
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
102
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
103
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
104
|
+
}));
|
|
105
|
+
}
|
|
106
|
+
ownKeys.forEach(function(key) {
|
|
107
|
+
_define_property(target, key, source[key]);
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
return target;
|
|
111
|
+
}
|
|
62
112
|
function _possible_constructor_return(self, call) {
|
|
63
113
|
if (call && (_type_of(call) === "object" || typeof call === "function")) {
|
|
64
114
|
return call;
|
|
@@ -72,10 +122,21 @@ function _set_prototype_of(o, p) {
|
|
|
72
122
|
};
|
|
73
123
|
return _set_prototype_of(o, p);
|
|
74
124
|
}
|
|
125
|
+
function _sliced_to_array(arr, i) {
|
|
126
|
+
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
127
|
+
}
|
|
75
128
|
function _type_of(obj) {
|
|
76
129
|
"@swc/helpers - typeof";
|
|
77
130
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
78
131
|
}
|
|
132
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
133
|
+
if (!o) return;
|
|
134
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
135
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
136
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
137
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
138
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
139
|
+
}
|
|
79
140
|
function _is_native_reflect_construct() {
|
|
80
141
|
try {
|
|
81
142
|
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
@@ -86,458 +147,625 @@ function _is_native_reflect_construct() {
|
|
|
86
147
|
}
|
|
87
148
|
import { max, min, sum } from "d3-array";
|
|
88
149
|
import { select } from "d3-selection";
|
|
89
|
-
// side-effect import: registers .transition() on d3 selections
|
|
90
|
-
import "d3-transition";
|
|
91
150
|
import { fontExists, parseSides, rtl as detectRTL, textWidth } from "@d3plus/dom";
|
|
92
151
|
import { fontFamily, strip, textSplit, textWrap } from "@d3plus/text";
|
|
152
|
+
import { SvgRenderer } from "@d3plus/render";
|
|
93
153
|
import { accessor, BaseClass, constant } from "../utils/index.js";
|
|
154
|
+
import { installFluent } from "../fluent.js";
|
|
94
155
|
var defaultHtmlLookup = {
|
|
95
156
|
i: "font-style: italic;",
|
|
96
157
|
em: "font-style: italic;",
|
|
97
158
|
b: "font-weight: bold;",
|
|
98
159
|
strong: "font-weight: bold;"
|
|
99
160
|
};
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
161
|
+
/** Parses a "style: foo; …" string from defaultHtmlLookup into TextRun style. */ function parseStyleString(styleStr) {
|
|
162
|
+
var out = {};
|
|
163
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
164
|
+
try {
|
|
165
|
+
for(var _iterator = styleStr.split(";")[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
166
|
+
var decl = _step.value;
|
|
167
|
+
var _decl_split_map = _sliced_to_array(decl.split(":").map(function(s) {
|
|
168
|
+
return s.trim();
|
|
169
|
+
}), 2), k = _decl_split_map[0], v = _decl_split_map[1];
|
|
170
|
+
if (!k || !v) continue;
|
|
171
|
+
if (k === "font-weight") out.weight = /^\d+$/.test(v) ? Number(v) : v;
|
|
172
|
+
else if (k === "font-style") out.style = v === "italic" ? "italic" : "normal";
|
|
173
|
+
}
|
|
174
|
+
} catch (err) {
|
|
175
|
+
_didIteratorError = true;
|
|
176
|
+
_iteratorError = err;
|
|
177
|
+
} finally{
|
|
178
|
+
try {
|
|
179
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
180
|
+
_iterator.return();
|
|
181
|
+
}
|
|
182
|
+
} finally{
|
|
183
|
+
if (_didIteratorError) {
|
|
184
|
+
throw _iteratorError;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
return out.weight === undefined && out.style === undefined ? undefined : out;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
Walks one wrapped line, applies the regex cleanup (closing dangling
|
|
192
|
+
open tags, opening trailing closing tags), then splits it into runs by the
|
|
193
|
+
configured htmlLookup. Returns the new openTag state for the next line so a
|
|
194
|
+
multi-line bold/italic continues to style subsequent lines.
|
|
195
|
+
*/ function lineToRuns(raw, htmlLookup, openTag) {
|
|
196
|
+
// textContent escaping: keep entity escaping in sync with render()
|
|
197
|
+
// so SVG output stays identical.
|
|
198
|
+
var cleaned = raw.trimEnd().replace(/&([^;&]*)/g, function(str, a) {
|
|
199
|
+
return a === "amp" ? str : "&".concat(a);
|
|
200
|
+
}).replace(/<([^A-z^/]+)/g, function(_str, a) {
|
|
201
|
+
return "<".concat(a);
|
|
202
|
+
}).replace(/<$/g, "<").replace(/(<[^>^/]+>)([^<^>]+)$/g, function(_str, a, b) {
|
|
203
|
+
return "".concat(a).concat(b).concat(a.replace("<", "</"));
|
|
204
|
+
}).replace(/^([^<^>]+)(<\/[^>]+>)/g, function(_str, a, b) {
|
|
205
|
+
return "".concat(b.replace("</", "<")).concat(a).concat(b);
|
|
206
|
+
});
|
|
207
|
+
// If we're already inside an open tag from a previous line, prefix this
|
|
208
|
+
// line with the opening tag so the same tag closes within the line.
|
|
209
|
+
var nextOpenTag = openTag;
|
|
210
|
+
if (nextOpenTag && !cleaned.startsWith("<")) {
|
|
211
|
+
cleaned = "<".concat(nextOpenTag, ">").concat(cleaned);
|
|
212
|
+
if (!cleaned.includes("</".concat(nextOpenTag, ">"))) cleaned += "</".concat(nextOpenTag, ">");
|
|
213
|
+
}
|
|
214
|
+
var tagRegex = /<([A-z]+)[^>]*>([^<^>]+)<\/[^>]+>/g;
|
|
215
|
+
var runs = [];
|
|
216
|
+
var lastIndex = 0;
|
|
217
|
+
var m;
|
|
218
|
+
while((m = tagRegex.exec(cleaned)) !== null){
|
|
219
|
+
if (m.index > lastIndex) runs.push({
|
|
220
|
+
text: cleaned.slice(lastIndex, m.index)
|
|
221
|
+
});
|
|
222
|
+
var tag = m[1];
|
|
223
|
+
var inner = m[2];
|
|
224
|
+
var styleStr = htmlLookup[tag];
|
|
225
|
+
if (styleStr) {
|
|
226
|
+
// If the original raw line contains a closing tag, the tag has terminated.
|
|
227
|
+
if (raw.includes("</".concat(tag, ">"))) nextOpenTag = false;
|
|
228
|
+
else nextOpenTag = tag;
|
|
229
|
+
runs.push({
|
|
230
|
+
text: inner,
|
|
231
|
+
style: parseStyleString(styleStr)
|
|
232
|
+
});
|
|
233
|
+
} else {
|
|
234
|
+
runs.push({
|
|
235
|
+
text: inner
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
lastIndex = m.index + m[0].length;
|
|
239
|
+
}
|
|
240
|
+
if (lastIndex < cleaned.length) runs.push({
|
|
241
|
+
text: cleaned.slice(lastIndex)
|
|
242
|
+
});
|
|
243
|
+
// If the raw line never opened a tag but we already had openTag set, the
|
|
244
|
+
// line is fully inside that tag — wrap it.
|
|
245
|
+
if (!runs.length && cleaned) runs.push({
|
|
246
|
+
text: cleaned
|
|
247
|
+
});
|
|
248
|
+
return {
|
|
249
|
+
runs: runs,
|
|
250
|
+
openTag: nextOpenTag
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
/** Builds the per-line LineRun arrays from wrapped lines, carrying open-tag state. */ function buildLineRuns(box, lineData) {
|
|
254
|
+
var lineRuns = null;
|
|
255
|
+
if (box.schema.html) {
|
|
256
|
+
var lookup = box.schema.html;
|
|
257
|
+
var openTag = false;
|
|
258
|
+
var out = [];
|
|
259
|
+
var hasStyle = false;
|
|
260
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
261
|
+
try {
|
|
262
|
+
for(var _iterator = lineData[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
263
|
+
var ln = _step.value;
|
|
264
|
+
var _lineToRuns = lineToRuns(ln, lookup, openTag), runs = _lineToRuns.runs, next = _lineToRuns.openTag;
|
|
265
|
+
out.push(runs);
|
|
266
|
+
openTag = next;
|
|
267
|
+
if (runs.some(function(r) {
|
|
268
|
+
return r.style;
|
|
269
|
+
})) hasStyle = true;
|
|
270
|
+
}
|
|
271
|
+
} catch (err) {
|
|
272
|
+
_didIteratorError = true;
|
|
273
|
+
_iteratorError = err;
|
|
274
|
+
} finally{
|
|
275
|
+
try {
|
|
276
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
277
|
+
_iterator.return();
|
|
278
|
+
}
|
|
279
|
+
} finally{
|
|
280
|
+
if (_didIteratorError) {
|
|
281
|
+
throw _iteratorError;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
// Only emit runs when at least one line carries a style; otherwise
|
|
286
|
+
// leave runs unset so the renderer emits a single text node.
|
|
287
|
+
if (hasStyle) lineRuns = out;
|
|
288
|
+
}
|
|
289
|
+
return lineRuns;
|
|
290
|
+
}
|
|
291
|
+
/** Pre-scales the font size to fit the box area before wrapping (resize mode). */ function resizeFontSize(fS, w, h, lH, words, style) {
|
|
292
|
+
var sizes = textWidth(words, style);
|
|
293
|
+
var areaMod = 1.165 + w / h * 0.1, boxArea = w * h, maxWidth = max(sizes), textArea = sum(sizes, function(d) {
|
|
294
|
+
return d * lH;
|
|
295
|
+
}) * areaMod;
|
|
296
|
+
if (maxWidth > w || textArea > boxArea) {
|
|
297
|
+
var areaRatio = Math.sqrt(boxArea / textArea), widthRatio = w / maxWidth;
|
|
298
|
+
var sizeRatio = min([
|
|
299
|
+
areaRatio,
|
|
300
|
+
widthRatio
|
|
301
|
+
]);
|
|
302
|
+
fS = Math.floor(fS * sizeRatio);
|
|
303
|
+
}
|
|
304
|
+
var heightMax = Math.floor(h * 0.8);
|
|
305
|
+
if (fS > heightMax) fS = heightMax;
|
|
306
|
+
return fS;
|
|
307
|
+
}
|
|
308
|
+
/** Assembles the final TextBoxDatum from the resolved layout values. */ function assembleTextBoxDatum(box, d, i, layout) {
|
|
309
|
+
var lineData = layout.lineData, line = layout.line, fS = layout.fS, lH = layout.lH, w = layout.w, h = layout.h, vA = layout.vA, style = layout.style, widths = layout.widths, padding = layout.padding;
|
|
310
|
+
var tH = line * lH;
|
|
311
|
+
var r = box.schema.rotate(d, i);
|
|
312
|
+
var yP = r === 0 ? vA === "top" ? 0 : vA === "middle" ? h / 2 - tH / 2 : h - tH : 0;
|
|
313
|
+
yP -= lH * 0.1;
|
|
314
|
+
// Pre-compute per-line runs from HTML markup, carrying open-tag state
|
|
315
|
+
// across lines so a multi-line <b> continues to bold subsequent lines.
|
|
316
|
+
var lineRuns = buildLineRuns(box, lineData);
|
|
317
|
+
return {
|
|
318
|
+
aH: box.schema.ariaHidden(d, i),
|
|
319
|
+
data: d,
|
|
320
|
+
i: i,
|
|
321
|
+
lines: lineData,
|
|
322
|
+
lineRuns: lineRuns,
|
|
323
|
+
fC: box.schema.fontColor(d, i),
|
|
324
|
+
fStroke: box.schema.fontStroke(d, i),
|
|
325
|
+
fSW: box.schema.fontStrokeWidth(d, i),
|
|
326
|
+
fF: style["font-family"],
|
|
327
|
+
fO: box.schema.fontOpacity(d, i),
|
|
328
|
+
fW: style["font-weight"],
|
|
329
|
+
id: box.schema.id(d, i),
|
|
330
|
+
pE: box.schema.pointerEvents(d, i),
|
|
331
|
+
tA: box.schema.textAnchor(d, i),
|
|
332
|
+
vA: box.schema.verticalAlign(d, i),
|
|
333
|
+
widths: widths,
|
|
334
|
+
fS: fS,
|
|
335
|
+
lH: lH,
|
|
336
|
+
w: w,
|
|
337
|
+
h: h,
|
|
338
|
+
r: r,
|
|
339
|
+
x: box.schema.x(d, i) + padding.left,
|
|
340
|
+
y: box.schema.y(d, i) + yP + padding.top
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
Computes the laid-out text box for a single data point, or null when the
|
|
345
|
+
text is undefined or wraps to no visible lines.
|
|
346
|
+
*/ function computeTextBoxDatum(box, d, i) {
|
|
347
|
+
var that = box;
|
|
348
|
+
var t = box.schema.text(d, i);
|
|
349
|
+
if (t === void 0) return null;
|
|
350
|
+
t = "".concat(t).trim();
|
|
351
|
+
var resize = box.schema.fontResize(d, i);
|
|
352
|
+
var lHRatio = box.schema.lineHeight(d, i) / box.schema.fontSize(d, i);
|
|
353
|
+
var fS = resize ? box.schema.fontMax(d, i) : box.schema.fontSize(d, i), lH = resize ? fS * lHRatio : box.schema.lineHeight(d, i), line = 1, lineData = [], wrapResults = {
|
|
354
|
+
lines: [],
|
|
355
|
+
truncated: false,
|
|
356
|
+
widths: []
|
|
357
|
+
};
|
|
358
|
+
var style = {
|
|
359
|
+
"font-family": fontExists(box.schema.fontFamily(d, i)),
|
|
360
|
+
"font-size": fS,
|
|
361
|
+
"font-weight": box.schema.fontWeight(d, i),
|
|
362
|
+
"line-height": lH
|
|
363
|
+
};
|
|
364
|
+
var padding = parseSides(box.schema.padding(d, i));
|
|
365
|
+
var h = box.schema.height(d, i) - (padding.top + padding.bottom), w = box.schema.width(d, i) - (padding.left + padding.right);
|
|
366
|
+
var wrapper = textWrap().fontFamily(style["font-family"]).fontSize(fS).fontWeight(style["font-weight"]).lineHeight(lH).maxLines(box.schema.maxLines(d, i)).height(h).overflow(box.schema.overflow(d, i)).width(w).split(box.schema.split);
|
|
367
|
+
var fMax = box.schema.fontMax(d, i), fMin = box.schema.fontMin(d, i), vA = box.schema.verticalAlign(d, i), words = box.schema.split(t, i);
|
|
368
|
+
/**
|
|
369
|
+
Figures out the lineData to be used for wrapping.
|
|
370
|
+
@private
|
|
371
|
+
*/ function checkSize() {
|
|
372
|
+
var truncate = function truncate() {
|
|
373
|
+
if (line < 1) lineData = [
|
|
374
|
+
that.schema.ellipsis("", line)
|
|
375
|
+
];
|
|
376
|
+
else lineData[line - 1] = that.schema.ellipsis(lineData[line - 1], line);
|
|
112
377
|
};
|
|
113
|
-
//
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
378
|
+
// Constraint the font size
|
|
379
|
+
fS = max([
|
|
380
|
+
fS,
|
|
381
|
+
fMin
|
|
382
|
+
]);
|
|
383
|
+
fS = min([
|
|
384
|
+
fS,
|
|
385
|
+
fMax
|
|
386
|
+
]);
|
|
387
|
+
if (resize) {
|
|
388
|
+
lH = fS * lHRatio;
|
|
389
|
+
wrapper.fontSize(fS).lineHeight(lH);
|
|
390
|
+
style["font-size"] = fS;
|
|
391
|
+
style["line-height"] = lH;
|
|
392
|
+
}
|
|
393
|
+
wrapResults = wrapper(t);
|
|
394
|
+
lineData = wrapResults.lines.filter(function(l) {
|
|
395
|
+
return l !== "";
|
|
396
|
+
});
|
|
397
|
+
line = lineData.length;
|
|
398
|
+
if (wrapResults.truncated) {
|
|
399
|
+
if (resize) {
|
|
400
|
+
fS--;
|
|
401
|
+
if (fS < fMin) {
|
|
402
|
+
fS = fMin;
|
|
403
|
+
truncate();
|
|
404
|
+
return;
|
|
405
|
+
} else checkSize();
|
|
406
|
+
} else truncate();
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
if (w > fMin && (h > lH || resize && h > fMin * lHRatio)) {
|
|
410
|
+
if (resize) fS = resizeFontSize(fS, w, h, lH, words, style);
|
|
411
|
+
checkSize();
|
|
412
|
+
}
|
|
413
|
+
if (!lineData.length) return null;
|
|
414
|
+
return assembleTextBoxDatum(box, d, i, {
|
|
415
|
+
lineData: lineData,
|
|
416
|
+
line: line,
|
|
417
|
+
fS: fS,
|
|
418
|
+
lH: lH,
|
|
419
|
+
w: w,
|
|
420
|
+
h: h,
|
|
421
|
+
vA: vA,
|
|
422
|
+
style: style,
|
|
423
|
+
widths: wrapResults.widths,
|
|
424
|
+
padding: padding
|
|
425
|
+
});
|
|
426
|
+
}
|
|
427
|
+
/** TextBox's fluent accessor schema. Config storage lives on `this.schema.<key>`. */ var textBoxSchema = [
|
|
428
|
+
{
|
|
429
|
+
key: "ariaHidden",
|
|
430
|
+
coerce: "const",
|
|
431
|
+
default: constant("false")
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
key: "delay",
|
|
435
|
+
coerce: "identity",
|
|
436
|
+
default: 0
|
|
437
|
+
},
|
|
438
|
+
{
|
|
439
|
+
key: "duration",
|
|
440
|
+
coerce: "identity",
|
|
441
|
+
default: 0
|
|
442
|
+
},
|
|
443
|
+
{
|
|
444
|
+
key: "ellipsis",
|
|
445
|
+
coerce: "const",
|
|
446
|
+
default: function _default(text, line) {
|
|
447
|
+
return line ? "".concat(text.replace(/\.|,$/g, ""), "...") : "";
|
|
448
|
+
}
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
key: "fontColor",
|
|
452
|
+
coerce: "const",
|
|
453
|
+
default: constant("black")
|
|
454
|
+
},
|
|
455
|
+
{
|
|
456
|
+
key: "fontFamily",
|
|
457
|
+
coerce: "const",
|
|
458
|
+
default: constant(fontFamily)
|
|
459
|
+
},
|
|
460
|
+
{
|
|
461
|
+
key: "fontMax",
|
|
462
|
+
coerce: "const",
|
|
463
|
+
default: constant(50)
|
|
464
|
+
},
|
|
465
|
+
{
|
|
466
|
+
key: "fontMin",
|
|
467
|
+
coerce: "const",
|
|
468
|
+
default: constant(8)
|
|
469
|
+
},
|
|
470
|
+
{
|
|
471
|
+
key: "fontOpacity",
|
|
472
|
+
coerce: "const",
|
|
473
|
+
default: constant(1)
|
|
474
|
+
},
|
|
475
|
+
{
|
|
476
|
+
key: "fontResize",
|
|
477
|
+
coerce: "const",
|
|
478
|
+
default: constant(false)
|
|
479
|
+
},
|
|
480
|
+
{
|
|
481
|
+
key: "fontSize",
|
|
482
|
+
coerce: "const",
|
|
483
|
+
default: constant(10)
|
|
484
|
+
},
|
|
485
|
+
{
|
|
486
|
+
key: "fontStroke",
|
|
487
|
+
coerce: "const",
|
|
488
|
+
default: constant("transparent")
|
|
489
|
+
},
|
|
490
|
+
{
|
|
491
|
+
key: "fontStrokeWidth",
|
|
492
|
+
coerce: "const",
|
|
493
|
+
default: constant(0)
|
|
494
|
+
},
|
|
495
|
+
{
|
|
496
|
+
key: "fontWeight",
|
|
497
|
+
coerce: "const",
|
|
498
|
+
default: constant(400)
|
|
499
|
+
},
|
|
500
|
+
{
|
|
501
|
+
key: "height",
|
|
502
|
+
coerce: "const",
|
|
503
|
+
default: accessor("height", 200)
|
|
504
|
+
},
|
|
505
|
+
{
|
|
506
|
+
key: "id",
|
|
507
|
+
coerce: "const",
|
|
508
|
+
default: function _default(d, i) {
|
|
137
509
|
return d.id || "".concat(i);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
510
|
+
}
|
|
511
|
+
},
|
|
512
|
+
{
|
|
513
|
+
key: "lineHeight",
|
|
514
|
+
coerce: "const"
|
|
515
|
+
},
|
|
516
|
+
{
|
|
517
|
+
key: "maxLines",
|
|
518
|
+
coerce: "const",
|
|
519
|
+
default: constant(null)
|
|
520
|
+
},
|
|
521
|
+
{
|
|
522
|
+
key: "overflow",
|
|
523
|
+
coerce: "const",
|
|
524
|
+
default: constant(false)
|
|
525
|
+
},
|
|
526
|
+
{
|
|
527
|
+
key: "padding",
|
|
528
|
+
coerce: "const",
|
|
529
|
+
default: constant(0)
|
|
530
|
+
},
|
|
531
|
+
{
|
|
532
|
+
key: "pointerEvents",
|
|
533
|
+
coerce: "const",
|
|
534
|
+
default: constant("auto")
|
|
535
|
+
},
|
|
536
|
+
{
|
|
537
|
+
key: "renderMode",
|
|
538
|
+
coerce: "identity",
|
|
539
|
+
default: "full"
|
|
540
|
+
},
|
|
541
|
+
{
|
|
542
|
+
key: "rotate",
|
|
543
|
+
coerce: "const",
|
|
544
|
+
default: constant(0)
|
|
545
|
+
},
|
|
546
|
+
{
|
|
547
|
+
key: "rotateAnchor",
|
|
548
|
+
coerce: "const",
|
|
549
|
+
default: function _default(d) {
|
|
149
550
|
return [
|
|
150
551
|
d.w / 2,
|
|
151
552
|
d.h / 2
|
|
152
553
|
];
|
|
554
|
+
}
|
|
555
|
+
},
|
|
556
|
+
{
|
|
557
|
+
key: "split",
|
|
558
|
+
coerce: "identity",
|
|
559
|
+
default: textSplit
|
|
560
|
+
},
|
|
561
|
+
{
|
|
562
|
+
key: "text",
|
|
563
|
+
coerce: "const",
|
|
564
|
+
default: accessor("text")
|
|
565
|
+
},
|
|
566
|
+
{
|
|
567
|
+
key: "textAnchor",
|
|
568
|
+
coerce: "const",
|
|
569
|
+
default: constant("start")
|
|
570
|
+
},
|
|
571
|
+
{
|
|
572
|
+
key: "verticalAlign",
|
|
573
|
+
coerce: "const",
|
|
574
|
+
default: constant("top")
|
|
575
|
+
},
|
|
576
|
+
{
|
|
577
|
+
key: "width",
|
|
578
|
+
coerce: "const",
|
|
579
|
+
default: accessor("width", 200)
|
|
580
|
+
},
|
|
581
|
+
{
|
|
582
|
+
key: "x",
|
|
583
|
+
coerce: "const",
|
|
584
|
+
default: accessor("x", 0)
|
|
585
|
+
},
|
|
586
|
+
{
|
|
587
|
+
key: "y",
|
|
588
|
+
coerce: "const",
|
|
589
|
+
default: accessor("y", 0)
|
|
590
|
+
}
|
|
591
|
+
];
|
|
592
|
+
var TextBox = /*#__PURE__*/ function(BaseClass) {
|
|
593
|
+
"use strict";
|
|
594
|
+
_inherits(TextBox, BaseClass);
|
|
595
|
+
function TextBox() {
|
|
596
|
+
_class_call_check(this, TextBox);
|
|
597
|
+
var _this;
|
|
598
|
+
_this = _call_super(this, TextBox), _define_property(_this, "_select", void 0), _define_property(_this, "_data", void 0);
|
|
599
|
+
installFluent(_this, textBoxSchema);
|
|
600
|
+
_this.schema.lineHeight = function(d, i) {
|
|
601
|
+
return _this.schema.fontSize(d, i) * 1.2;
|
|
153
602
|
};
|
|
154
|
-
_this.
|
|
155
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
156
|
-
_this._text = accessor("text");
|
|
157
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
158
|
-
_this._textAnchor = constant("start");
|
|
159
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
160
|
-
_this._verticalAlign = constant("top");
|
|
161
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
162
|
-
_this._width = accessor("width", 200);
|
|
163
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
164
|
-
_this._x = accessor("x", 0);
|
|
165
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
166
|
-
_this._y = accessor("y", 0);
|
|
603
|
+
_this.schema.html = defaultHtmlLookup;
|
|
167
604
|
return _this;
|
|
168
605
|
}
|
|
169
606
|
_create_class(TextBox, [
|
|
170
607
|
{
|
|
171
608
|
/**
|
|
609
|
+
Computes the laid-out text boxes (wrapping, font sizing, per-box position)
|
|
610
|
+
for the current data. Shared by render() and toScene() so both produce
|
|
611
|
+
identical layout.
|
|
612
|
+
@private
|
|
613
|
+
*/ key: "_textData",
|
|
614
|
+
value: function _textData() {
|
|
615
|
+
var _this = this;
|
|
616
|
+
return this._data.reduce(function(arr, d, i) {
|
|
617
|
+
var datum = computeTextBoxDatum(_this, d, i);
|
|
618
|
+
if (datum) arr.push(datum);
|
|
619
|
+
return arr;
|
|
620
|
+
}, []);
|
|
621
|
+
}
|
|
622
|
+
},
|
|
623
|
+
{
|
|
624
|
+
/**
|
|
625
|
+
Produces a backend-agnostic scene graph for the text boxes, reusing the same
|
|
626
|
+
layout (_textData) and per-line positioning render() applies to the DOM.
|
|
627
|
+
*/ key: "toScene",
|
|
628
|
+
value: function toScene() {
|
|
629
|
+
var _this = this;
|
|
630
|
+
var rtl = detectRTL();
|
|
631
|
+
var children = this._textData().map(function(d) {
|
|
632
|
+
var anchor = d.tA === "middle" ? "middle" : d.tA === "end" ? "end" : "start";
|
|
633
|
+
var lineX = d.tA === "middle" ? d.w / 2 : rtl ? d.tA === "start" ? d.w : 0 : d.tA === "end" ? d.w : 2 * Math.sin(Math.PI * d.r / 180);
|
|
634
|
+
var lines = d.lines.map(function(text, i) {
|
|
635
|
+
var _d_widths_i;
|
|
636
|
+
var y = d.r === 0 || d.vA === "top" ? (i + 1) * d.lH - (d.lH - d.fS) : d.vA === "middle" ? (d.h + d.fS) / 2 - (d.lH - d.fS) + (i - d.lines.length / 2 + 0.5) * d.lH : d.h - 2 * (d.lH - d.fS) - (d.lines.length - (i + 1)) * d.lH + 2 * Math.cos(Math.PI * d.r / 180);
|
|
637
|
+
var width = d.widths ? (_d_widths_i = d.widths[i]) !== null && _d_widths_i !== void 0 ? _d_widths_i : 0 : 0;
|
|
638
|
+
var runs = d.lineRuns ? d.lineRuns[i] : undefined;
|
|
639
|
+
return runs ? {
|
|
640
|
+
text: text,
|
|
641
|
+
x: lineX,
|
|
642
|
+
y: y,
|
|
643
|
+
width: width,
|
|
644
|
+
runs: runs
|
|
645
|
+
} : {
|
|
646
|
+
text: text,
|
|
647
|
+
x: lineX,
|
|
648
|
+
y: y,
|
|
649
|
+
width: width
|
|
650
|
+
};
|
|
651
|
+
});
|
|
652
|
+
var rotateAnchor = _this.schema.rotateAnchor(d, d.i);
|
|
653
|
+
var ariaHidden = d.aH === "true" || d.aH === true;
|
|
654
|
+
var interactive = d.pE !== "none";
|
|
655
|
+
return {
|
|
656
|
+
type: "text",
|
|
657
|
+
key: d.id,
|
|
658
|
+
id: "d3plus-textBox-".concat(strip(d.id)),
|
|
659
|
+
datum: d.data,
|
|
660
|
+
index: d.i,
|
|
661
|
+
x: 0,
|
|
662
|
+
y: 0,
|
|
663
|
+
width: d.w,
|
|
664
|
+
height: d.h,
|
|
665
|
+
lines: lines,
|
|
666
|
+
font: {
|
|
667
|
+
family: d.fF,
|
|
668
|
+
size: d.fS,
|
|
669
|
+
weight: d.fW,
|
|
670
|
+
anchor: anchor,
|
|
671
|
+
baseline: "alphabetic",
|
|
672
|
+
dir: rtl ? "rtl" : "ltr"
|
|
673
|
+
},
|
|
674
|
+
paint: _object_spread({
|
|
675
|
+
fill: d.fC,
|
|
676
|
+
opacity: d.fO
|
|
677
|
+
}, d.fStroke && d.fStroke !== "transparent" ? {
|
|
678
|
+
stroke: d.fStroke
|
|
679
|
+
} : {}, d.fSW ? {
|
|
680
|
+
strokeWidth: d.fSW
|
|
681
|
+
} : {}),
|
|
682
|
+
transform: {
|
|
683
|
+
x: d.x,
|
|
684
|
+
y: d.y,
|
|
685
|
+
rotate: d.r,
|
|
686
|
+
rotateAnchor: rotateAnchor
|
|
687
|
+
},
|
|
688
|
+
aria: ariaHidden ? {
|
|
689
|
+
hidden: true
|
|
690
|
+
} : undefined,
|
|
691
|
+
interactive: interactive
|
|
692
|
+
};
|
|
693
|
+
});
|
|
694
|
+
return {
|
|
695
|
+
type: "group",
|
|
696
|
+
key: "textBox-group",
|
|
697
|
+
children: children
|
|
698
|
+
};
|
|
699
|
+
}
|
|
700
|
+
},
|
|
701
|
+
{
|
|
702
|
+
/**
|
|
172
703
|
Renders the text boxes. If a *callback* is specified, it will be called once the shapes are done drawing.
|
|
173
704
|
@param callback Optional callback invoked after rendering completes.
|
|
174
705
|
*/ key: "render",
|
|
175
706
|
value: function render(callback) {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
if (t === void 0) return arr;
|
|
182
|
-
t = "".concat(t).trim();
|
|
183
|
-
var resize = _this._fontResize(d, i);
|
|
184
|
-
var lHRatio = _this._lineHeight(d, i) / _this._fontSize(d, i);
|
|
185
|
-
var fS = resize ? _this._fontMax(d, i) : _this._fontSize(d, i), lH = resize ? fS * lHRatio : _this._lineHeight(d, i), line = 1, lineData = [], sizes, wrapResults = {
|
|
186
|
-
lines: [],
|
|
187
|
-
truncated: false,
|
|
188
|
-
widths: []
|
|
189
|
-
};
|
|
190
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
191
|
-
var style = {
|
|
192
|
-
"font-family": fontExists(_this._fontFamily(d, i)),
|
|
193
|
-
"font-size": fS,
|
|
194
|
-
"font-weight": _this._fontWeight(d, i),
|
|
195
|
-
"line-height": lH
|
|
196
|
-
};
|
|
197
|
-
var padding = parseSides(_this._padding(d, i));
|
|
198
|
-
var h = _this._height(d, i) - (padding.top + padding.bottom), w = _this._width(d, i) - (padding.left + padding.right);
|
|
199
|
-
var wrapper = textWrap().fontFamily(style["font-family"]).fontSize(fS).fontWeight(style["font-weight"]).lineHeight(lH).maxLines(_this._maxLines(d, i)).height(h).overflow(_this._overflow(d, i)).width(w).split(_this._split);
|
|
200
|
-
var fMax = _this._fontMax(d, i), fMin = _this._fontMin(d, i), vA = _this._verticalAlign(d, i), words = _this._split(t, i);
|
|
201
|
-
/**
|
|
202
|
-
Figures out the lineData to be used for wrapping.
|
|
203
|
-
@private
|
|
204
|
-
*/ function checkSize() {
|
|
205
|
-
var truncate = function truncate() {
|
|
206
|
-
if (line < 1) lineData = [
|
|
207
|
-
that._ellipsis("", line)
|
|
208
|
-
];
|
|
209
|
-
else lineData[line - 1] = that._ellipsis(lineData[line - 1], line);
|
|
210
|
-
};
|
|
211
|
-
// Constraint the font size
|
|
212
|
-
fS = max([
|
|
213
|
-
fS,
|
|
214
|
-
fMin
|
|
215
|
-
]);
|
|
216
|
-
fS = min([
|
|
217
|
-
fS,
|
|
218
|
-
fMax
|
|
219
|
-
]);
|
|
220
|
-
if (resize) {
|
|
221
|
-
lH = fS * lHRatio;
|
|
222
|
-
wrapper.fontSize(fS).lineHeight(lH);
|
|
223
|
-
style["font-size"] = fS;
|
|
224
|
-
style["line-height"] = lH;
|
|
225
|
-
}
|
|
226
|
-
wrapResults = wrapper(t);
|
|
227
|
-
lineData = wrapResults.lines.filter(function(l) {
|
|
228
|
-
return l !== "";
|
|
229
|
-
});
|
|
230
|
-
line = lineData.length;
|
|
231
|
-
if (wrapResults.truncated) {
|
|
232
|
-
if (resize) {
|
|
233
|
-
fS--;
|
|
234
|
-
if (fS < fMin) {
|
|
235
|
-
fS = fMin;
|
|
236
|
-
truncate();
|
|
237
|
-
return;
|
|
238
|
-
} else checkSize();
|
|
239
|
-
} else truncate();
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
if (w > fMin && (h > lH || resize && h > fMin * lHRatio)) {
|
|
243
|
-
if (resize) {
|
|
244
|
-
sizes = textWidth(words, style);
|
|
245
|
-
var areaMod = 1.165 + w / h * 0.1, boxArea = w * h, maxWidth = max(sizes), textArea = sum(sizes, function(d) {
|
|
246
|
-
return d * lH;
|
|
247
|
-
}) * areaMod;
|
|
248
|
-
if (maxWidth > w || textArea > boxArea) {
|
|
249
|
-
var areaRatio = Math.sqrt(boxArea / textArea), widthRatio = w / maxWidth;
|
|
250
|
-
var sizeRatio = min([
|
|
251
|
-
areaRatio,
|
|
252
|
-
widthRatio
|
|
253
|
-
]);
|
|
254
|
-
fS = Math.floor(fS * sizeRatio);
|
|
255
|
-
}
|
|
256
|
-
var heightMax = Math.floor(h * 0.8);
|
|
257
|
-
if (fS > heightMax) fS = heightMax;
|
|
258
|
-
}
|
|
259
|
-
checkSize();
|
|
260
|
-
}
|
|
261
|
-
if (lineData.length) {
|
|
262
|
-
var tH = line * lH;
|
|
263
|
-
var r = _this._rotate(d, i);
|
|
264
|
-
var yP = r === 0 ? vA === "top" ? 0 : vA === "middle" ? h / 2 - tH / 2 : h - tH : 0;
|
|
265
|
-
yP -= lH * 0.1;
|
|
266
|
-
arr.push({
|
|
267
|
-
aH: _this._ariaHidden(d, i),
|
|
268
|
-
data: d,
|
|
269
|
-
i: i,
|
|
270
|
-
lines: lineData,
|
|
271
|
-
fC: _this._fontColor(d, i),
|
|
272
|
-
fStroke: _this._fontStroke(d, i),
|
|
273
|
-
fSW: _this._fontStrokeWidth(d, i),
|
|
274
|
-
fF: style["font-family"],
|
|
275
|
-
fO: _this._fontOpacity(d, i),
|
|
276
|
-
fW: style["font-weight"],
|
|
277
|
-
id: _this._id(d, i),
|
|
278
|
-
tA: _this._textAnchor(d, i),
|
|
279
|
-
vA: _this._verticalAlign(d, i),
|
|
280
|
-
widths: wrapResults.widths,
|
|
281
|
-
fS: fS,
|
|
282
|
-
lH: lH,
|
|
283
|
-
w: w,
|
|
284
|
-
h: h,
|
|
285
|
-
r: r,
|
|
286
|
-
x: _this._x(d, i) + padding.left,
|
|
287
|
-
y: _this._y(d, i) + yP + padding.top
|
|
288
|
-
});
|
|
289
|
-
}
|
|
290
|
-
return arr;
|
|
291
|
-
}, []), // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
292
|
-
function(d) {
|
|
293
|
-
return _this._id(d.data, d.i);
|
|
294
|
-
});
|
|
295
|
-
var t = this._select.transition().duration(this._duration);
|
|
296
|
-
if (this._duration === 0) {
|
|
297
|
-
boxes.exit().remove();
|
|
298
|
-
} else {
|
|
299
|
-
boxes.exit().transition().delay(this._duration).remove();
|
|
300
|
-
boxes.exit().selectAll("text").transition(t).attr("opacity", 0).style("opacity", 0);
|
|
707
|
+
if (this.schema.renderMode === "compute") {
|
|
708
|
+
// A Viz pipeline (or parent shape) is driving this TextBox — it will
|
|
709
|
+
// compose the scene itself, so we only need _textData to be reachable.
|
|
710
|
+
if (callback) setTimeout(callback, 0);
|
|
711
|
+
return this;
|
|
301
712
|
}
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
function rotate(text) {
|
|
308
|
-
text.attr("transform", function(d, i) {
|
|
309
|
-
var rotateAnchor = that._rotateAnchor(d, i);
|
|
310
|
-
return "translate(".concat(d.x, ", ").concat(d.y, ") rotate(").concat(d.r, ", ").concat(rotateAnchor[0], ", ").concat(rotateAnchor[1], ")");
|
|
311
|
-
});
|
|
713
|
+
// Standalone use: route toScene() through SvgRenderer. Mirrors Shape.render
|
|
714
|
+
// so `new TextBox().render()` works without a d3-selection body.
|
|
715
|
+
if (this._select === undefined && typeof document !== "undefined") {
|
|
716
|
+
var svgNode = select("body").append("svg").style("width", "".concat(window.innerWidth, "px")).style("height", "".concat(window.innerHeight, "px")).node();
|
|
717
|
+
this.select(svgNode);
|
|
312
718
|
}
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
if (tag) {
|
|
345
|
-
var style = htmlLookup[tag];
|
|
346
|
-
if (t.includes("</".concat(tag, ">"))) tag = false;
|
|
347
|
-
return '<tspan style="'.concat(style, '">').concat(b, "</tspan>");
|
|
348
|
-
}
|
|
349
|
-
return b;
|
|
350
|
-
});
|
|
351
|
-
} else if (tag && tag.length) {
|
|
352
|
-
var htmlLookup1 = that._html;
|
|
353
|
-
cleaned = '<tspan style="'.concat(htmlLookup1[tag], '">').concat(cleaned, "</tspan>");
|
|
354
|
-
}
|
|
355
|
-
return cleaned;
|
|
356
|
-
});
|
|
357
|
-
}
|
|
358
|
-
/**
|
|
359
|
-
Styles to apply to each <text> element.
|
|
360
|
-
@private
|
|
361
|
-
*/ // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
362
|
-
function textStyle(text) {
|
|
363
|
-
text.attr("aria-hidden", d.aH).attr("dir", rtl ? "rtl" : "ltr").attr("fill", d.fC).attr("stroke", d.fStroke).attr("stroke-width", d.fSW).attr("text-anchor", d.tA).attr("font-family", d.fF).style("font-family", d.fF).attr("font-size", "".concat(d.fS, "px")).style("font-size", "".concat(d.fS, "px")).attr("font-weight", d.fW).style("font-weight", d.fW).attr("x", "".concat(d.tA === "middle" ? d.w / 2 : rtl ? d.tA === "start" ? d.w : 0 : d.tA === "end" ? d.w : 2 * Math.sin(Math.PI * d.r / 180), "px")).attr("y", function(_t, i) {
|
|
364
|
-
return d.r === 0 || d.vA === "top" ? "".concat((i + 1) * d.lH - (d.lH - d.fS), "px") : d.vA === "middle" ? "".concat((d.h + d.fS) / 2 - (d.lH - d.fS) + (i - d.lines.length / 2 + 0.5) * d.lH, "px") : "".concat(d.h - 2 * (d.lH - d.fS) - (d.lines.length - (i + 1)) * d.lH + 2 * Math.cos(Math.PI * d.r / 180), "px");
|
|
719
|
+
if (this._select) {
|
|
720
|
+
var sel = this._select;
|
|
721
|
+
var node = sel && typeof sel.node === "function" ? sel.node() : sel;
|
|
722
|
+
if (node) {
|
|
723
|
+
var root = this.toScene();
|
|
724
|
+
var contentW = root.children.reduce(function(m, c) {
|
|
725
|
+
var _ref, _c_width;
|
|
726
|
+
var _c_transform;
|
|
727
|
+
return Math.max(m, ((_ref = (_c_transform = c.transform) === null || _c_transform === void 0 ? void 0 : _c_transform.x) !== null && _ref !== void 0 ? _ref : 0) + ((_c_width = c.width) !== null && _c_width !== void 0 ? _c_width : 0));
|
|
728
|
+
}, 0);
|
|
729
|
+
var contentH = root.children.reduce(function(m, c) {
|
|
730
|
+
var _ref, _c_height;
|
|
731
|
+
var _c_transform;
|
|
732
|
+
return Math.max(m, ((_ref = (_c_transform = c.transform) === null || _c_transform === void 0 ? void 0 : _c_transform.y) !== null && _ref !== void 0 ? _ref : 0) + ((_c_height = c.height) !== null && _c_height !== void 0 ? _c_height : 0));
|
|
733
|
+
}, 0);
|
|
734
|
+
var rect = typeof node.getBoundingClientRect === "function" ? node.getBoundingClientRect() : null;
|
|
735
|
+
var boxW = rect && rect.width || Number(node.getAttribute("width")) || node.clientWidth || 0;
|
|
736
|
+
var boxH = rect && rect.height || Number(node.getAttribute("height")) || node.clientHeight || 0;
|
|
737
|
+
var width = Math.max(boxW, contentW) || 400;
|
|
738
|
+
var height = Math.max(boxH, contentH) || 300;
|
|
739
|
+
while(node.firstChild)node.removeChild(node.firstChild);
|
|
740
|
+
var scene = {
|
|
741
|
+
root: root,
|
|
742
|
+
width: width,
|
|
743
|
+
height: height
|
|
744
|
+
};
|
|
745
|
+
var renderer = new SvgRenderer();
|
|
746
|
+
renderer.mount({
|
|
747
|
+
container: node,
|
|
748
|
+
width: width,
|
|
749
|
+
height: height
|
|
365
750
|
});
|
|
751
|
+
renderer.drawScene(scene);
|
|
752
|
+
this._sceneRenderer = renderer;
|
|
366
753
|
}
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
texts.call(textContent).call(textStyle);
|
|
370
|
-
texts.exit().remove();
|
|
371
|
-
texts.enter().append("text").attr("dominant-baseline", "alphabetic").style("baseline-shift", "0%").attr("unicode-bidi", "bidi-override").call(textContent).call(textStyle).attr("opacity", d.fO).style("opacity", d.fO);
|
|
372
|
-
} else {
|
|
373
|
-
texts.call(textContent).transition(t).call(textStyle);
|
|
374
|
-
texts.exit().transition(t).attr("opacity", 0).remove();
|
|
375
|
-
texts.enter().append("text").attr("dominant-baseline", "alphabetic").style("baseline-shift", "0%").attr("opacity", 0).style("opacity", 0).call(textContent).call(textStyle).merge(texts).transition(t).delay(that._delay).call(textStyle).attr("opacity", d.fO).style("opacity", d.fO);
|
|
376
|
-
}
|
|
377
|
-
}).transition(t).call(rotate);
|
|
378
|
-
var events = Object.keys(this._on), on = events.reduce(function(obj, e) {
|
|
379
|
-
var _this1 = _this;
|
|
380
|
-
obj[e] = function() {
|
|
381
|
-
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
|
|
382
|
-
args[_key] = arguments[_key];
|
|
383
|
-
}
|
|
384
|
-
return _this1._on[e](args[0].data, args[1]);
|
|
385
|
-
};
|
|
386
|
-
return obj;
|
|
387
|
-
}, {});
|
|
388
|
-
for(var e = 0; e < events.length; e++)update.on(events[e], on[events[e]]);
|
|
389
|
-
if (callback) setTimeout(callback, this._duration + 100);
|
|
754
|
+
}
|
|
755
|
+
if (callback) setTimeout(callback, 0);
|
|
390
756
|
return this;
|
|
391
757
|
}
|
|
392
758
|
},
|
|
393
|
-
{
|
|
394
|
-
key: "ariaHidden",
|
|
395
|
-
value: function ariaHidden(_) {
|
|
396
|
-
return _ !== undefined ? (this._ariaHidden = typeof _ === "function" ? _ : constant(_), this) : this._ariaHidden;
|
|
397
|
-
}
|
|
398
|
-
},
|
|
399
759
|
{
|
|
400
760
|
key: "data",
|
|
401
761
|
value: function data(_) {
|
|
402
762
|
return arguments.length ? (this._data = _, this) : this._data;
|
|
403
763
|
}
|
|
404
764
|
},
|
|
405
|
-
{
|
|
406
|
-
key: "delay",
|
|
407
|
-
value: function delay(_) {
|
|
408
|
-
return arguments.length ? (this._delay = _, this) : this._delay;
|
|
409
|
-
}
|
|
410
|
-
},
|
|
411
|
-
{
|
|
412
|
-
key: "duration",
|
|
413
|
-
value: function duration(_) {
|
|
414
|
-
return arguments.length ? (this._duration = _, this) : this._duration;
|
|
415
|
-
}
|
|
416
|
-
},
|
|
417
|
-
{
|
|
418
|
-
key: "ellipsis",
|
|
419
|
-
value: function ellipsis(_) {
|
|
420
|
-
return arguments.length ? (this._ellipsis = typeof _ === "function" ? _ : constant(_), this) : this._ellipsis;
|
|
421
|
-
}
|
|
422
|
-
},
|
|
423
|
-
{
|
|
424
|
-
key: "fontColor",
|
|
425
|
-
value: function fontColor(_) {
|
|
426
|
-
return arguments.length ? (this._fontColor = typeof _ === "function" ? _ : constant(_), this) : this._fontColor;
|
|
427
|
-
}
|
|
428
|
-
},
|
|
429
|
-
{
|
|
430
|
-
key: "fontFamily",
|
|
431
|
-
value: function fontFamily(_) {
|
|
432
|
-
return arguments.length ? (this._fontFamily = typeof _ === "function" ? _ : constant(_), this) : this._fontFamily;
|
|
433
|
-
}
|
|
434
|
-
},
|
|
435
|
-
{
|
|
436
|
-
key: "fontMax",
|
|
437
|
-
value: function fontMax(_) {
|
|
438
|
-
return arguments.length ? (this._fontMax = typeof _ === "function" ? _ : constant(_), this) : this._fontMax;
|
|
439
|
-
}
|
|
440
|
-
},
|
|
441
|
-
{
|
|
442
|
-
key: "fontMin",
|
|
443
|
-
value: function fontMin(_) {
|
|
444
|
-
return arguments.length ? (this._fontMin = typeof _ === "function" ? _ : constant(_), this) : this._fontMin;
|
|
445
|
-
}
|
|
446
|
-
},
|
|
447
|
-
{
|
|
448
|
-
key: "fontOpacity",
|
|
449
|
-
value: function fontOpacity(_) {
|
|
450
|
-
return arguments.length ? (this._fontOpacity = typeof _ === "function" ? _ : constant(_), this) : this._fontOpacity;
|
|
451
|
-
}
|
|
452
|
-
},
|
|
453
|
-
{
|
|
454
|
-
key: "fontResize",
|
|
455
|
-
value: function fontResize(_) {
|
|
456
|
-
return arguments.length ? (this._fontResize = typeof _ === "function" ? _ : constant(_), this) : this._fontResize;
|
|
457
|
-
}
|
|
458
|
-
},
|
|
459
|
-
{
|
|
460
|
-
key: "fontSize",
|
|
461
|
-
value: function fontSize(_) {
|
|
462
|
-
return arguments.length ? (this._fontSize = typeof _ === "function" ? _ : constant(_), this) : this._fontSize;
|
|
463
|
-
}
|
|
464
|
-
},
|
|
465
|
-
{
|
|
466
|
-
key: "fontStroke",
|
|
467
|
-
value: function fontStroke(_) {
|
|
468
|
-
return arguments.length ? (this._fontStroke = typeof _ === "function" ? _ : constant(_), this) : this._fontStroke;
|
|
469
|
-
}
|
|
470
|
-
},
|
|
471
|
-
{
|
|
472
|
-
key: "fontStrokeWidth",
|
|
473
|
-
value: function fontStrokeWidth(_) {
|
|
474
|
-
return arguments.length ? (this._fontStrokeWidth = typeof _ === "function" ? _ : constant(_), this) : this._fontStrokeWidth;
|
|
475
|
-
}
|
|
476
|
-
},
|
|
477
|
-
{
|
|
478
|
-
key: "fontWeight",
|
|
479
|
-
value: function fontWeight(_) {
|
|
480
|
-
return arguments.length ? (this._fontWeight = typeof _ === "function" ? _ : constant(_), this) : this._fontWeight;
|
|
481
|
-
}
|
|
482
|
-
},
|
|
483
|
-
{
|
|
484
|
-
key: "height",
|
|
485
|
-
value: function height(_) {
|
|
486
|
-
return arguments.length ? (this._height = typeof _ === "function" ? _ : constant(_), this) : this._height;
|
|
487
|
-
}
|
|
488
|
-
},
|
|
489
765
|
{
|
|
490
766
|
key: "html",
|
|
491
767
|
value: function html(_) {
|
|
492
|
-
return arguments.length ? (this.
|
|
493
|
-
}
|
|
494
|
-
},
|
|
495
|
-
{
|
|
496
|
-
key: "id",
|
|
497
|
-
value: function id(_) {
|
|
498
|
-
return arguments.length ? (this._id = typeof _ === "function" ? _ : constant(_), this) : this._id;
|
|
499
|
-
}
|
|
500
|
-
},
|
|
501
|
-
{
|
|
502
|
-
key: "lineHeight",
|
|
503
|
-
value: function lineHeight(_) {
|
|
504
|
-
return arguments.length ? (this._lineHeight = typeof _ === "function" ? _ : constant(_), this) : this._lineHeight;
|
|
505
|
-
}
|
|
506
|
-
},
|
|
507
|
-
{
|
|
508
|
-
key: "maxLines",
|
|
509
|
-
value: function maxLines(_) {
|
|
510
|
-
return arguments.length ? (this._maxLines = typeof _ === "function" ? _ : constant(_), this) : this._maxLines;
|
|
511
|
-
}
|
|
512
|
-
},
|
|
513
|
-
{
|
|
514
|
-
key: "overflow",
|
|
515
|
-
value: function overflow(_) {
|
|
516
|
-
return arguments.length ? (this._overflow = typeof _ === "function" ? _ : constant(_), this) : this._overflow;
|
|
517
|
-
}
|
|
518
|
-
},
|
|
519
|
-
{
|
|
520
|
-
key: "padding",
|
|
521
|
-
value: function padding(_) {
|
|
522
|
-
return arguments.length ? (this._padding = typeof _ === "function" ? _ : constant(_), this) : this._padding;
|
|
523
|
-
}
|
|
524
|
-
},
|
|
525
|
-
{
|
|
526
|
-
key: "pointerEvents",
|
|
527
|
-
value: function pointerEvents(_) {
|
|
528
|
-
return arguments.length ? (this._pointerEvents = typeof _ === "function" ? _ : constant(_), this) : this._pointerEvents;
|
|
529
|
-
}
|
|
530
|
-
},
|
|
531
|
-
{
|
|
532
|
-
key: "rotate",
|
|
533
|
-
value: function rotate(_) {
|
|
534
|
-
return arguments.length ? (this._rotate = typeof _ === "function" ? _ : constant(_), this) : this._rotate;
|
|
535
|
-
}
|
|
536
|
-
},
|
|
537
|
-
{
|
|
538
|
-
key: "rotateAnchor",
|
|
539
|
-
value: function rotateAnchor(_) {
|
|
540
|
-
return arguments.length ? (this._rotateAnchor = typeof _ === "function" ? _ : constant(_), this) : this._rotateAnchor;
|
|
768
|
+
return arguments.length ? (this.schema.html = typeof _ === "boolean" ? _ ? defaultHtmlLookup : false : _, this) : this.schema.html;
|
|
541
769
|
}
|
|
542
770
|
},
|
|
543
771
|
{
|
|
@@ -545,48 +773,6 @@ var TextBox = /*#__PURE__*/ function(BaseClass) {
|
|
|
545
773
|
value: function select1(_) {
|
|
546
774
|
return arguments.length ? (this._select = select(_), this) : this._select;
|
|
547
775
|
}
|
|
548
|
-
},
|
|
549
|
-
{
|
|
550
|
-
key: "split",
|
|
551
|
-
value: function split(_) {
|
|
552
|
-
return arguments.length ? (this._split = _, this) : this._split;
|
|
553
|
-
}
|
|
554
|
-
},
|
|
555
|
-
{
|
|
556
|
-
key: "text",
|
|
557
|
-
value: function text(_) {
|
|
558
|
-
return arguments.length ? (this._text = typeof _ === "function" ? _ : constant(_), this) : this._text;
|
|
559
|
-
}
|
|
560
|
-
},
|
|
561
|
-
{
|
|
562
|
-
key: "textAnchor",
|
|
563
|
-
value: function textAnchor(_) {
|
|
564
|
-
return arguments.length ? (this._textAnchor = typeof _ === "function" ? _ : constant(_), this) : this._textAnchor;
|
|
565
|
-
}
|
|
566
|
-
},
|
|
567
|
-
{
|
|
568
|
-
key: "verticalAlign",
|
|
569
|
-
value: function verticalAlign(_) {
|
|
570
|
-
return arguments.length ? (this._verticalAlign = typeof _ === "function" ? _ : constant(_), this) : this._verticalAlign;
|
|
571
|
-
}
|
|
572
|
-
},
|
|
573
|
-
{
|
|
574
|
-
key: "width",
|
|
575
|
-
value: function width(_) {
|
|
576
|
-
return arguments.length ? (this._width = typeof _ === "function" ? _ : constant(_), this) : this._width;
|
|
577
|
-
}
|
|
578
|
-
},
|
|
579
|
-
{
|
|
580
|
-
key: "x",
|
|
581
|
-
value: function x(_) {
|
|
582
|
-
return arguments.length ? (this._x = typeof _ === "function" ? _ : constant(_), this) : this._x;
|
|
583
|
-
}
|
|
584
|
-
},
|
|
585
|
-
{
|
|
586
|
-
key: "y",
|
|
587
|
-
value: function y(_) {
|
|
588
|
-
return arguments.length ? (this._y = typeof _ === "function" ? _ : constant(_), this) : this._y;
|
|
589
|
-
}
|
|
590
776
|
}
|
|
591
777
|
]);
|
|
592
778
|
return TextBox;
|