@d3plus/core 4.6.0 → 4.7.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 +728 -1454
- package/es/index.js.map +1 -1
- package/es/internal.js +5 -0
- package/es/internal.js.map +1 -1
- package/es/src/charts/Chord/index.js +2 -0
- package/es/src/charts/Chord/index.js.map +1 -1
- package/es/src/charts/Geomap/applyLayout.js +3 -1
- package/es/src/charts/Geomap/applyLayout.js.map +1 -1
- package/es/src/charts/Geomap/index.js +3 -1
- package/es/src/charts/Geomap/index.js.map +1 -1
- package/es/src/charts/Matrix/emit.js +5 -4
- package/es/src/charts/Matrix/emit.js.map +1 -1
- package/es/src/charts/Network/index.js +4 -0
- package/es/src/charts/Network/index.js.map +1 -1
- package/es/src/charts/Pack/emit.js +6 -6
- package/es/src/charts/Pack/emit.js.map +1 -1
- package/es/src/charts/Pack/index.js +2 -0
- package/es/src/charts/Pack/index.js.map +1 -1
- package/es/src/charts/Pie/emit.js +5 -6
- package/es/src/charts/Pie/emit.js.map +1 -1
- package/es/src/charts/Pie/index.js +2 -0
- package/es/src/charts/Pie/index.js.map +1 -1
- package/es/src/charts/Plot/index.js +15 -1
- package/es/src/charts/Plot/index.js.map +1 -1
- package/es/src/charts/Plot/insetRegion.js +21 -0
- package/es/src/charts/Plot/insetRegion.js.map +1 -0
- package/es/src/charts/Plot/sharedHover.js +117 -16
- package/es/src/charts/Plot/sharedHover.js.map +1 -1
- package/es/src/charts/Plot/sharedTooltip.js +35 -15
- package/es/src/charts/Plot/sharedTooltip.js.map +1 -1
- package/es/src/charts/Plot/trendLines.js +140 -38
- package/es/src/charts/Plot/trendLines.js.map +1 -1
- package/es/src/charts/Plot/trendProjection.js +120 -0
- package/es/src/charts/Plot/trendProjection.js.map +1 -0
- package/es/src/charts/Plot/trendScene.js +33 -19
- package/es/src/charts/Plot/trendScene.js.map +1 -1
- package/es/src/charts/Plot/trendTooltip.js +79 -17
- package/es/src/charts/Plot/trendTooltip.js.map +1 -1
- package/es/src/charts/Priestley/emit.js +3 -4
- package/es/src/charts/Priestley/emit.js.map +1 -1
- package/es/src/charts/RadialMatrix/emit.js +4 -4
- package/es/src/charts/RadialMatrix/emit.js.map +1 -1
- package/es/src/charts/Rings/index.js +5 -1
- package/es/src/charts/Rings/index.js.map +1 -1
- package/es/src/charts/Sankey/index.js +2 -0
- package/es/src/charts/Sankey/index.js.map +1 -1
- package/es/src/charts/Tree/index.js +2 -0
- package/es/src/charts/Tree/index.js.map +1 -1
- package/es/src/charts/Treemap/emit.js +3 -4
- package/es/src/charts/Treemap/emit.js.map +1 -1
- package/es/src/charts/definition/ChartDefinition.js.map +1 -1
- package/es/src/charts/definition/makeChart.js +8 -2
- package/es/src/charts/definition/makeChart.js.map +1 -1
- package/es/src/charts/drawSteps/bottomRightControls.js +3 -0
- package/es/src/charts/drawSteps/bottomRightControls.js.map +1 -1
- package/es/src/charts/drawSteps/bottomRightControlsMarkup.js +135 -4
- package/es/src/charts/drawSteps/bottomRightControlsMarkup.js.map +1 -1
- package/es/src/charts/drawSteps/searchControlsMarkup.js +15 -38
- package/es/src/charts/drawSteps/searchControlsMarkup.js.map +1 -1
- package/es/src/charts/events/click.legend.js +10 -5
- package/es/src/charts/events/click.legend.js.map +1 -1
- package/es/src/charts/events/mousemove.shape.js +8 -1
- package/es/src/charts/events/mousemove.shape.js.map +1 -1
- package/es/src/charts/features/emitHelpers.js +19 -5
- package/es/src/charts/features/emitHelpers.js.map +1 -1
- package/es/src/charts/features/features.js +3 -108
- package/es/src/charts/features/features.js.map +1 -1
- package/es/src/charts/features/featuresColorScale.js +161 -0
- package/es/src/charts/features/featuresColorScale.js.map +1 -0
- package/es/src/charts/features/featuresLegend.js +145 -32
- package/es/src/charts/features/featuresLegend.js.map +1 -1
- package/es/src/charts/features/insetState.js +174 -0
- package/es/src/charts/features/insetState.js.map +1 -0
- package/es/src/charts/features/sceneBounds.js +271 -0
- package/es/src/charts/features/sceneBounds.js.map +1 -0
- package/es/src/charts/features/tooltipSwatch.js +73 -0
- package/es/src/charts/features/tooltipSwatch.js.map +1 -0
- package/es/src/charts/pipeline/insetPlacement.js +406 -0
- package/es/src/charts/pipeline/insetPlacement.js.map +1 -0
- package/es/src/charts/pipeline/runVizPipeline.js +6 -2
- package/es/src/charts/pipeline/runVizPipeline.js.map +1 -1
- package/es/src/charts/viz/Viz.js +18 -3
- package/es/src/charts/viz/Viz.js.map +1 -1
- package/es/src/charts/viz/VizBaseConfig.js +20 -24
- package/es/src/charts/viz/VizBaseConfig.js.map +1 -1
- package/es/src/charts/viz/interactionOpacity.js +21 -13
- package/es/src/charts/viz/interactionOpacity.js.map +1 -1
- package/es/src/charts/viz/linkGroup.js +386 -0
- package/es/src/charts/viz/linkGroup.js.map +1 -0
- package/es/src/charts/viz/sceneRows.js +33 -0
- package/es/src/charts/viz/sceneRows.js.map +1 -0
- package/es/src/charts/viz/vizDefaults.js +13 -8
- package/es/src/charts/viz/vizDefaults.js.map +1 -1
- package/es/src/charts/viz/vizTypes.js.map +1 -1
- package/es/src/components/Axis/AxisBottom.js +1 -1
- package/es/src/components/Axis/AxisBottom.js.map +1 -1
- package/es/src/components/Axis/AxisLeft.js +1 -1
- package/es/src/components/Axis/AxisLeft.js.map +1 -1
- package/es/src/components/Axis/AxisRight.js +1 -1
- package/es/src/components/Axis/AxisRight.js.map +1 -1
- package/es/src/components/Axis/AxisTop.js +1 -1
- package/es/src/components/Axis/AxisTop.js.map +1 -1
- package/es/src/components/Axis/axisLayoutLabels.js +13 -1
- package/es/src/components/Axis/axisLayoutLabels.js.map +1 -1
- package/es/src/components/ColorScale/ColorScale.js.map +1 -1
- package/es/src/components/Legend/legendConfig.js +2 -1
- package/es/src/components/Legend/legendConfig.js.map +1 -1
- package/es/src/components/Legend/legendRender.js +42 -5
- package/es/src/components/Legend/legendRender.js.map +1 -1
- package/es/src/components/TextBox.js +1 -1
- package/es/src/components/TextBox.js.map +1 -1
- package/es/src/shapes/Bar.js +1 -1
- package/es/src/shapes/Bar.js.map +1 -1
- package/es/src/shapes/Box.js +1 -1
- package/es/src/shapes/Box.js.map +1 -1
- package/es/src/shapes/Rect.js +1 -1
- package/es/src/shapes/Rect.js.map +1 -1
- package/es/src/shapes/Shape.js +9 -36
- package/es/src/shapes/Shape.js.map +1 -1
- package/es/src/shapes/Whisker.js +1 -1
- package/es/src/shapes/Whisker.js.map +1 -1
- package/es/src/shapes/textureKey.js +104 -0
- package/es/src/shapes/textureKey.js.map +1 -0
- package/es/src/utils/D3plusConfig.js.map +1 -1
- package/package.json +10 -9
- package/types/index.d.ts +1 -0
- package/types/internal.d.ts +7 -0
- package/types/src/charts/Plot/index.d.ts +8 -0
- package/types/src/charts/Plot/insetRegion.d.ts +4 -0
- package/types/src/charts/Plot/sharedHover.d.ts +5 -0
- package/types/src/charts/Plot/sharedTooltip.d.ts +10 -0
- package/types/src/charts/Plot/trendLines.d.ts +23 -3
- package/types/src/charts/Plot/trendProjection.d.ts +28 -0
- package/types/src/charts/Plot/trendScene.d.ts +2 -1
- package/types/src/charts/Plot/trendTooltip.d.ts +16 -5
- package/types/src/charts/definition/ChartDefinition.d.ts +9 -0
- package/types/src/charts/definition/makeChart.d.ts +2 -2
- package/types/src/charts/drawSteps/bottomRightControlsMarkup.d.ts +2 -0
- package/types/src/charts/drawSteps/searchControlsMarkup.d.ts +7 -5
- package/types/src/charts/features/emitHelpers.d.ts +10 -4
- package/types/src/charts/features/features.d.ts +1 -8
- package/types/src/charts/features/featuresColorScale.d.ts +24 -0
- package/types/src/charts/features/featuresLegend.d.ts +15 -0
- package/types/src/charts/features/insetState.d.ts +95 -0
- package/types/src/charts/features/sceneBounds.d.ts +18 -0
- package/types/src/charts/features/tooltipSwatch.d.ts +31 -0
- package/types/src/charts/pipeline/insetPlacement.d.ts +45 -0
- package/types/src/charts/pipeline/runVizPipeline.d.ts +2 -1
- package/types/src/charts/viz/Viz.d.ts +9 -1
- package/types/src/charts/viz/VizBaseConfig.d.ts +8 -12
- package/types/src/charts/viz/linkGroup.d.ts +96 -0
- package/types/src/charts/viz/sceneRows.d.ts +13 -0
- package/types/src/charts/viz/vizTypes.d.ts +17 -0
- package/types/src/components/Axis/AxisBottom.d.ts +1 -1
- package/types/src/components/Axis/AxisLeft.d.ts +1 -1
- package/types/src/components/Axis/AxisRight.d.ts +1 -1
- package/types/src/components/Axis/AxisTop.d.ts +1 -1
- package/types/src/components/ColorScale/ColorScale.d.ts +4 -4
- package/types/src/components/Legend/legendRender.d.ts +1 -1
- package/types/src/components/TextBox.d.ts +1 -1
- package/types/src/shapes/Bar.d.ts +1 -1
- package/types/src/shapes/Box.d.ts +1 -1
- package/types/src/shapes/Rect.d.ts +1 -1
- package/types/src/shapes/Whisker.d.ts +1 -1
- package/types/src/shapes/textureKey.d.ts +9 -0
- package/types/src/utils/D3plusConfig.d.ts +42 -1
- package/umd/d3plus-core.full.js +2393 -594
- package/umd/d3plus-core.full.js.map +1 -1
- package/umd/d3plus-core.full.min.js +1945 -1601
- package/umd/d3plus-core.js +1744 -404
- package/umd/d3plus-core.js.map +1 -1
- package/umd/d3plus-core.min.js +1401 -1087
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ColorDefaults } from "@d3plus/color";
|
|
2
2
|
import type { DataPoint } from "@d3plus/data";
|
|
3
3
|
import type VizBase from "../charts/viz/VizBase.js";
|
|
4
|
+
import type { LinkOption } from "../charts/viz/linkGroup.js";
|
|
4
5
|
import type { AccessorFn } from "./AccessorFn.js";
|
|
5
6
|
import type { SizeLegendLineConfig, SizeLegendShapeConfig, SizeLegendTextConfig } from "../components/SizeLegend/SizeLegend.js";
|
|
6
7
|
import type { SizeLegendScale, SizeLegendSize } from "../components/SizeLegend/sizeLegendLayout.js";
|
|
@@ -222,6 +223,14 @@ export interface TrendLineConfig {
|
|
|
222
223
|
confidenceLevel?: number;
|
|
223
224
|
/** Area shape config for the confidence band. Its fill defaults to the line color. */
|
|
224
225
|
confidenceConfig?: Record<string, unknown>;
|
|
226
|
+
/**
|
|
227
|
+
Extends each trend line past the end of its data: a number of steps (at the data's own spacing — the median gap between values, or the calendar interval of dates), or `{to}` an end value to step up to (a number, or on a time axis a Date or a parseable date such as a year). Widens the axis to fit. Ignored on a category axis. Defaults to `0` (off).
|
|
228
|
+
*/
|
|
229
|
+
projection?: number | {
|
|
230
|
+
to: number | string | Date;
|
|
231
|
+
};
|
|
232
|
+
/** Line shape config for the projected stretch, merged over the line's own styles. Defaults to `{strokeDasharray: "2 4"}`. */
|
|
233
|
+
projectionConfig?: Record<string, unknown>;
|
|
225
234
|
/** Shows the fitted equation, R², and observations when hovering a line. Defaults to `true`. */
|
|
226
235
|
tooltip?: boolean;
|
|
227
236
|
/** Line color. Defaults to the series color (dark gray when `group` is `"all"`). */
|
|
@@ -234,6 +243,8 @@ export interface TrendLineConfig {
|
|
|
234
243
|
[key: string]: unknown;
|
|
235
244
|
}
|
|
236
245
|
export interface ColorScaleConfig {
|
|
246
|
+
/** The scale's colors: one color, expanded into a light→dark ramp, or an array of colors to step through. */
|
|
247
|
+
color?: string | string[];
|
|
237
248
|
/**
|
|
238
249
|
For a linear scale, the `[min, max]` values used by the color scale; values
|
|
239
250
|
outside this range map to the nearest color.
|
|
@@ -367,10 +378,37 @@ export interface D3plusConfig {
|
|
|
367
378
|
/** Configuration for the legend component. */
|
|
368
379
|
legendConfig?: {
|
|
369
380
|
label?: DataPointAccessor<string>;
|
|
381
|
+
/**
|
|
382
|
+
Each item's swatch: `"Rect"` (a square), `"Circle"` (a dot), or `"Line"`
|
|
383
|
+
(a dot with a short stroke through it). Defaults to the shape of the
|
|
384
|
+
series it stands for: a dot for Circles, the line glyph for Lines, and
|
|
385
|
+
a square for everything else.
|
|
386
|
+
*/
|
|
387
|
+
shape?: "Rect" | "Circle" | "Line" | DataPointAccessor<string>;
|
|
370
388
|
shapeConfig?: Record<string, string | number>;
|
|
371
389
|
};
|
|
372
390
|
/** Inverts legend click behavior (click hides / shift-click solos, or the reverse), or an accessor receiving the viz. */
|
|
373
391
|
legendFilterInvert?: boolean | ((viz: VizBase) => boolean);
|
|
392
|
+
/**
|
|
393
|
+
Whether one legend may be drawn inside the empty space around the chart's
|
|
394
|
+
marks instead of in a margin (size legend first, then legend, then
|
|
395
|
+
colorScale), or an accessor receiving the resolved config. Defaults to `true`.
|
|
396
|
+
*/
|
|
397
|
+
legendInset?: boolean | ((config: D3plusConfig) => boolean);
|
|
398
|
+
/** Style of the semi-transparent box behind a legend drawn inside the chart. */
|
|
399
|
+
legendInsetConfig?: {
|
|
400
|
+
/** Box fill; defaults to the chart's background color. */
|
|
401
|
+
fill?: string;
|
|
402
|
+
fillOpacity?: number;
|
|
403
|
+
stroke?: string;
|
|
404
|
+
strokeWidth?: number;
|
|
405
|
+
/** Corner radius. */
|
|
406
|
+
rx?: number;
|
|
407
|
+
/** Space between the box's edge and the legend inside it. */
|
|
408
|
+
margin?: number;
|
|
409
|
+
/** Space kept between the box and the chart's marks and edges. */
|
|
410
|
+
padding?: number;
|
|
411
|
+
};
|
|
374
412
|
/** Whether the legend uses the visualization's internal padding when positioning, or an accessor receiving the viz. */
|
|
375
413
|
legendPadding?: boolean | ((viz: VizBase) => boolean);
|
|
376
414
|
/** Position of the legend, or an accessor returning it. */
|
|
@@ -381,6 +419,8 @@ export interface D3plusConfig {
|
|
|
381
419
|
legendTooltip?: TooltipConfig;
|
|
382
420
|
/** Whether to show labels on line charts. */
|
|
383
421
|
lineLabels?: boolean;
|
|
422
|
+
/** Links this chart to every other chart with the same group name, so hovering, `active`, `highlight` (including search), and legend hide/solo clicks in one are mirrored in the rest, and a value gets the same categorical color in every chart. Rows match across charts by the value of `by` (a data key or accessor), which defaults to the chart's own id. A string is shorthand for `{group}`; set `hover`, `active`, `highlight`, `legend`, or `color` to `false` to stop sharing that behavior. */
|
|
423
|
+
link?: LinkOption;
|
|
384
424
|
/** Whether to show the loading message. */
|
|
385
425
|
loadingMessage?: boolean;
|
|
386
426
|
/** Custom HTML content for the loading indicator, or a function receiving the viz instance. */
|
|
@@ -557,7 +597,8 @@ export interface D3plusConfig {
|
|
|
557
597
|
/**
|
|
558
598
|
Options for the trend lines: `group` (`"series"` or `"all"`), the
|
|
559
599
|
polynomial `order`, a `confidence` band with `confidenceLevel` and
|
|
560
|
-
`confidenceConfig`, `
|
|
600
|
+
`confidenceConfig`, a `projection` into the future with
|
|
601
|
+
`projectionConfig`, `tooltip`, and Line styles (`stroke`,
|
|
561
602
|
`strokeWidth`, `strokeDasharray`, …).
|
|
562
603
|
*/
|
|
563
604
|
trendLineConfig?: TrendLineConfig;
|